Quickly adapt starting values in MCMC using paste()

January 15, 2011
By

(This article was first published on joint posterior, and kindly contributed to R-bloggers)

Waiting for convergence of MCMC models can take some time, therefore it may be a good idea to use better starting values. Using paste, one can quickly convert any (parameter) vector in the workspace into a R-style vector (with c()).

Here's a function that takes any vector (for example 1:10) and turns it into c(1,2,3,4,5,6,7,8,9,10). Now it's easy to quickly adapt starting values in your code.

[update 1]
Well, of course we can do the same with matrices.


To leave a comment for the author, please follow the link and comment on his blog: joint posterior.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags:

Comments are closed.