# Cross-Correlation Propagation of Uncertainty

I would like to calculate the uncertainty of the cross-correlation of two functions (in two dimensions but even one-dimension is a great start). Experimentally, I have discrete values of f and g, and corresponding uncertainties of $$\sigma_f$$ and $$\sigma_g$$. The definition of cross-correlation

$$(f\bigstar g)(t) \equiv \int_{-\infty}^{\infty}f^*(t')\,g(t'+t)\,\mathrm{d}t'$$

Note: my values of $$f$$ are real so I'll drop the complex-conjugate

Attempted solution: Following the formula for uncertainty propagation

$$\sigma_F^2 = \sum \sigma_{x_i}^2[\frac{\partial F}{\partial x_i}]^2$$

I get

$$\sigma_{f\star g}^2 = \sigma_f^2 \,[\frac{\partial }{\partial f}(f\star g)]^2 + \sigma_g^2 \,[\frac{\partial }{\partial g}(f\star g)]^2$$

$$~~~~~~~ = \sigma_f^2\left [ \int_{-\infty}^\infty g(t'+t)\,\mathrm{d}t' \right ]^2+\sigma_g^2 \left [ \int_{-\infty}^\infty f(t')\,\mathrm{d}t' \right ]^2$$

but this is problematic in my context. It is true in my case that $$f$$ is a probability distribution function, such that

$$\int_{-\infty}^\infty f(t')\,\mathrm{d}t' = 1$$

But this is not the case for $$g$$, it is possible that $$g(t) > 1$$, such that

$$\int_{-\infty}^\infty g(t'+t)\,\mathrm{d}t' \rightarrow \infty$$

and thus, in my use case, although the second term goes to $$\sigma_g^2$$, the first term blows up.

Alternative, since I must ultimately convert this into a numerical calculation where $$f$$ and $$g$$ are defined over a two-dimensional domain. I tried doing an uncertainty propagation with discrete values of $$f$$ and $$g$$ where

$$(f\star g)_{n,m}\equiv \sum_{j=-\infty}^{\infty} \sum_{i=-\infty}^{\infty}f^*_{i,j}~ g_{n+i,m+j}$$

and I get

$$(\sigma_{f\star g})_{n,m}^2 = (f^{*2}\star \sigma_g^2)_{n,m} + (\sigma_f^2\star g^2)_{n,m}$$

where $$n,m$$ are matrix indices. This looks nice, and converges (... I think) but I could not get to this same result when I tired using continuous functions for $$f$$ and $$g$$, so I'm not sure if this is a general result.

Thanks for the help!!

$$\sigma_{f\star g}^2(x,y) = (f^{*}\star \sigma_g)^2(x,y) + (\sigma_f\star g)^2(x,y)$$
... though I'm not sure about the squares; I am not sure how to connect the the equation for uncertainty propagation ($$\sigma_F^2 = ...$$) to what I find in the functional derivative page.