# Help with Normal Distribution

**URL:** <https://discourse.julialang.org/t/help-with-normal-distribution/68486>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [September 20, 2021, 5:05pm UTC](https://discourse.julialang.org/t/help-with-normal-distribution/68486 "2021-09-20T17:05:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaquelSantos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raquelsantos/32/3668_2.png) [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Post date:** [September 20, 2021, 5:05pm UTC](https://discourse.julialang.org/t/help-with-normal-distribution/68486/1 "2021-09-20T17:05:25Z")

</div>

Because when I compile my model I get the following error message:

```julia
MethodError: no method matching Normal(; μ=0.16, σ=0.05)

```

```julia
using JuMP, Gurobi, Random, Distributions
Modelmathematical = Model(Gurobi.Optimizer)

a = 280
w = 5
t = 18
#Parameters
Q = rand(280,5)
A = 1:a 
W = 1:w
T = 1:t 
FC = 3
RD = rand(280)
RHE = [150,150,150,150,150]
OHE = [25,25,25,25,25]
NE = [14,56,25,67,122]
WH = rand(18,5)

#Variable
@variable(Modelmathematical ,s[A,T]>=0)
@variable(Modelmathematical ,x[A,T]>=0)

Random.seed!(123) # Setting the seed
violationcases_ok = 0
violationcases = 0

for ctd = 1:10000
    n = zeros(Float64,a)
    for a in A
        d = Normal(μ = 0.16, σ = 0.05)
        n[a]=rand(d,1)
    end

   for t in T, w in W
        charge = value.(sum(Q[a,w]*x[a,t]+n[a]*[x][a,t]+s[a,t] for a in A if RD[a]<=FC))
        capacity = RHE[w]+OHE[w]*NE[w]-WH[w,t]
            if charge <= capacity
                violationcases_ok = violationcases_ok+1
            else
                violationcases = violationcases+1
            end
    end

    percentage = violationcases/(violationcases_ok+violationcases)
    return percentage
end

```

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [September 20, 2021, 5:07pm UTC](https://discourse.julialang.org/t/help-with-normal-distribution/68486/2 "2021-09-20T17:07:51Z")

</div>

It seems `Normal` does not accept keyword arguments. You have to just do `Normal(0.16, 0.05)` instead of using keyword arguments.
