Hi, I am writing an MCMC likelihood function that comes from a dynamic 
model. I have about 50 state variables for several thousand individuals 
that each get updated iteratively over time. However, some individuals' 
variables get updated at some type steps but not at others (because they 
are inactive). I'd like to be able to write something of the sort

k = 50
n = 1000
states = rand(n, k)
typeof!(states, "DataFrame")

function dynupdate(states, active)
    with(states[active,:], {
                           x1 = x1 .* 2
                           x2 = par1 .* x3 .*x 2
                           x3 = par3 .* (x1 + x3)^2})
    return(states)
   }


Forgive the sloppy coding, I'm quite new to Julia.  I'm not sure the best 
way to do this. The other complication is that I want x1,x2,x3 to all 
depend on their value at the last time period. If I update x1 first, then 
x2 will depend on the updated version of x1 and not the past one. I could 
obviously create x1new, x2new, x3new and then update them in states at the 
end, but I'm wondering whats the fastest, most elegant way to do this.

Also, I am struggling to understand how to navigate function documentation 
in Julia. When I type help(with) it gives me almost no information on that 
function. with() is not an easy thing to search for on google either so I 
have no idea what with() does. What's the best way to learn more about 
functions in julia? In R, I rely on the help() and example() a lot.

Thanks!

Steve

Reply via email to