The power and simplicity of propagating errors with Monte Carlo simulations | by LucianoSphere | Jul, 2023


Mastering uncertainty in data analysis and model fitting, with hands-on code and examples

LucianoSphere

Towards Data Science

Photo by eskay lim on Unsplash

There’s quite a lot about Monte Carlo methods in general at Towards Data Science, but not really much about their very important and useful application to error propagation other than a great introduction by Shuai Guo and a few other articles:

Here, I want to put forward some concrete numerical applications with code for you to actually try and feel first-hand how Monte Carlo methods can be extremely helpful, yet easy-to-implement, for the propagation of errors throughout calculations of almost any kind.

I will begin with a very simple application to propagating the errors during a subtraction operation, to then exemplify how you can use essentially the same idea to propagate errors in virtually any kind of numerical routine from a simple linear regression to a very complex fitting procedure that would be very hard to approach analytically.

Error propagation is a fundamental concept in data analysis and scientific computing. When you have measurements with uncertainties, performing mathematical operations on these values will result in propagated errors in the final calculated result. For simple arithmetic operations, error propagation can be done analytically using formulas. If you are interested in analytical error propagation, check out this resource:

However, for more complex operations involving multiple variables and non-linear functions, or for large calculation procedures such as those involved in data fitting or…



Source link

Leave a Comment