Markov Chain - draw - Julia


#1

Dear All,

I am trying to run the code for simulating from a Markov Chain in Julia (http://quant-econ.net/jl/finite_markov.html). I get the following error message when executing the draw(d,5) command:

ERROR: PyError (:PyObject_Call) <type 'exceptions.TypeError'>

TypeError('draw() takes no arguments (2 given)',)



[inlined code] from /Users/garlappi/.julia/v0.4/PyCall/src/exception.jl:81

 in pycall at /Users/garlappi/.julia/v0.4/PyCall/src/PyCall.jl:344

 in draw at /Users/garlappi/.julia/v0.4/PyPlot/src/PyPlot.jl:460

QuantEcon is installed. Any idea?

Thank you for the great tutorial!

Best,

Lorenzo


#2

Hi Lorenzo,

Thanks for posting here.

I cannot reproduce you error. In fact, when I run the code in that example I get:

julia> using QuantEcon

julia>  psi = [0.1, 0.9];

julia> d = DiscreteRV(psi);

julia> draw(d, 5)
5-element Array{Int64,1}:
 2
 2
 2
 2
 2

From the error message it appears that you have loaded some python package in your Julia session. Can you try just the lines above in a fresh Julia session and let us know how it goes?

Thanks

// Spencer


#3

You are correct. On a Fresh Julia session the code runs fine.
Thanks for your help!

Lorenzo