Performing Monte Carlo Sampling

142 ビュー (過去 30 日間)
Georgios Vamvakopoulos
Georgios Vamvakopoulos 2016 年 8 月 13 日
編集済み: Torsten 2022 年 5 月 11 日
Hello Guys,
I need to develop a model which performs a monte carlo simulation. Basically I have 6 PDF's (probability density functions) and I need to take 10000 random samples for each one of them. Afterwards the samples will be placed in the model and the results will be placed in a (1,10000) matrix. My problem is that I searched to find how to do the sampling and couldn't find something reliable to perform it. I attached an example of one of the PDF's so you could help to understand it. Thank you in advance :)
% Drag Coefficient
mu = 1.08;
sigma = 0.14;
x = (0) : (sigma / 100) : (mu + 5 * sigma);
pdfNormalCd = normpdf(x, mu, sigma)/10; %/10
figure;
plot(x, pdfNormalCd);
xlabel('Drag Coefficient'); ylabel('Pdf');
title('PDF for Drag Coefficient ');
for i=1:1000
end

回答 (3 件)

Swathik Kurella Janardhan
Swathik Kurella Janardhan 2016 年 8 月 16 日
You can refer to this video Monte Carlo Simulation in Matlab that explains about how to do Monte Carlo sampling. Also refer to this link that explains about different ways of doing sampling.

Isabella Osetinsky-Tzidaki
Isabella Osetinsky-Tzidaki 2016 年 12 月 12 日
L=length(x);
Rmat=nan(L,10000);
for i=1:10000
R=normrnd(mu,sigma,[L,1]);
Rmat(:,i)=R;
end

sogol bandekian
sogol bandekian 2022 年 5 月 10 日
編集済み: sogol bandekian 2022 年 5 月 11 日
I have question regarding monte carlo sampling.
where should I start to learn about MC and write it in Matlab?if anybody has any references please send this for me
  1 件のコメント
Torsten
Torsten 2022 年 5 月 11 日
編集済み: Torsten 2022 年 5 月 11 日
If your question was more specific, the answer could probably better address your need.

サインインしてコメントする。

カテゴリ

Find more on Monte-Carlo in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by