Description Usage Arguments Details References Examples

This function generates a Markov chain using a random walk Metropolis-Hastings algorithm.The user supplies target distribution, burn-in time, the length of the chain and the variance of proposal distribution. And a Markov chain after discarding burn-in samples is returned, which can be used for monitoring convengence.

1 | ```
Metropolis(burn_in=1000,dist=dcauchy,sigma,N=10000,print_acc=F)
``` |

`burn_in` |
the total length of discarding |

`dist` |
the target distribution |

`sigma` |
the variance of the normal proposal distribution |

`N` |
the length of Markov chain |

`print_acc` |
if print acceptance rate or not |

Metropolis generates a Markov chain using a Metropolis-Hastings algorithm. The aim is to generate random numbers from specific distribution based on Normal proposal distribution

Statistic computing with R. Maria L. Rizzo

1 2 3 4 5 | ```
## Not run:
y=Metropolis(sigma=2,print_acc=T)
plot(density(Metropolis(sigma = 3,print_acc = T)))
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.