Question

MATLAB. Using Matlab, simulate 20 independent observations on X, where X~unif[-1,1], X be a standard Cauchy,...

MATLAB. Using Matlab, simulate 20 independent observations on X, where X~unif[-1,1], X be a standard Cauchy, and X is gamma distributed, respectively.

Homework Answers

Answer #1

MATLAB code

close all
clear
clc

rng('default') % For Reproducibility

% Uniform Distribution
x_unif = random('Uniform',-1,1,1,20); % Interval [-1 1] and 1x20 => 20 samples
disp('Uniform Distribution');
disp(x_unif);

% Gamma Distribution
x_gamma = random('Gamma',10,5,1,20); % Parameters a = 10 & b = 5
disp('Gamma Distribution');
disp(x_gamma);

% Standard Cauchy Distribution
x_cauchy = trnd(1,1,20);
disp('Standard Cauchy Distribution');
disp(x_cauchy);

output

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
You cannot simulate 10000 values of U, where U ∼ Unif[0, 1]. The only thing you...
You cannot simulate 10000 values of U, where U ∼ Unif[0, 1]. The only thing you can do is simulate 10000 values of Y where Y ∼ f(y|θ) and f(y|θ) = 1/θ * e-y/θ . Is there any way you can simulate 10000 observations of X, where X is the number of heads in 3 flips of a coin where P(H) = .7 using only the simulated values of Y you have?
Let X and Y independent random variables with U distribution (−1,1). Using the Jacobian method, determine...
Let X and Y independent random variables with U distribution (−1,1). Using the Jacobian method, determine the joint distribution of Z=X-Y and W= X+Y.
Using MATLAB solve: The vectors v1=(1,-1,1), v2=(0,1,2), v3=(3,0,1) span R3. Express w=(x,y,z) as linear combination of...
Using MATLAB solve: The vectors v1=(1,-1,1), v2=(0,1,2), v3=(3,0,1) span R3. Express w=(x,y,z) as linear combination of v1,v2,v3.
Estimate the mean of (X)^2 using a MATLAB programming code, where X is a Gaussian random...
Estimate the mean of (X)^2 using a MATLAB programming code, where X is a Gaussian random variable.
A) Suppose that X ∼ N(15, 20) and Y ∼ N(10, 30) are mutually independent. Find...
A) Suppose that X ∼ N(15, 20) and Y ∼ N(10, 30) are mutually independent. Find the distributions (including parameters, if any) of X + Y, X − Y , and 3X + 2Y B) What is the median of a normally distributed random variable with mean µ and standard deviation σ?
For this question, you may (where appropriate) write down an Excel formula using one of the...
For this question, you may (where appropriate) write down an Excel formula using one of the functions listed below instead of providing a numerical answer. However, you must specify clearly the value of each parameter in the Excel function (you may use the 2010 or the 2007 version). If you choose to provide a numerical answer, it should be accurate to 3 significant figures. (a) Let F denote the cumulative distribution function (cdf) of a uniformly distributed random variable X....
Using 20 observations, the following regression output is obtained from estimating y = β0 + β1x...
Using 20 observations, the following regression output is obtained from estimating y = β0 + β1x + β2d + β3xd + ε. Coefficients Standard Error t Stat p-value Intercept 10.24 3.20 3.20 0.006 x 3.25 0.52 6.25 0.000 d −6.93 4.62 −1.50 0.153 xd 3.60 0.60 6.00 0.000 a. Compute yˆ for x = 10 and d = 1; then compute yˆ for x = 10 and d = 0. (Round intermediate calculations to at least 4 decimal places and...
Using 20 observations, the following regression output is obtained from estimating y = β0 + β1x...
Using 20 observations, the following regression output is obtained from estimating y = β0 + β1x + β2d + β3xd + ε. Coefficients Standard Error t Stat p-value Intercept 14.45 3.40 4.25 0.001 x 5.10 0.68 7.50 0.000 d −6.94 3.47 −2.00 0.063 xd 1.01 0.50 2.02 0.061 a. Compute yˆy^ for x = 12 and d = 1; then compute yˆy^ for x = 12 and d = 0. (Round intermediate calculations to at least 4 decimal places and...
Using 20 observations, the following regression output is obtained from estimating y = β0 + β1x...
Using 20 observations, the following regression output is obtained from estimating y = β0 + β1x + β2d + β3xd + ε. Coefficients Standard Error t Stat p-value Intercept 16.32 3.20 5.10 0.000 x 5.59 0.50 11.18 0.000 d −5.61 5.50 −1.02 0.323 xd 3.51 0.54 6.50 0.000 a. Compute yˆy^ for x = 12 and d = 1; then compute yˆy^ for x = 12 and d = 0. (Round intermediate calculations to at least 4 decimal places and...
Consider the simple linear regression model y=10+30x+e where the random error term is normally and independently...
Consider the simple linear regression model y=10+30x+e where the random error term is normally and independently distributed with mean zero and standard deviation 1. Do NOT use software. Generate a sample of eight observations, one each at the levels x= 10, 12, 14, 16, 18, 20, 22, and 24. Do NOT use software! (a) Fit the linear regression model by least squares and find the estimates of the slope and intercept. (b) Find the estimate of ?^2 . (c) Find...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT