# Error running mamba

**URL:** <https://discourse.julialang.org/t/error-running-mamba/6530>\
**Category:** Statistics\
**Tags:** question\
**Created:** [October 18, 2017, 7:38pm UTC](https://discourse.julialang.org/t/error-running-mamba/6530 "2017-10-18T19:38:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enzo\_Hernandez](https://avatars.discourse-cdn.com/v4/letter/e/f9ae1b/32.png) [@Enzo\_Hernandez](https://discourse.julialang.org/u/Enzo_Hernandez)\
**Post date:** [October 18, 2017, 7:38pm UTC](https://discourse.julialang.org/t/error-running-mamba/6530/1 "2017-10-18T19:38:41Z")

</div>

hey guys i’m getting this error while running my model in mamba:  
‘LoadError: ArgumentError: matrix is not symmetric/Hermitian. This error can be avoided by calling cholfact(Hermitian(A)) which will ignore either the upper or lower triangle of the matrix.’  
i can’t crack it on my own, please help.  
here is the code:

```julia
using Mamba
using Distributions
##Data
data=Dict{Symbol,Any}(
    :z => [1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0,
      0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0,
      0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0,
      0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0,
      1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0],

    :y => [0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0,
        1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0,
        1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0,
        1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 1.0,
        1.0, 1.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0],

    :x => [1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0,
        1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0,
        1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0,
        1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0,
        1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0]
)
data[:sig] = eye(5)
data[:J] = 20
data[:I] = 5

##Model
model=Model(

    z = Stochastic(2,
     (b, x, y) ->
        UnivariateDistribution[
        Bernoulli(1+exp(transpose(b[j])*(y[i, j]-x[i, j])))^(-1)
        for i in 1:I, j in 1:J
        ],
     false
    ),

    b=Stochastic(1,
     (mu, sig) ->
        MultivariateDistribution[
        MultivariateNormal(mu,sig)
        for j in 1:J
        ]
    ),

    mu=Stochastic(1,
     (mu0, sig0)->
        MultivariateNormal(mu0, sig0)
    ),

    mu0=Stochastic(1,
        ()->Uniform(0,1),
     false
    ),

    sig0=Stochastic(2,
        ()->Uniform(0,1),
     false
    )

)

##Initial Values
inits=[
    Dict(:z => data[:z], :b =>zeros(5,10), :mu => rand(5), :mu0 => rand(5), :sig0 => rand(5,5)),
    Dict(:z => data[:z], :b =>rand(5,10), :mu => ones(5), :mu0 => ones(5), :sig0 => rand(5,5))
]

#Sample Scheme
scheme = [AMWG(:mu,1.0), AMWG(:b,1.0)]
setsamplers!(model,scheme)

##MCMC simulation
sim= mcmc(model, data, inits, 10000, burnin=2500, thin=2, chains=2)
describe(sim)

```

i actually have no idea what i am doing in the sample scheme section.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 19, 2017, 8:31am UTC](https://discourse.julialang.org/t/error-running-mamba/6530/2 "2017-10-19T08:31:56Z")

</div>

You can always open an issue in the Mamba repo, the maintainers are very helpful.
