Fix computation of objective function in OSR if covariances are specified

Due to the preprocessor adding entries for all variable combination into i_var, variables contained in covariances obtained a wrong weighting. By only selecting the unique entries, this cannot happen anymore. Moreover, the computation intensity of the objective does not increase quadratically in the objective anymore.
time-shift
Johannes Pfeifer 2014-10-29 20:05:57 +01:00
parent 9300a061aa
commit ecbe428bd7
1 changed files with 2 additions and 0 deletions

View File

@ -77,6 +77,8 @@ H0 = 1e-4*eye(np);
crit=options_.osr.tolf;
nit=options_.osr.maxit;
%extract unique entries of covariance
i_var=unique(i_var);
%% do initial checks
[loss,vx,info,exit_flag]=osr_obj(t0,i_params,inv_order_var(i_var),weights(i_var,i_var));
if info~=0