# Calculate uncertainty from (how to interpolate) a given covariance matrix

Assume that there is a given covariance matrix of an evaluated quantity ( in my case it's a rection cross section $\sigma = f(E)$, where $\sigma$ is the cross section and $E$ is each energy point where it was calculated) $\mathbf{V_\sigma}$

This means that I have a file with the following format

$E_1$ $\sigma_1$ $\delta\sigma_1$

$E_2$ $\sigma_2$ $\delta\sigma_2$

...

$E_m$ $\sigma_m$ $\delta\sigma_m$

and as I said the covariance matrix of $\sigma = f(E)$.

What I want to do is calculate the cross section $\sigma = f(E)$ at some energy points that are not in the file so I decided to do a linear interpolation between two evaluated points $(E_i, \sigma_i)$ and $(E_{i+1}, \sigma_{i+1})$. This means that the $\sigma$ at the desired energy $E$ will be

$\sigma = \dfrac{\sigma_i - \sigma_{i+1}}{E_i - E_{i+1}}(E-E_i)+\sigma_i$

This operation will be done total $n$-times, i.e. I would like to get the cross section at $n$ points by performing the interpolation at $n$ sets (each set consists of two data points).

The question is how to consruct the covariance matrix of the final $n$ points given the covariance matrix of the evaluated cross section?

Any idea would be more that welcome!

Let $C$ be the m by m covariance matrix of $\sigma$ values at the m $E_i$ 's.
Let $A$ be the n by m matrix which produces the n interpolated points from the m $E_i$ 's. So for instance if the first interpolated point is 25% of the way from $E_1$ to $E_2$, the first row of $A$ would be [0.75 0.25 0 .... 0]. Given your interpolation scheme, $A$ will be a bi-diagonal matrix.
Then the covariance matrix of $\sigma$ at the interpolated points is taken as $ACA^T$.
One consequence, howwever, is that there will be non-zero off-diagonal covariances in $ACA^T$, even if the original covariance matrix $C$ has no non-zero off-diagonal covariances. If this is unacceptable, you may need an approach more specific to the "physics" of your problem.