brian-j-smith / Mamba.jl

Markov chain Monte Carlo (MCMC) for Bayesian analysis in julia
Other
253 stars 52 forks source link

Nodes in Models - Mamba #134

Closed lucasfreitas1988 closed 6 years ago

lucasfreitas1988 commented 6 years ago

Hello! I'm a Brazilian NewBie in Julia. I want to use Mamba. I can not use the examples available in Git, a "Model is not defined" message appears. My Julia version is 0.6.2 and i use the atom. In nodes, appears the mensage "An unmonitored node of type "Mamba.ScalarStochastic" NaN"

I need help!

Thank you

bdeonovic commented 6 years ago

As per our discussion in e-mail:

Your error is a simple one: since you loaded both JuMP and Mamba, and since both export a function called Model you MUST qualify the use of Model with the module that you want to use it from. i.e. if you want to use Mamba's Model function you have to write:

model = Mamba.Model(....)

Otherwise julia won't know which Model you are trying to use! Note when I ran your code I got the following warning:

WARNING: both JuMP and Mamba export "Model"; uses of it in module Main must be qualified ERROR: UndefVarError: Model not defined

which basically tells you the issue right there. Warnings are important, take notice!

Good luck and let me know if you have any other issues.

lucasfreitas1988 commented 6 years ago

Thank you very much!

I am a native of R and I still take my first steps in Julia. I am lucky to find a participatory community, I think this is fundamental for language to develop. We are on the right way.

Best regards!