How do I sample a function using the metropolis algorithm?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Walter Roberson
2017-10-20
Presumably you were given a reference to the required algorithm in class or in one of the texts for the class.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Condensed Matter & Materials Physics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!