Description Usage Arguments Author(s) Examples
I'm not sure about if these should be like gaussian.walk or this. The function from metropolis returns function(state,...), and the ... is passed to the rprop and dprop functions. It allows for this to work, but in practice it seems to make code less self contained and more confusing, since you have to suppply arguments to iterate to control the walker. On the other hand this method means one less intermediate function to construct, and the opportunity to adapt without creating a new proposal function.
1 | uniform.walk(state, eps = 1)
|
state |
current state |
eps |
maximum magnitude of a jump |
Grady Weyenberg
1 2 3 | tgt <- function(state)
-mahalanobis(as.vector(state),colMeans(iris[1:4]),var(iris[1:4]))/2
iterate(10, metropolis(tgt,uniform.walk), rep(0,4), eps=0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.