How do I sample a function using the metropolis algorithm?

2 vues (au cours des 30 derniers jours)
Gaëtan Poirier
Gaëtan Poirier le 20 Oct 2017
Commenté : Walter Roberson le 20 Oct 2017
f(x)=exp(-x/lambda)*1/lambda
Write a program to sample f(x) by the Metropolis algorithm. Start from any position you like. Equilibrate the random walk for several hundred steps before collecting samples. After equilibration, divide the random walk into n_mea blocks of n_smpls_per_mea each.
  1 commentaire
Walter Roberson
Walter Roberson le 20 Oct 2017
Presumably you were given a reference to the required algorithm in class or in one of the texts for the class.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Condensed Matter & Materials Physics dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by