Calculate expected covariance of the parameters (FIM)

Once we have defined a models and some injected signals, we can proceed to estimate the errors we can expect on the estimation of our parameters. To do so we compute the inverse of the Fisher Information Matrix (FIM) as shown below.

Our first step is to recover the objects created in the previous section.

```

in    = matrix('input.mat');
out   = matrix('output.mat');
noise = matrix('noise.mat');
mdl   = ssm('fitting_model.mat');
```

Next step will be to define input/output ports for the ssm model and the numerical value for the parameters under analysis. Notice that we evaluate the Fisher matrix for a given set of numerical values, here we will use the ones used to generate data so we will get the optimal expected errors. This is also known as the Cramer-Rao (lower) Bound (CRB).

```
%% Input & Output names
inNames  = {'GUIDANCE.IFO_x1'  'GUIDANCE.IFO_x12'};
outNames = {'DELAY_IFO.x1' 'DELAY_IFO.x12'};

params = {'FEEPS_XX','CAPACT_TM2_XX', 'IFO_X12X1', 'EOM_TM1_STIFF_XX', 'EOM_TM2_STIFF_XX'};
values = [0.82 1.08 0.0004 1.3e-6 1.9e-6];
```

Our ssm models are not analytical models which means that to derive them with respect our parameters we need to set a differentiation step. The LTPDA allows to compute it, but we will not enter here in this detail. For this exercise we will use the following values:

```
% Differentiation steps
steps =  [1e-11 2.3e-07 1e-15 8.4e-11 2.4e-12];
```

And now we can call the crb method with the plist provided in the example below

```
%% Estimate Covariance matrix
pl_crb = plist('FitParams', params,...
'paramsValues', values,...
'diffStep', steps,...
'ngrid', 5,...                      % Number of points in the grid to compute the optimal differentiation step for ssm models
'inNames', inNames,...
'outNames', outNames,...
'input', in,...
'f1', 1e-4,...                      % Initial frequency for the analysis
'f2', 1,...                         % Final frequency for the analysis
'model', mdl,...
'Navs', 5,...                       % Force number of averages
'pinv', false);                     % Use the Penrose-Moore pseudoinverse

mcrb = crb(noise, pl_crb);

% Save object
save(mcrb, 'crb_5params_ssm.mat');
```

The method returns an ao with the inverse of the Fisher matrix, i.e. the estimated covariance matrix for our parameters. The square root of the diagonal of this object tell us the error standard deviation we can expect for these parameters and the non-diagonal terms, the correlation between them. In our case, for instance:

Parameter Std. deviation

FEEPS_XX

0.0002

CAPACT_TM2_XX

3.0e-06

IFO_X12X1

1.1e-07

EOM_TM1_STIFF_XX

1.7e-10

EOM_TM2_STIFF_XX

1.6e-10

We will later compare this estimated standard deviations to the ones obtained with our parameter estimation methods.