How can I employ Monte Carlo simulation?

2 Ansichten (letzte 30 Tage)
Ulvu Mustafayev
Ulvu Mustafayev am 16 Mai 2020
Kommentiert: Rena Berman am 1 Jun. 2020
How can I write a MATLAB code that generates B = 10000 i.i.d. realizations of zT and tT for sample sizes T = 10, 20, 40, 80, 160. Set the true values to α0 ∈ {−0.8, 0.0, 0.8} and λ = 1.

Antworten (1)

Image Analyst
Image Analyst am 16 Mai 2020
I'm not sure what "Set the true values ​​to α0 ∈ {−0.8, 0.0, 0.8} and λ = 1" means. What are the "true values" which have values of true/false or 1/0?
For what it's worth, I'm attaching some Monte Carlo simulations.
  10 Kommentare
Image Analyst
Image Analyst am 17 Mai 2020
Generate a 1-by-N row vector of normally distributed random numbers. Here's a little demo.
%----------------------------------------------------------------------------
% Draw random numbers from a Guassian distribution.
N = 1000000; % Number of points.
mu = 10; % Mean
sigma = 5; % Standard deviation.
% Draw a million numbers with a mean of mu, and a standard deviation of sigma.
r = sigma * randn(1, N) + mu;
%----------------------------------------------------------------------------
% Show histogram.
histogram(r);
grid on;
fontSize = 20;
xlabel('r Value', 'FontSize', fontSize);
ylabel('Count', 'FontSize', fontSize);
% Verify what we actually got:
rMean = mean(r)
rStdDev = std(r);
caption = sprintf('Histogram. Actual Sample Mean = %f Actual Sample StDev = %f', rMean, rStdDev);
title(caption, 'FontSize', fontSize);
% Maximize figure window
g = gcf;
g.WindowState = 'maximized';
Ulvu Mustafayev
Ulvu Mustafayev am 17 Mai 2020
Thanks a lot

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by