i only need part 3 to be answered. thanks Practice with PDFs and probability con
ID: 2265765 • Letter: I
Question
i only need part 3 to be answered. thanks
Practice with PDFs and probability concepts 1. Use the built-in MATLAB function "random" to generate a set of 1000 random numbers from one of the following probability density functions: Exponential, Normal, Rayleigh, Poisson. (see https://www.mathworks.com/help/stats/random.html) 2. Use the built-in MATLAB function "histogram” to create a histogram of the result of part 1. Set the 'Normalization' option to 'pdf. Then use the 'hold on' command to preserve this histogram so you can plot something else on top of it. https://www.mathworks.com/help/matlab/ref/histogram.html 3. Use the built-in MATLAB function "pdf" to generate a vector of the probability density function you chose in part 1 (use at least 100 elements in your vector). Set the bounds of your x vector using the max and min of the random numbers you generated in part 1 https://www.mathworks.com/help/stats/pdf.html 4. On the same axes as the histogram from part 3, plot the pdf you generated. Compare the shape of the histogram with the shape of the probability density function. How could you improve the agreement between the histogram and the pdf? 5. Repeat steps 1-4 for one of the other pdf choices given in part 1. Compare the two PDFs. How would you expect the behavior of two random numbers distributed according to these PDFs to differ?Explanation / Answer
3)
x1 = random('Normal',0,1,1,1000);
x1=x1(1:100);
x1=x1(x1>=min(x1));
x1=x1(x1<=max(x1));
y2 = pdf('Normal',x1,0,1);
y2=y2(y2>=min(x1));
y2=y2(y2<=max(x1));
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.