Calculate error propagation from two dataset arrays

1 view (last 30 days)
I want to calculate the error propagation from two different datasates.
F1=(a1, a2, a3,.....an)
F2=(b1, b2, b3,.....bn)
The error propagation wanted is gonna be like that dF = sqrt(dF1 + dF2) while the dF is the error propagation.
Please not I dont have the uncertainty on every value (a1,b2,....)

Answers (1)

sanidhyak
sanidhyak on 4 Jun 2025
Hi @Tesla,
I understand that you are trying to calculate the error propagation between two datasets "F1" and "F2" in MATLAB, where individual uncertainties for each element are not provided. Your aim is to compute the propagated error.
When handling such data, a standard approach is to estimate the standard deviation of each dataset as a proxy for uncertainty. Since MATLAB provides a "std" function to compute standard deviation, you can apply it to each dataset before computing the combined propagated error.
Kindly refer to the following code for the same:
% Example datasets
F1 = [
1.2, 2.5, 3.1, 4.0, 5.2];
F2 = [
0.9, 2.1, 2.9, 3.8, 5.0];
% Estimate uncertainties using standard deviation
dF1 = std(F1);
dF2 = std(F2);
% Compute propagated error
dF =
sqrt(dF1^2 + dF2^2);
% Display result
fprintf(
'Estimated propagated uncertainty dF = %.4f\n', dF);
This code calculates the individual standard deviations ("dF1", "dF2") and uses them to derive the overall propagated uncertainty "dF" assuming that both datasets are independent. The "sqrt(dF1^2 + dF2^2)" expression is used as a standard rule in error propagation for independent measurements.
For further reference on the "std" function, you may refer to the following documentation:
  • https://www.mathworks.com/help/matlab/ref/std.html
Cheers & Happy Coding!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!