audrey-b / sims

An R package to simulate data from JAGS or R Code
https://poissonconsulting.github.io/sims/
Other
1 stars 2 forks source link

vector parameters causing error in sims_simulate #18

Closed audrey-b closed 5 years ago

audrey-b commented 5 years ago

This used to work but now it gives me an error: sims_simulate("a ~ dt(theta[1],theta[2],df)", nsims = 1, parameters = nlist(df=1, theta=c(1,1))) Error: jags code must include at least one observed stochastic variable node.

However these work: sims_simulate("a ~ dt(theta1, theta2 ,df)", nsims = 1, parameters = nlist(df=1, theta1=1, theta2=1)) $a [1] 1.555005

an nlists object of an nlist object with 1 natomic element

sims_simulate("a ~ dt(theta[1],theta[2],df)", nsims = 1, parameters = nlist(df=1, theta=c(1,1)), latent=NA) $a [1] 3.765035

an nlists object of an nlist object with 1 natomic element

joethorley commented 5 years ago

fixed

sims_simulate("a ~ dt(theta[1],theta[2],df)", 
                             nsims = 1, parameters = list(df=1, theta=c(1,1)))
$a
[1] 2.016239

an nlists object of an nlist object with 1 natomic element