How do I sample a function using the metropolis algorithm?

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

Presumably you were given a reference to the required algorithm in class or in one of the texts for the class.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Cluster Analysis and Anomaly Detection에 대해 자세히 알아보기

질문:

2017년 10월 20일

댓글:

2017년 10월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by