estimation: change name handling for correlation statements
parent
be33621ca5
commit
2be333da55
|
@ -38,9 +38,9 @@ global estimation_info
|
||||||
if isempty(name2) % parameter or std() statement
|
if isempty(name2) % parameter or std() statement
|
||||||
subsamples_indx = find(strcmp(name1, estimation_info.subsamples_index) == 1);
|
subsamples_indx = find(strcmp(name1, estimation_info.subsamples_index) == 1);
|
||||||
else % corr statement
|
else % corr statement
|
||||||
subsamples_indx = find(strcmp([name1 '_' name2], estimation_info.subsamples_index) == 1);
|
subsamples_indx = find(strcmp([name1 ':' name2], estimation_info.subsamples_index) == 1);
|
||||||
if isempty(subsamples_indx)
|
if isempty(subsamples_indx)
|
||||||
subsamples_indx = find(strcmp([name2 '_' name1], estimation_info.subsamples_index) == 1);
|
subsamples_indx = find(strcmp([name2 ':' name1], estimation_info.subsamples_index) == 1);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,9 @@ end
|
||||||
if isempty(name2) % parameter or std() statement
|
if isempty(name2) % parameter or std() statement
|
||||||
indx = eval(['find(strcmp(name1, estimation_info.' substructure_name ') == 1)']);
|
indx = eval(['find(strcmp(name1, estimation_info.' substructure_name ') == 1)']);
|
||||||
else % corr statement
|
else % corr statement
|
||||||
indx = eval(['find(strcmp([''' name1 '_' name2 '''], estimation_info.' substructure_name ') == 1)']);
|
indx = eval(['find(strcmp([''' name1 ':' name2 '''], estimation_info.' substructure_name ') == 1)']);
|
||||||
if isempty(indx)
|
if isempty(indx)
|
||||||
indx = eval(['find(strcmp([''' name2 '_' name1 '''], estimation_info.' substructure_name ') == 1)']);
|
indx = eval(['find(strcmp([''' name2 ':' name1 '''], estimation_info.' substructure_name ') == 1)']);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1651,7 +1651,7 @@ SubsamplesStatement::writeOutput(ostream &output, const string &basename) const
|
||||||
<< name1 << "','" << name2 << "');" << endl
|
<< name1 << "','" << name2 << "');" << endl
|
||||||
<< "estimation_info.subsamples_index(subsamples_indx) = {'" << name1;
|
<< "estimation_info.subsamples_index(subsamples_indx) = {'" << name1;
|
||||||
if (!name2.empty())
|
if (!name2.empty())
|
||||||
output << "_" << name2;
|
output << ":" << name2;
|
||||||
output << "'};" << endl
|
output << "'};" << endl
|
||||||
<< "estimation_info.subsamples(subsamples_indx).range = {};" << endl;
|
<< "estimation_info.subsamples(subsamples_indx).range = {};" << endl;
|
||||||
|
|
||||||
|
@ -1689,7 +1689,7 @@ SubsamplesEqualStatement::writeOutput(ostream &output, const string &basename) c
|
||||||
<< to_name1 << "','" << to_name2 << "');" << endl
|
<< to_name1 << "','" << to_name2 << "');" << endl
|
||||||
<< "estimation_info.subsamples_index(subsamples_to_indx) = {'" << to_name1;
|
<< "estimation_info.subsamples_index(subsamples_to_indx) = {'" << to_name1;
|
||||||
if (!to_name2.empty())
|
if (!to_name2.empty())
|
||||||
output << "_" << to_name2;
|
output << ":" << to_name2;
|
||||||
output << "'};" << endl
|
output << "'};" << endl
|
||||||
<< "subsamples_from_indx = get_existing_subsamples_indx('" << from_name1 << "','" << from_name2 << "');"
|
<< "subsamples_from_indx = get_existing_subsamples_indx('" << from_name1 << "','" << from_name2 << "');"
|
||||||
<< endl
|
<< endl
|
||||||
|
@ -1885,13 +1885,12 @@ CorrPriorStatement::writeOutput(ostream &output, const string &basename) const
|
||||||
output << "eifind = get_new_or_existing_ei_index('" << lhs_field << "_corr_prior_index', '"
|
output << "eifind = get_new_or_existing_ei_index('" << lhs_field << "_corr_prior_index', '"
|
||||||
<< name << "', '" << name1 << "');" << endl
|
<< name << "', '" << name1 << "');" << endl
|
||||||
<< "estimation_info." << lhs_field << "_corr_prior_index(eifind) = {'"
|
<< "estimation_info." << lhs_field << "_corr_prior_index(eifind) = {'"
|
||||||
<< name << "_" << name1 << "'};" << endl;
|
<< name << ":" << name1 << "'};" << endl;
|
||||||
|
|
||||||
lhs_field = "estimation_info." + lhs_field + "_corr(eifind)";
|
lhs_field = "estimation_info." + lhs_field + "_corr(eifind)";
|
||||||
writePriorOutput(output, lhs_field);
|
writePriorOutput(output, lhs_field);
|
||||||
|
}
|
||||||
|
|
||||||
output << lhs_field << ".name1 = '" << name << "';" << endl
|
|
||||||
<< lhs_field << ".name2 = '" << name1 << "';" << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicOptionsStatement::~BasicOptionsStatement()
|
BasicOptionsStatement::~BasicOptionsStatement()
|
||||||
|
@ -2022,11 +2021,8 @@ CorrOptionsStatement::writeOutput(ostream &output, const string &basename) const
|
||||||
output << "eifind = get_new_or_existing_ei_index('" << lhs_field << "_corr_options_index', '"
|
output << "eifind = get_new_or_existing_ei_index('" << lhs_field << "_corr_options_index', '"
|
||||||
<< name << "', '" << name1 << "');" << endl
|
<< name << "', '" << name1 << "');" << endl
|
||||||
<< "estimation_info." << lhs_field << "_corr_options_index(eifind) = {'"
|
<< "estimation_info." << lhs_field << "_corr_options_index(eifind) = {'"
|
||||||
<< name << "_" << name1 << "'};" << endl;
|
<< name << ":" << name1 << "'};" << endl;
|
||||||
|
|
||||||
lhs_field = "estimation_info." + lhs_field + "_corr(eifind)";
|
lhs_field = "estimation_info." + lhs_field + "_corr(eifind)";
|
||||||
writeOptionsOutput(output, lhs_field, name1);
|
writeOptionsOutput(output, lhs_field, name1);
|
||||||
|
|
||||||
output << lhs_field << ".name1 = '" << name << "';" << endl
|
|
||||||
<< lhs_field << ".name2 = '" << name1 << "';" << endl;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue