[R] problem in R2winBUGS

Uwe Ligges ligges at statistik.tu-dortmund.de
Sun Oct 12 23:15:30 CEST 2014



On 12.10.2014 15:06, thanoon younis wrote:
> Dear all Rusers
> I have error when i wanted to call winbugs from R to estamate parameters
> using bayesian analysis.
>
>   #Call WinBUGS
>
> model<-bugs(data1,data2,init1,init2,parameters,model.file="D:/Run/model.txt",
>      n.chains=2,n.iter=10000,n.burnin=4000,n.thin=1,DIC=True,
>      bugs.directory="c:/Program Files/WinBUGS14/",
>      working.directory="D:/Run/")
>
> and the error is
> #Call WinBUGS
>>
> model<-bugs(data1,data2,init1,init2,parameters,model.file="D:/Run/model.txt",
> +     n.chains=2,n.iter=10000,n.burnin=4000,n.thin=1,DIC=True,
> +     bugs.directory="c:/Program Files/WinBUGS14/",
> +     working.directory="D:/Run/")
> Error in bugs(data1, data2, init1, init2, parameters, model.file =
> "D:/Run/model.txt",  :
>    Number of initialized chains (length(inits)) != n.chains
>
> any help would be greatly appreciated
>


See ?bugs and find that you need to specify exactly one data object and 
one inits object. The latter can be a list containing inits for each chain.

Best,
Uwe Ligges



More information about the R-help mailing list