0001 function [marsD] = estimate(marsD, marsY, params)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 if nargin < 2
0016 error('Need data to estimate');
0017 end
0018 if nargin < 3
0019 params = [];
0020 end
0021
0022
0023 marsY = marsy(marsY);
0024
0025
0026 if ~can_mars_estimate(marsD)
0027 error('This design needs more information before it can be estimated');
0028 end
0029
0030
0031 if n_time_points(marsY) ~= n_time_points(marsD)
0032 error('The data and design must have the same number of rows');
0033 end
0034
0035
0036 SPM = des_struct(marsD);
0037
0038
0039 SPM = pr_estimate(SPM, marsY);
0040 SPM.marsY = marsY;
0041
0042
0043
0044 SPM.SPMid = sprintf('SPM99: MarsBaR estimation. mardo_99 version %s', ...
0045 marsD.cvs_version);
0046
0047
0048 marsD = des_struct(marsD, SPM);
0049