Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.2 KB

README.md

File metadata and controls

38 lines (24 loc) · 1.2 KB

GaussianRandomVariables

This implements a numeric type, GVar, representing a Gaussian (normal) random variable. Some elementary mathematical functions of these variables are implemented, and these also return GVars giving the approximate distribution of the output.

Demo:

julia> using GaussianRandomVariables

julia> x = 5 ± 1
5.0 ± 1.0

julia> 1/x
0.20800000000000002 ± 0.041569219381653054

Related package: Measurements.jl is a much more fully-developed and featureful package which also handles arithmetic with Gaussian random variables. However, it implements first-order (linear) error propagation, which leads to different rules of arithmetic: compare

julia> using GaussianRandomVariables

julia> (0 ± 1)^2
1.0 ± 1.4142135623730951

with

julia> using Measurements

julia> (0 ± 1)^2
0.0 ± 0.0

Measurements is recommended for most users, but GaussianRandomVariables can be recommended if second-order accuracy matters in your application.

GaussianRandomVariables is built on top of ThickNumbers, and the API for working with GVars is described in detail there.