Question

In: Statistics and Probability

Dr. Lee now wants to generate a random sample of size 10,000 from the F distribution...

Dr. Lee now wants to generate a random sample of size 10,000 from the F distribution with df1 = 1 and df2 = 4 degrees of freedom. But he doesn’t remember the probability density function (pdf) of the F distribution at all. Fortunately, he knows the relationship between t distribution and F distribution. He knows that if X follows the t distribution with ν = 4 degrees of freedom, then X2 follows the F distribution with df1 = 1 and df2 = 4 degrees of freedom. 1. First use the Metropolis algorithm to generate a random sample of size 10,000 from the t distribution with ν = 4 degrees of freedom and then use the generated sample together with Dr. Lee’s knowledge to obtain the random sample following F distribution (df1 = 1, df2 = 4). 1 2. To verify Dr. Lee’s knowledge, compute the sample percentiles and compare with the F distribution (df1 = 1, df2 = 4) percentiles. (Hint: Use qf(p, df1, df2) to find F distribution percentiles.)

Solutions

Expert Solution

Here it is given that X^2 follows F distribution with df1=1 and df2=n if X follows t distribution with df=n. So first we are generating samples from the t distribution using Metropolis-algorithm from t distribution with df=4. The following is the R code to generate these samples:

target = function(t){

    return((3/8)*((1+((t^2)/4))^(-5/2)));
}
x = rep(0,10000)
x[1] = 0     #this is just a starting value, which I've set arbitrarily to 0, the mean of t distribution
for(i in 2:10000){
currentx = x[i-1]
proposedx = currentx + rnorm(1,mean=0,sd=1)
A = target(proposedx)/target(currentx)
if(runif(1)<A){
    x[i] = proposedx       # accept move with probabily min(1,A)
} else {
    x[i] = currentx        # otherwise "reject" move, and stay where we are
}
}

#x; # the samples generated from the t distribution

xf <- x^2; #the samples generated for f distribution with df1=1, df2=4.

quantile(xf, 0.5) # sample 50th percentile

qf(0.5, 1, 4) # Percentile from f distribuiton

#Output

> #x; # the samples generated from the t distribution
>
> xf <- x^2; #the samples generated for f distribution with df1=1, df2=4.
>
> quantile(xf, 0.5) # sample 50th percentile
      50%
0.5638703
>
> qf(0.5, 1, 4) # Percentile from f distribuiton
[1] 0.5486322


Related Solutions

A random sample of size n from a distribution by f(x) = 2x and F(x) =...
A random sample of size n from a distribution by f(x) = 2x and F(x) = x^2 ; 0 < x < 1. Let R = X(n) − X(1) be the range of the sample. Give a general form of the density function of R
in R. Generate a random sample of size 700 from a gamma distribution with shape parameter...
in R. Generate a random sample of size 700 from a gamma distribution with shape parameter 8 and scale parameter 0.1. Create a histogram of the sample data. Draw the true parametric density (for the specified gamma distribution) on the histogram. The curve for the density should be red. (Note: The “true parametric density” is the distribution from which the sample values were generated. It is NOT the kernel density that is estimated from the data.)
Consider a random sample of size n from a distribution with function F (X) = 1-...
Consider a random sample of size n from a distribution with function F (X) = 1- x-2 if x > 1 and zero elsewhere. Determine if each of the following sequences has distribution limit; if so, give the limit distribution. a)x1:n b)xn:n c)n-1/2 xn:n
Dr. Lee wants to calculate the mean of a t distribution with ν = 4 degrees...
Dr. Lee wants to calculate the mean of a t distribution with ν = 4 degrees of freedom. However, he doesn’t remember the full probability density function (pdf) of the t distribution. Luckily, he remembers the pdf of the t distribution up to some constant. f(x) ∝ (1 + x2/ν)−(ν+1)/2, −∞ < x < ∞. 1. Use the rejection sampling to generate a random sample of size 10,000 from the t dis- tribution with ν = 4 degrees of freedom....
A random sample of size 9 from a distribution of ?(?, 36) yielded ?̅ = 40....
A random sample of size 9 from a distribution of ?(?, 36) yielded ?̅ = 40. Find the confidence intervals for ? a. 99% b. 97.5% c. 95% d. 90%
1. (a) Simulate a random sample of size 100 from the exponential distribution with the rate...
1. (a) Simulate a random sample of size 100 from the exponential distribution with the rate parameter λ = 10. Then make a histogram of the simulated data. (b) We use the simulated data as a data set to construct the log-likelihood function as an R function. We will find the MEL of the value λ = 10. Choose the appropriate range for the parameter λ, then make a plot of the log-likelihood function. (c) Use R function ‘optim‘ to...
Given a random sample of size of n = 4,900 from a binomial probability distribution with...
Given a random sample of size of n = 4,900 from a binomial probability distribution with P = 0.50​, complete parts​ (a) through​ (e) below. a. Find the probability that the number of successes is greater than 2,535. P(X>2535) = b. Find the probability that the number of successes is fewer than 2,410. P(X<2410) = c. Find the probability that the number of successes is between 2,440 and 2,520. P(2440 < X < 2520) = d. With probability .20​, the...
Let X1, X2, ..., Xn be a random sample of size from a distribution with probability...
Let X1, X2, ..., Xn be a random sample of size from a distribution with probability density function f(x) = λxλ−1 , 0 < x < 1, λ > 0 a) Get the method of moments estimator of λ. Calculate the estimate when x1 = 0.1, x2 = 0.2, x3 = 0.3. b) Get the maximum likelihood estimator of λ. Calculate the estimate when x1 = 0.1, x2 = 0.2, x3 = 0.3.
. Let X1, X2, ..., Xn be a random sample of size 75 from a distribution...
. Let X1, X2, ..., Xn be a random sample of size 75 from a distribution whose probability distribution function is given by f(x; θ) = ( 1 for 0 < x < 1, 0 otherwise. Use the central limit theorem to approximate P(0.45 < X < 0.55)
A random sample of size 30 from an exponential distribution with mean 5 is simulated. Show...
A random sample of size 30 from an exponential distribution with mean 5 is simulated. Show the R-code to plot the empirical cdf for this sample along with the true cdf in the sample graph.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT