0001 function ok= calc_model_prior_test;
0002
0003
0004
0005
0006
0007 imdl= mk_common_model('c2c2',16);
0008 try; imdl= rmfield(imdl,'RtR_prior'); end
0009 try; imdl= rmfield(imdl,'R_prior'); end
0010
0011 any_priors= {@prior_tikhonov, ...
0012 @prior_noser, ...
0013 @prior_gaussian_HPF, ...
0014 @prior_laplace};
0015
0016 R_priors= {any_priors{:}, ...
0017 @prior_TV};
0018
0019
0020 eidors_cache clear
0021 for i = 1:length(R_priors); p = R_priors{i};
0022 inv_mdl= imdl;
0023 inv_mdl.R_prior= p;
0024 R= calc_R_prior(inv_mdl);
0025 fprintf('R_prior: %20s R_condest= %5.4g\n', func2str(p), condest(R'*R));
0026 end
0027
0028
0029 eidors_cache clear
0030 for i = 1:length(R_priors); p = R_priors{i};
0031 inv_mdl= imdl;
0032 inv_mdl.R_prior= p;
0033 RtR= calc_RtR_prior(inv_mdl);
0034 fprintf('R_prior: %20s RtR_condest= %5.4g\n', func2str(p), condest(RtR));
0035 end
0036
0037
0038 eidors_cache clear
0039 for i = 1:length(R_priors); p = R_priors{i};
0040 inv_mdl= imdl;
0041 inv_mdl.RtR_prior= p;
0042 RtR= calc_RtR_prior(inv_mdl);
0043 if diff(size(RtR))~=0
0044 fprintf('RtR_prior: %20s RtR_condest= NON-SQUARE\n', func2str(p) );
0045 else
0046 fprintf('RtR_prior: %20s RtR_condest= %5.4g\n', func2str(p), condest(RtR));
0047 end
0048 end
0049
0050
0051 eidors_cache clear
0052 for i = 1:length(R_priors); p = R_priors{i};
0053 inv_mdl= imdl;
0054 inv_mdl.RtR_prior= p;
0055 if strcmp(func2str(p), 'prior_TV')
0056 continue;
0057 end
0058 R= calc_R_prior(inv_mdl);
0059 fprintf('RtR_prior: %20s R_condest= %5.4g\n', func2str(p), condest(R'*R));
0060 end