# A Integrate data plot, combine errors including correlation

1. Jun 16, 2016

### venus_in_furs

Hello

I have a set of data points, with errors (X1 , Y1 +- deltaY1) , (X2 , Y2 +-deltaY2) etc
I have the covariance matrix for these bins

I want to integrate this set of data points: SUM_i ( Y_i * X_binWidth_i )

How do I combine the errors, taking into consideretation the covariance matrix?
So I end up with a single value and a single error?

2. Jun 16, 2016

### venus_in_furs

So for two numbers that are correlated, if I wanted to add them I would do
y1 with error delta1, y2 with error delta2

B = y1 + y2

And the thing i want is detalB = (delta1)^2 + (delta2)^2 + 2 cov[ y1, y2 ]

But what do I do when I am trying to add more than two numbers that are all correlated.. i.e. integrate a set of correlated data points.

3. Jun 16, 2016

### mathman

Basically the same thing: sum of all squares and twice the sum of all covariances gives the variance of the sum.

4. Jun 19, 2016

### chiro

Hey venus_in_furs.

General co-variance formulas can be done using matrix techniques with the co-variance term.

There is a vCv^t formulation where C is the co-variance matrix and v represents the scalar component of the random variable.

It mimics the variance results that are proven with the normal Var[] operator but it allows it to be done with matrices and vectors in an arbitrary fashion.

A multi-variate statistics textbook should have it (or any other similar resource).