LLt = calc_LLt_prior( data0, inv_model ) CALC_LLt_PRIOR: calculate image regularization prior L*L' (which is an estimate of the inverse of the covariance in time) Typically, the image prior is matrix n_frames x n_frames of the normalized a priori cross-correlation between measurement frames where frames are a set of measurements taken at nearly the same time calc_LLt_prior can be called as LLt_prior= calc_LLt_prior( data0, ... ) and will call the function inv_model.LLt_prior parameters to LLt_prior should be passed in the field inv_model.LLt_prior_function_name.parameters If inv_model.LLt_prior is a matrix, calc_LLt_prior will return that matrix, LLt_prior the calculated LLt regularization prior inv_model is an inv_model structure If a function to calculate LLt_prior is not provided, LLt = L_prior * L_prior';
0001 function LLt_prior = calc_LLt_prior( data0, inv_model ) 0002 % LLt = calc_LLt_prior( data0, inv_model ) 0003 % CALC_LLt_PRIOR: calculate image regularization prior 0004 % L*L' (which is an estimate of the inverse of the covariance in time) 0005 % 0006 % Typically, the image prior is matrix n_frames x n_frames of the 0007 % normalized a priori cross-correlation between measurement frames 0008 % where frames are a set of measurements taken at nearly the same time 0009 % 0010 % calc_LLt_prior can be called as 0011 % LLt_prior= calc_LLt_prior( data0, ... ) 0012 % 0013 % and will call the function inv_model.LLt_prior 0014 % parameters to LLt_prior should be passed in the field 0015 % inv_model.LLt_prior_function_name.parameters 0016 % 0017 % If inv_model.LLt_prior is a matrix, calc_LLt_prior will return that matrix, 0018 % 0019 % LLt_prior the calculated LLt regularization prior 0020 % inv_model is an inv_model structure 0021 % 0022 % If a function to calculate LLt_prior is not provided, 0023 % LLt = L_prior * L_prior'; 0024 0025 % (C) 2017 Alistair Boyle. License: GPL version 2 or version 3 0026 % $Id: calc_LLt_prior.m 5720 2018-03-28 11:57:45Z aadler $ 0027 0028 if isfield(inv_model,'LLt_prior') 0029 if isnumeric(inv_model.LLt_prior) 0030 LLt_prior = inv_model.LLt_prior; 0031 else 0032 try inv_model.LLt_prior = str2func(inv_model.LLt_prior); end 0033 LLt_prior= eidors_cache( inv_model.LLt_prior, inv_model ); 0034 end 0035 elseif isfield(inv_model,'L_prior') 0036 LLt_prior = eidors_cache(@calc_from_L_prior, inv_model, 'calc_LLt_prior'); 0037 else 0038 error('calc_LLt_prior: neither L_prior nor LLt_prior provided'); 0039 end 0040 0041 function LLt_prior = calc_from_L_prior(inv_model) 0042 0043 % The user has provided an R prior. We can use this to 0044 % calculate LLt= L*L'; 0045 if isnumeric(inv_model.L_prior) 0046 L = inv_model.L_prior; 0047 else 0048 try inv_model.L_prior = str2func(inv_model.L_prior); end 0049 L= eidors_cache( inv_model.L_prior, inv_model ); 0050 end 0051 0052 LLt_prior = L*L';