Question

In: Statistics and Probability

Suppose that the distribution of wind velocity, X, is described by the probability density function f(x)...

Suppose that the distribution of wind velocity, X, is described by the probability density function f(x) = (x/σ^2)e^-(x^2/ 2(σ^2)) , x ≥ 0. Suppose that for the distribution of wind velocity in Newcastle, measured in km/hr, σ^2 = 100.

(a) In task 1, you showed that the quantile function for this distribution is given by: Q(p) = σ (−2 ln(1 − p))^(1/2), 0 ≤ p < 1 Use this quantile function to generate 100,000 random values from this distribution (when σ 2 = 100) in R using the probability integral transformation, as follows:

• Generate 100,000 random values Y from a Uniform distribution from 0 to 1

• Generate 100,000 random values from X using its quantile function: X = Q(Y ).

(b) In task 1, you showed that the median of X is 11.77 km/hr. Verify this by finding the median of the 100,000 random numbers generated from X in part (a).

(c) In task 1, you showed that the expected value of X is σ (π 2) . When σ^2 = 100, E(X) = 12.53 km/hr. Verify this by finding the mean of the 100,000 random numbers generated from X in part (a). To earn full marks, provide all R commands used to calculate the mean and evidence of your numerical estimate (screenshot or RMarkdown).

(d) Consider the transformation W = (X^2)/ (2(σ^2)) Show that W is a monotonically increasing function of X.

(e) Use either the change-of-variable method or the distribution function method to show that W follows an exponential distribution with λ = 1.

(f) Use R to generate 100,000 values of W by applying the transformation from part (d) to the 100,000 values of X generated in part (a). To earn full marks, provide all R commands used (screenshot or RMarkdown).

(g) As W follows an exponential distribution with λ = 1, both the expected value and variance of W are equal to 1. Verify this by deriving the mean and variance of the 100,000 values generated from W. To earn full marks, provide all R commands used to calculate the mean and variance and evidence of your numerical estimates (screenshot or RMarkdown).

Solutions

Expert Solution

The pdf of wind velocity, X is given by

In task1 I think you have already shown that the cdf of X is

Using this we have the quantile function as

We will use R to do the following steps

  • Generate 100,000 random values Y from a Uniform distribution from 0 to 1
  • Generate 100,000 random values from X using its quantile function: X = Q(Y ).

R-Code

#set the seed
set.seed(123)

#set the value of sigma
sigma<-sqrt(100)
#Generate 100,000 random values Y from a Uniform distribution from 0 to 1
n<-100000
Y<-runif(n,0,1)
#Generate 100,000 random values from X using its quantile function: X = Q(Y ).
X<-sigma*sqrt(-2*log(1-Y))
#print some values of X
head(X)

#--output is

b) R code for median of X

#b)median of X
Xmedian<-median(X)
print(paste("Median of X is",round(Xmedian,2)))

#--output is

Sample median is close to the theoretical value of 11.77

c) Expected value of X

#c) Expected value of X
Xmean<-mean(X)
print(paste("Sample mean of X is",round(Xmean,2)))

#--output is

Sample mean of 12.52 is close to the expected value of 12.53

d) The transformation is

A function is monotonically increasing if its first derivative is positive over the domain of the function

The first derivative of W is

We know that the . That means the first derivative is also positive for the entire range of X.

Hence W is a monotonically increasing function of X

e) First we will state the general theorem of transformation

If X has a pdf   and the transformation W=g(x) is monotonically increasing

the pdf of W is

Here

and

the pdf of W is

This is an exponential distribution with

f) Use R to generate 100,000 values of W

R code

#f) Use R to generate 100,000 values of W
W<-X^2/(2*sigma^2)
#print some values of W
head(W)

#--output is below

g) R code

#g) mean and variance of the 100,000 values generated from W
Wmean<-mean(W)
print(paste("Sample mean of W is",round(Wmean,2)))
Wvar<-var(W)
print(paste("Sample variance of W is",round(Wvar,2)))

#--output is

Mean and variance are equal to 1, as expected


Related Solutions

Let the continuous random variable X have probability density function f(x) and cumulative distribution function F(x)....
Let the continuous random variable X have probability density function f(x) and cumulative distribution function F(x). Explain the following issues using diagram (Graphs) a) Relationship between f(x) and F(x) for a continuous variable, b) explaining how a uniform random variable can be used to simulate X via the cumulative distribution function of X, or c) explaining the effect of transformation on a discrete and/or continuous random variable
Suppose that the joint probability density function of ˜ (X, Y) is given by:´ f X,Y...
Suppose that the joint probability density function of ˜ (X, Y) is given by:´ f X,Y (x,y) = 4x/y3 I(0.1)(x), I (1, ∞)(y). Calculate a) P(1/2 < X < 3/4, 0 < Y ≤ 1/3). b) P(Y > 5). c) P(Y > X).
A continuous probability density function (PDF) f ( X ) describes the distribution of continuous random...
A continuous probability density function (PDF) f ( X ) describes the distribution of continuous random variable X . Explain in words, and words only, this property: P ( x a < X < x b ) = P ( x a ≤ X ≤ x b )
Suppose that X and Y have the following joint probability density function. f (x, y) =...
Suppose that X and Y have the following joint probability density function. f (x, y) = (3/394)*y, 0 < x < 8, y > 0, x − 3 < y < x + 3 (a)   Find E(XY). (b)   Find the covariance between X and Y.
Give an example of a function F which is the joint probability distribution (not density) function...
Give an example of a function F which is the joint probability distribution (not density) function of a pair of random variables X and Y such that (a) X and Y are independent and discrete (b) X and Y are dependent and discrete (c) X and Y are independent and continuous (d) X and Y are dependent and continuous
Exercise 4 (MATH 4200). Suppose that Xk has a probability density function f(x) so that f(x)...
Exercise 4 (MATH 4200). Suppose that Xk has a probability density function f(x) so that f(x) > 0 for all x. Prove that G(c) = E[Xk Xk ≥ c]P(Xk ≥ c) + µk+1P(Xk ≤ c) is maximal is maximal for c = µk+1. (This means the optimal strategy is to take γk = µk+1.)
Suppose X follows a Gamma distribution with parameters α, β, and the following density function f(x)=...
Suppose X follows a Gamma distribution with parameters α, β, and the following density function f(x)= [x^(α−1)e^(−x/ β)]/ Γ(α)β^α . Find α and β so that E(X)= Var(X)=1. Also find the median for the random variable, X.
Consider a continuous random variable X with the probability density function f X ( x )...
Consider a continuous random variable X with the probability density function f X ( x ) = x/C , 3 ≤ x ≤ 7, zero elsewhere. Consider Y = g( X ) = 100/(x^2+1). Use cdf approach to find the cdf of Y, FY(y). Hint: F Y ( y ) = P( Y <y ) = P( g( X ) <y ) =
A probability density function on R is a function f :R -> R satisfying (i) f(x)≥0...
A probability density function on R is a function f :R -> R satisfying (i) f(x)≥0 or all x e R and (ii) \int_(-\infty )^(\infty ) f(x)dx = 1. For which value(s) of k e R is the function f(x)= e^(-x^(2))\root(3)(k^(5)) a probability density function? Explain.
Let be the following probability density function f (x) = (1/3)[ e ^ {- x /...
Let be the following probability density function f (x) = (1/3)[ e ^ {- x / 3}] for 0 <x <1 and f (x) = 0 in any other case a) Determine the cumulative probability distribution F (X) b) Determine the probability for P (0 <X <0.5)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT