How to fit a normal approximation to data in Julia

Just to add another option: the Distributions package provides a fit method that lets you fit distributions to data, in your case:

julia> f = [12, 199, 3125, 29616, 175426, 662401, 1608671, 2477850, 2441350,
     1580290, 709625, 235426, 60899, 12643, 2126, 296, 41, 4, 0, 0];

julia> fit(Normal, f)
Normal{Float64}(μ=500000.0, σ=812968.9963148657)
1 Like