Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Matlab exercise. Often times the probability distribution of a Random Variable of interest is unknown. In such cases Monte Carlo simulation can be a useful
Matlab exercise. Often times the probability distribution of a Random Variable of interest is unknown. In such cases Monte Carlo simulation can be a useful tool to estimate the probability distribution. (recall our Matlab exercise on Homework #1, we saw that as the proportion of coin tosses that land on Heads converges to the true Probability of Heads as n, the number of tosses, gets large i.e. goes to 0)) Suppose that X1, X2, X3 are each Binomial(n=20, p=.80) independent random variables. And let Y = minimum(X1, X2, X3). We are interested in the probability distribution of Y. Randomly generate N= 10000 values for each of X1, X2, X3. Matlab code: >>N=10000; >>n=20; >>p=.8; >>Xl=random("bino', n, p, [N,1]); To create vector Y where Y = minimum(X1, X2, X3) we can use: >>Y-min(X1,min(X2,X3)); so Y = [yi] = [min(x1, x2, x30] Note that Y is a discrete RV (possible values 0,1,2,..., 20). We estimate py(y) = P(Y = y) by the sample proportion of times Y = y. Create a normalized histogram of Y. "normalized for a discrete random variable means to express the column height as proportions (note the proportions must naturally sum to 1; a requirement for any pmf) To create the normalized histogram you can use: >> histogram(Y,'normalization', 'probability) In addition, compute the mean and standard deviation of Y; the commands are mean(Y) and sd(Y) respectively. Note these would be denoted 7 and sy respectively since they are based only on our sample results they are estimates of My and oy respectively. For you to hand in: normalized histogram of Y b. mean and standard deviation of vector Y c. Use your histogram results to estimate P(Y
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started