Monte Carlo Simulation using normal random sampling (Gaussian distribution)

조회 수: 3 (최근 30일)
anna diederichs
anna diederichs 2018년 7월 24일
댓글: Jeff Miller 2018년 7월 25일
Hello. I am trying to run a Monte Carlo simulation on my data. I have a loop running to calculate the data points, each with an associated error. For the Monte Carlo simulation, I want to plot a histogram that shows normal distribution (not random) with a mean of 60 and show 1 standard deviation. I want the Monte Carlo simulation to run 1000 times (r). I am having trouble integrating normrnd into my Monte Carlo loop. Below is my code using rand instead of normrnd. How do I do this with a Gaussian distribution, not just random? Thank you very much in advance.
%code:
xmax=x+xerror;
ymin=y-yerror;
ymax=y+yerror;
zmin=z-zerror;
zmax=z+zerror;
r=1000;
disp_x=xmin+(xmax-xmin).*(rand(r,1));
disp_y=ymin+(ymax-ymin).*(rand(r,1));
disp_z=zmin+(zmax-zmin).*(rand(r,1));
**calculation of 'dip' from my imported data using disp_x, disp_y and disp_z **
hist(dip,50)
  댓글 수: 1
Jeff Miller
Jeff Miller 2018년 7월 25일
It is not really clear what you are trying to do or why you are having trouble integrating normrnd. For starters, please say why this does not give what you want:
disp_x = normrnd(60,1,r,1);

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Monte-Carlo에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by