Is there any way to save a jags.model() object into a RData or txt file ?
To perform MCMC on a better computer, I have to save my model on one and using it in a new workspace. But I've some difficulty to use "save()" and "load()" function on R. Thanks for your advices.
Added:
I tried:
jags <- jags.model('regression.bug', data = my.data, n.chains = 4, n.adapt = 1000)
Then I would like save "jags"
save( jags , file="jags.RData")
It's look like if it's saved. But, when I try:
ld.jags <- load( "jags.RData" )
ld.jags
[1] "jags"
And I don't know How I could use "ld.jags" to perform my analysis.
save
andload
which are what I'd typically suggest using. Can you add further detail to your question about what you've tried and the problems you encountered when doing so please? – Mitosisload
will restore a list object to the global environment with the name that it had when saved.id.jags
is now a character value that has the same characters as the name of that object but it is not the R name.names
are language objects. If you type the uncommented charactersjags
at the command line you should see the results ofprint(jags)
. You don't say what you mean by "perform your analysis";jags
is already the results of an earlier analysis. – Swatchcoda
to perform some post-analysis such asgelman.plot()
, or even a simpleplot()
which is very long to perform because of the uge number of params. I perform JAGS on a computer for 2-3hours and then I would like to save the result on a file for further analysis on another PC. So How can I do? – Gravelcoda
? Or do you need to save the model object so that you can update the chains and draw more posterior samples? – Advertence