Skip to content

HolyLab/GaussianRandomVariables.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Math (second-order accuracy) with random variables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages