### Estimating the correlation matrix and effective number of parameters

We can estimate the autocorrelation matrix by assuming that it depends only on the distance in time, and estimate the autocorrelation matrix.

The original autocorrelation function used to generate the sample was:

`## [1] 1.0 0.4 0.1`

The effective autocorrelation function estimated from the sample is:

`## [1] 1.00000000 0.57197604 0.20089824 0.13886221 0.09787491`

`## [1] 33.51672`

Due to autocorrelation, the effective number of parameters is less than nObs = 100.

### Computing the mean and its standard deviation

First we compute the distribution parameter of the sum of the 100 variables. The multiplicative uncertainty has decreased from 1.7.

```
#coefSum <- estimateSumLognormal( theta[,1], theta[,2], effAcf = effAcf )
coefSum <- estimateSumLognormal( theta[,1], theta[,2], effAcf = c(1,acf1) )
setNames(exp(coefSum["sigma"]), "sigmaStar")
```

```
## sigmaStar
## 1.077687
```

Its expected value corresponds to the sum of expected values (100*10).

```
## mean
## 1000
```

The lognormal approximation of the distribution of the sum, is close to the distribution of the 10000 repetitions.

The mean is the sum divided by the number of observations, \(n\). While the multiplicative standard deviation does not change by this operation, the location parameter is obtained by dividing by \(n\) at original scale, hence, subtracting \(log(n)\) at log-scale.

```
## mu sigma
## 2.2997863 0.0748167
```

And we can plot the estimated distribution of the mean.