Use Matlab to (a) Randomly generate two random variables, x1 and x2, from a prob
ID: 3277778 • Letter: U
Question
Use Matlab to (a) Randomly generate two random variables, x1 and x2, from a probability distribution of your choice (use a random seed, so the grader can replicate your results; comment the distribution you used for random data generation). (b) Compute Expected Value, Variance, Standard Deviation, Mode, Median, Skewness and Kurtosis for x1 and x2 generated for Question (a). (c) Compute the correlation and covariance matrix of x1 and x2 generated for Question (a). Write out your formula to compute these statistics and your answers on the paper. Submit your Matlab scripts as a whole for generating your data, computing these descriptive statistics, displaying yourrExplanation / Answer
a) We generate 100 random numbers from normal distribution with mean = 0, variance = 1 and from exponential distribution with mean =1. They stored in x1, x2 variables in minitab.
Choose Calc > Set Base.
In Set base of random data generator to, enter 1.
Click OK.
Choose Calc > Random Data > Normal.
In Number of rows of data to generate, enter 100.
In Store in column(s), type x1.
In Mean, enter 0.
In Standard deviation, enter 1.
Click OK.
Again
Choose Calc > Random Data > exponential.
In Number of rows of data to generate, enter 100.
In Store in column(s), type x2.
In Scale, enter 1.
Click OK
b)
Welcome to Minitab, press F1 for help.
Descriptive Statistics: X1, X2
Variable N N* Mean StDev Variance Minimum Median Maximum Mode
X1 100 0 -0.0541 0.9510 0.9044 -2.7820 -0.0710 1.5807 *
X2 100 0 1.0003 0.9125 0.8326 0.0141 0.6782 4.9085 *
N for
Variable Mode Skewness Kurtosis
X1 0 -0.22 -0.50
X2 0 1.42 2.49
c)
Click “Stat”, then click “Basic Statistics” and then click “Correlation.”
Click a variable name in the left window and then click the “Select” button to move the variable name to the Variable box. For this question, click “X1,” then click “Select,” then click “X2” then click “Select” to transfer both variables to the Variable window.
Correlations: X1, X2
Pearson correlation of X1 and X2 = 0.098
P-Value = 0.334
Choose Calc > Set Base.
In Set base of random data generator to, enter 1.
Click OK.
Choose Calc > Random Data > Normal.
In Number of rows of data to generate, enter 100.
In Store in column(s), type x1.
In Mean, enter 0.
In Standard deviation, enter 1.
Click OK.
Again
Choose Calc > Random Data > exponential.
In Number of rows of data to generate, enter 100.
In Store in column(s), type x2.
In Scale, enter 1.
Click OK
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.