Question
info here is given to help solve #3 below this photo:
You may use any computer software of your choice to complete this assignment Random variables from the four probability distr

Prob.3 (Laplace Distribution) Consider a two-sided exponential (Laplace) random variable with probability density function gi

Prob. 3 (Gaussian Distribution) Consider a standard Gaussian random variable with probability density function given by x2 2J

You may use any computer software of your choice to complete this assignment Random variables from the four probability distributions given may be generated as follows 1. A standard uniform random variable, U in the interval (0,1), i.e., U ~ U (0,1), may be generated using the Matlab function 'rand'. The corresponding uniform random variable, X in the interval (-1,1) may be obtained as X 2U 1 2. A random variable Xwith a triangular distribution in the interval (-1,1) may be obtained as the difference between two independent standard uniform random variables, i.e., X (U - U2), where U1~U(0,1) and U2 U(0,1) are independent standard uniform random variables. 3. A standard Laplacian random variable may be generated as X In(U1/U2), where UU(0,1) and U2 U(0,1) are independent standard uniform random variables 4. A standard Gaussian random variable Z may be generated by using the Matlab function 'randn'. For each of the four continuous distributions given below, do the following: (a) Generate a large number (at least 5000) random variables with the given distribution and plot a histogram of the samples (properly normalized)- you may use the Matlab function hist (b) Superimpose a plot of the pdf on your histogram (c) Compute the probability that the random variable falls in the intervals shown on the table and verify your result by simulation Note that the probability that a random variable falls in a specified interval, i.e., the probability P(IX s a) = P(-asXs a), may be estimated by generating a very large number of the random variable X and estimating the fraction of them that lie in the interval a, a)
Prob.3 (Laplace Distribution) Consider a two-sided exponential (Laplace) random variable with probability density function given by fx(x) =exp-xl), -o
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution :

Given the distribution :

fx(x)exp(-x), -co<x<oo fx(x) -3 -2 -4 1 4 2 0 3

we compute all the probabilities theoretically as shown below :

=========================================================================

Note we will use the integral :

P(-a X a) fx (x)dx 2 0.5edr 2 0 1 - 1 _ - ea -a

=========================================================================

c0.5 e0.5 P(-0.5 X0.5) 0.5e d 0.393469340287 fx(x)da 2 -0,5

P(-1 X 1) 0.5ed 0.632120558829 fx()dr T 2

c1.5 c1.5 P -1.5 X1.5) 0.5e d 0.776869839852 fx(x)dx -1.5

P(-2 X<2) fx(x)da 0.5edr 0.864664716763 2

2.5 2.5 P (-2.5 X2.5) 0.5e d0.917915001376 fx(x)dx 2,5

3 / P(-3 X 3) fx(x)da -3 0.5e dr 0.950212931632 2

3.5 3.5 P (-3.5 X 3.5) 0.5ed 0.969802616578 fx(x)da -3.5

P-4 X 4) fx(x)da 0.5ed 0.981684361111 2

==================================================================================

simulation based computations :

%*********************

clear all;
clc;
close all;


len = 5000;
X1 = rand(1,len);
X2 = rand(1,len);
X = log(X1./X2);

hist(X,100);


p1 = sum( X>=(-0.5) & X<=(0.5))/len
p2 = sum( X>=(-1) & X<=(1))/len
p3 = sum( X>=(-1.5) & X<=(1.5))/len
p4 = sum( X>=(-2) & X<=(2))/len
p5 = sum( X>=(-2.5) & X<=(2.5))/len
p6 = sum( X>=(-3) & X<=(3))/len
p7 = sum( X>=(-3.5) & X<=(3.5))/len
p8 = sum( X>=(-4) & X<=(4))/len

%*******************

this gives output :

500 400 300 200 100 10 0 10

p1 = 0.38640
p2 = 0.62520
p3 = 0.77720
p4 = 0.86720
p5 = 0.91680
p6 = 0.95060
p7 = 0.97040
p8 = 0.98180

so we have :

Probability Exact Calculation Simulation 0.3935 P(-0.5X0.5) 0.38640 0.62520 PC-1SX1) 0.6321 P(-1.5X1.5) 0.77720 0.7769 0.8647

==================================================================

similarly for gaussian distribution :

1 exp fx(x) 2 fx(x) V2n x -4-3 -2 -1 0 1 2 3 4

we compute all the probabilities theoretically as shown below :

0.5 c0.5 2/2 dr 0.3829 fx(x)da P(-0.5 X0.5) E -0,5

\small P\left ( -1\le X \le 1\right ) = \int_{-1}^{1}f_{X}(x)dx = 2\int_{0}^{1} \frac{1}{\sqrt2\pi}e^{-x^{2}/2}dx = 0.6827

\small P\left ( -1.5\le X \le 1.5\right ) = \int_{-1.5}^{1.5}f_{X}(x)dx = 2\int_{0}^{1.5} \frac{1}{\sqrt2\pi}e^{-x^{2}/2}dx =0.8664

\small P\left ( -2\le X \le 2\right ) = \int_{-2}^{2}f_{X}(x)dx = 2\int_{0}^{2} \frac{1}{\sqrt2\pi}e^{-x^{2}/2}dx = 0.9545

\small P\left ( -2.5\le X \le 2.5 \right ) = \int_{-2.5}^{2.5}f_{X}(x)dx = 2\int_{0}^{2.5} \frac{1}{\sqrt2\pi}e^{-x^{2}/2}dx = 0.9876

\small P\left ( -3\le X \le 3\right ) = \int_{-3}^{3}f_{X}(x)dx = 2\int_{0}^{3} \frac{1}{\sqrt2\pi}e^{-x^{2}/2}dx =0.9973

3.5 3.5 2 dr 0.9995 fx(a)da P (-3.5 X 3.5) E 2T -3.5

\small P\left ( -4\le X \le 4\right ) = \int_{-4}^{4}f_{X}(x)dx = 2\int_{0}^{4}\frac{1}{\sqrt2\pi}e^{-x^{2}/2}dx =0.9999

=========================

Matlab based simulation :

clear all;
clc;
close all;


len = 5000;
X = randn(1,len);

hist(X,100);


p1 = sum( X>=(-0.5) & X<=(0.5))/len
p2 = sum( X>=(-1) & X<=(1))/len
p3 = sum( X>=(-1.5) & X<=(1.5))/len
p4 = sum( X>=(-2) & X<=(2))/len
p5 = sum( X>=(-2.5) & X<=(2.5))/len
p6 = sum( X>=(-3) & X<=(3))/len
p7 = sum( X>=(-3.5) & X<=(3.5))/len
p8 = sum( X>=(-4) & X<=(4))/len

%**************

20 150 100 50

p1 = 0.39180
p2 = 0.68400
p3 = 0.87000
p4 = 0.95380
p5 = 0.98820
p6 = 0.99760
p7 = 0.99980
p8 = 1

So we have :

Probability Exact Calculation Simulation 0.3829 P-0.5 0.5) 0.39180 P(-1SXS1) 0.6827 0.68400 P(-1.5 XS1.5) 0.8664 0.9545 0.870

Add a comment
Know the answer?
Add Answer to:
info here is given to help solve #3 below this photo: You may use any computer...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I must use R Program to solve them. Please help! Thank you ünif uniform random variable...

    I must use R Program to solve them. Please help! Thank you ünif uniform random variable 1) Draw the graphs of the p.d.f. of the following distributions (a) The standard normal p.d.f (b) The normal pdf with ? = 50, ? = 10 (c) The uniform p.d.f. over interval [10, 20] (d) The exponential P.d.f with parameter ? 4. 2) Illustrating the central limit theorem. Let X be a random variable having the uniform distribution over the interval [6, 12]...

  • 2. Suppose that you can draw independent samples (U,, U2,U. from uniform distribution on [0,1]. (a) Suggest a method to generate a standard normal random variable using (U, U2,Us...) Justify your...

    2. Suppose that you can draw independent samples (U,, U2,U. from uniform distribution on [0,1]. (a) Suggest a method to generate a standard normal random variable using (U, U2,Us...) Justify your answer. b) How can you generate a bivariate standard normal random variable? (Note that a bivariate standard normal distribution is a 2-dimensional normal with zero mean and identity covariance matrix.) (c) What can you suggest if you want to generate correlated normal random variables with covariance matrix Σ= of...

  • 12. Let X and Y be independent random variables, where X has a uniform distribution on...

    12. Let X and Y be independent random variables, where X has a uniform distribution on the interval (0,1/2), and Y has an exponential distribution with parameter = 1. (Remember to justify all of your answers.) (a) What is the joint distribution of X and Y? (b) What is P{(x > 0.25) U (Y > 0.25)}? (c) What is the conditional distribution of X. given that Y - 3? (d) What is Var(Y - E[2X] + 3)? (e) What is...

  • [Probability] Let N be a geometric random variable with parameter p. Given N,generate N many i.i.d....

    [Probability] Let N be a geometric random variable with parameter p. Given N,generate N many i.i.d. random numbers U1, U2, . . . , UN uniformly from [0,1]. Let M= max 1≤i≤N Ui. Find the cdf of M, i.e., find P(M≤x).

  • 1 Expectation, Co-variance and Independence [25pts] Suppose X, Y and Z are three different random variables....

    1 Expectation, Co-variance and Independence [25pts] Suppose X, Y and Z are three different random variables. Let X obeys Bernouli Distribution. The probability disbribution function is 0.5 x=1 0.5 x=-1 Let Y obeys the standard Normal (Gaussian) distribution, which can be written as Y are independent. Meanwhile, let Z = XY. N(0,1). X and Y (a) What is the Expectation (mean value) of X? 3pts (b) Are Y and Z independent? (Just clarify, do not need to prove) [2pts c)...

  • All the steps/working of the answers need to be shown for all subquestions. Thank you! Problem...

    All the steps/working of the answers need to be shown for all subquestions. Thank you! Problem 5: Let X be a random variable with probability density function fx (r) = crm-l < z < 1} (1) Find the value of c (2) Find the cumulative probability distribution function of X (3) Assuming that U~U(0,1), transform this random variable to obtain a random variable with the same distribution as X.

  • 12. Let X and Y be independent random variables, where X has a uniform distribution on the interval (0,1/2), and Y...

    12. Let X and Y be independent random variables, where X has a uniform distribution on the interval (0,1/2), and Y has an exponential distribution with parameter A= 1. (Remember to justify all of your answers.) (a) What is the joint distribution of X and Y? (b) What is P{(X > 0.25) U (Y> 0.25)}? nd (c) What is the conditional distribution of X, given that Y =3? ur worl mple with oumbers vour nal to complet the ovaluato all...

  • Problem 5. (5 pts) Expectation Trick, Strong Law and the CLT (a) (2 pts) Let X...

    Problem 5. (5 pts) Expectation Trick, Strong Law and the CLT (a) (2 pts) Let X be the number of fixed points in a random permutation of n elements. We know that EX = 1. Compute EX? and EX3. Hint : Write X as a sum of indicator random variables. The number of fixed points in a random permutation is also known as the matching problem. (b) (1pt) For the same X as in part (a), give Markov and Chebyshev...

  • P7 continuous random variable X has the probability density function fx(x) = 2/9 if P.5 The...

    P7 continuous random variable X has the probability density function fx(x) = 2/9 if P.5 The absolutely continuous random 0<r<3 and 0 elsewhere). Let (1 - if 0<x< 1, g(x) = (- 1)3 if 1<x<3, elsewhere. Calculate the pdf of Y = 9(X). P. 6 The absolutely continuous random variables X and Y have the joint probability density function fx.ya, y) = 1/(x?y?) if x > 1,y > 1 (and 0 elsewhere). Calculate the joint pdf of U = XY...

  • Suppose X, Y and Z are three different random variables. Let X obey Bernoulli Distribution. The...

    Suppose X, Y and Z are three different random variables. Let X obey Bernoulli Distribution. The probability distribution function is p(x) = Let Y obeys the standard Normal (Gaussian) distribution, which can be written as Y ∼ N(0, 1). X and Y are independent. Meanwhile, let Z = XY . (a) What is the Expectation (mean value) of X? (b) Are Y and Z independent? (Just clarify, do not need to prove) (c) Show that Z is also a standard...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT