# Linear combination of data with uncertainty

• A
• Malamala
In summary: What is the context?In summary, the conversation is discussing how to compute the value and uncertainty of a linear combination of two measured data points with different errors. This is equivalent to fitting the two points with a straight line and extracting the uncertainty on the slope and intercept. The suggested approach is to use the rule for variances of linear combinations of independent random variables and to account for the uncertainties on X and Y when computing the linear combination. The conversation also mentions looking up "Propagation of Errors" for more information. Finally, there is a question about how to determine the uncertainty on the slope and intercept of the linear fit.
Malamala
Hello! I have 2 measured data points (they are measurements of different observable, not 2 measurement of the same observable), with quite different errors, say ##x_1 = 100 \pm 1## and ##x_2 = 94 \pm 10##. I want to compute the value (and associated uncertainty) of a linear combination of them, say ##y = 0.23x_1 + 0.55x_2##. What is the right way to do it, accounting for their different uncertainties? (This is basically equivalent to fitting the 2 points with a straight line, and extracting the uncertainty on the slope and intercept).

Malamala said:
This is basically equivalent to fitting the 2 points with a straight line, and extracting the uncertainty on the slope and intercept)
That's not right. Measuring the uncertainty of the slope and intercept of the line is different to, and more complex than, measuring the uncertainty of the linear combination ##y##.
A typical approach would be to assume that the errors of the two measurements are independent. Since the most common error measurement is a standard deviation, which is the square root of a variance, we can then use the rule for variances of linear combinations of independent random variables, which is that:
$$Var(aX+bY) = a^2\ Var(X) + b^2\ Var(Y)$$
whence
$$error(aX+bY) = \sqrt{a^2\ (error(X) )^2+ b^2\ (error(Y))^2}$$
Substitute your errors from above, with ##a=0.23,b=0.55## and you'll get the answer.

Twigg
andrewkirk said:
That's not right. Measuring the uncertainty of the slope and intercept of the line is different to, and more complex than, measuring the uncertainty of the linear combination ##y##.
A typical approach would be to assume that the errors of the two measurements are independent. Since the most common error measurement is a standard deviation, which is the square root of a variance, we can then use the rule for variances of linear combinations of independent random variables, which is that:
$$Var(aX+bY) = a^2\ Var(X) + b^2\ Var(Y)$$
whence
$$error(aX+bY) = \sqrt{a^2\ (error(X) )^2+ b^2\ (error(Y))^2}$$
Substitute your errors from above, with ##a=0.23,b=0.55## and you'll get the answer.
Thank you for this! But what would be the actual value for ##aX+bY##? Do I just plug in the values for ##X## and ##Y##? Do I account for the uncertainties on X and Y when computing aX+bY?

About the linear fit, if I wanted to fit a straight line to these 2 points, how can I get the uncertainty on the slope and intercept of the fit?

@Malala: Look up 'Propagation of Erros'. It deals with the error/variance in functions of Random variables.

Malamala said:
Thank you for this! But what would be the actual value for ##aX+bY##? Do I just plug in the values for ##X## and ##Y##? Do I account for the uncertainties on X and Y when computing aX+bY?

About the linear fit, if I wanted to fit a straight line to these 2 points, how can I get the uncertainty on the slope and intercept of the fit?
You can't know the actual value, because X,Y are Random Variables. This means/implies you can know their long-term distribution but cannot tell the actual values. Best you can do is use linearity of expectation (Edit: Assuming independence of X,Y):

$$E(aX+bY) =aE(X)+bE(Y)$$

Last edited:
Twigg
Malamala said:
About the linear fit, if I wanted to fit a straight line to these 2 points.
What two points are you talking about?

BvU

## 1. What is a linear combination of data with uncertainty?

A linear combination of data with uncertainty is a mathematical operation that combines multiple sets of data with associated uncertainties to produce a new set of data with a corresponding uncertainty. It involves multiplying each data point by a coefficient and adding them together, while also propagating the uncertainties through the calculation.

## 2. Why is it important to consider uncertainty when combining data?

Uncertainty is an inherent part of any measurement or data collection process. Ignoring uncertainty in the combination of data can lead to incorrect or misleading results. By considering uncertainty, we can better understand the reliability and accuracy of the combined data.

## 3. How is uncertainty represented in a linear combination of data?

Uncertainty is typically represented as a standard deviation or a percentage of the measured value. In a linear combination, the uncertainty is propagated through the calculation using mathematical formulas such as the sum and product rules.

## 4. Can linear combinations be used for any type of data?

Yes, linear combinations can be used for any type of data as long as the data can be represented numerically. This includes continuous data, discrete data, and even categorical data that has been converted into numerical values.

## 5. How can linear combinations of data with uncertainty be applied in scientific research?

Linear combinations of data with uncertainty are commonly used in scientific research to combine data from multiple sources or experiments. This allows researchers to make more accurate and reliable conclusions by taking into account the uncertainties associated with each data set. It can also be used to analyze trends and relationships between variables and to make predictions based on the combined data.

• Set Theory, Logic, Probability, Statistics
Replies
30
Views
2K
• Set Theory, Logic, Probability, Statistics
Replies
5
Views
925
• Set Theory, Logic, Probability, Statistics
Replies
28
Views
2K
• Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
11
Views
737
• Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
21
Views
2K
• Set Theory, Logic, Probability, Statistics
Replies
4
Views
873
• Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K