Question
Please help with the Matlab code for this Some guidelines for the code are: a) The code is to generate a large number (e.g., 10000)
Please help with the Matlab code for this Some guidelines for the code are:
a) The code is to generate a large number (e.g., 10000) of samples of X in each case, and plot the distribution (using the histogram function).For example, for the case when n=5, the code should first generate 5 samples of uniform(0,1) rvs through the rand function, then add them up this way the code will give one sample of X. Then repeat this for 10000 times, to get 10000 samples of X.
b) n and E[n]=5, you would first generate a sample of Poisson rv, say n, then generate n samples of uniform(0,1) rvs and add them up to get one sample of X. Repeat 10000 times to get 10000 samples of X. The poissrnd function also needs to be used.
Suppose Xi's are all independent and uniformly distributed on the interval [0, 1]. Let X = X. + X2 + ... + Xn. Run simulations for the following cases and plot the distribution of X. 1) n is a fixed number. Plot the distribution of X for n = 5, 20, 50, 100. 2) n is a Poisson random variable. Plot the distribution of X for E[n] = 5, 20,50,100Step 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