Question

R2. Let X ~ N(μ 10.82). Following up on R1, we will be approximating μ2, which we can see should be 100, For now, let the sample size be n = 3, Pick 3 random numbers from X, compute X., and repeat the process a total of 50000 times. Plot a smooth version of the histogram of these 50000 values for X: the plot(density(.. command in R wll be useful. Now find the average of your 50000 values and make a vertical dotted line in R at this number (match the color of your curve). You have just made a rough picture of the density function for (when n 3) and identified its (approximate) expected value Now you should repeat this process for n 6, 10 andn 50. Plot all four of these curves (use different colors) and vertical lines solid vertical line at 100. You should be able to see the asymptotic unbiasedness in the picture. Your answer is your code and a rough sketch of the plot you have created

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The following is the R code (all statements starting with # are comments)

#set the mean mu<-10 # 3et the 3tandard deviation sigma<-8 #set the random seed set.seed (123) #make an empty plot to add the curves later plot (1, type=n, x1ab=bquote (bar (X)^2), yłab= Density, x1im=c (0, 800) , ylim=c (0,0.02), main=bquote (The distribution of bar (X)^2)) #set the colors for the plot cols<-c(red, blue, green, magenta) #set the sample 31ze3 n<-c (3,6,10,50) #do this for each sample size n for (i in l:length (n)) f #set the number of samples to be taken r<-50000 #draw a sample of 31ze n, r times, that 13 n*r draw3 x<-rnorm (n[1] *r,mu, зіста) #make this into a matrix of n rows and r columns x<-matrix (x, nrow=n [1] , ncol=-) #get r 3ample means xbar<-apply (x, 2,mean) #get the square of means xbar2<-xbar 2 #draw the density of xbar2 lines (density (xbar2) , typ=l, col-cols [1] ) #add the vertical line abline (v=me an (xbar2 ) , co1=cols [1] , lty=2) from normal (10,8^2) #add a 3011d line for mu^2 abline ( v=mu 2 , lwd=2 ) #add the legend legend ( topright, paste (n=, n, sep=) , col=cols, lty=1)get this plot

The distribution of X n-3 n-6 n=10 n=50 400 600 800 200 x2

We can see that as the sample size increases, the dotted vertical line moves closer to the solid line corresponding to バ= 100, showing the asymptotic unbiasedness

We can also observe that the variance of the sampling distribution reduces with the increase in sample size.

Finally we can also see that the density takes on a bell shape as the sample size increases, indicating the asymptotic normality.

The code in text format is below

------------------------------------

#set the mean
mu<-10
# set the standard deviation
sigma<-8
#set the random seed
set.seed(123)
#make an empty plot to add the curves later
plot(1, type="n", xlab=bquote(bar(X)^2), ylab="Density", xlim=c(0, 800),ylim=c(0,0.02),
   main=bquote("The distribution of "*bar(X)^2))
#set the colors for the plot
cols<-c("red","blue","green","magenta")
#set the sample sizes
n<-c(3,6,10,50)
#do this for each sample size n
for (i in 1:length(n)){
   #set the number of samples to be taken
   r<-50000
   #draw a sample of size n, r times, that is n*r draws from normal(10,8^2)
   x<-rnorm(n[i]*r,mu,sigma)
   #make this into a matrix of n rows and r columns
   x<-matrix(x,nrow=n[i],ncol=r)
   #get r sample means
   xbar<-apply(x,2,mean)
   #get the square of means
   xbar2<-xbar^2
   #draw the density of xbar2
   lines(density(xbar2),typ="l",col=cols[i])
   #add the vertical line
   abline(v=mean(xbar2),col=cols[i],lty=2)
}
#add a solid line for mu^2
abline(v=mu^2,lwd=2)
#add the legend
legend("topright",paste("n=",n,sep=""),col=cols,lty=1)

Add a comment
Know the answer?
Add Answer to:
R2. Let X ~ N(μ 10.82). Following up on R1, we will be approximating μ2, which...
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
  • R2 Let X ~ N(μ = 10.82). Following up on RI, we will be approximating μ2,...

    R2 Let X ~ N(μ = 10.82). Following up on RI, we will be approximating μ2, which we can see should be 100. For now, let the sample size be n 3, Pick 3 random numbers from X, compute 72 X, and repeat the process a total of 50000 times. Plot a smooth version of the histogram of these 50000 values for X2: the plot(density(...). command in R will be useful. Now find the average of your 50000 values and...

  • R2 IS THE QUESTION,THANKS! R2. Let X ~ N(μ = 10.82). Following upon we be approximating...

    R2 IS THE QUESTION,THANKS! R2. Let X ~ N(μ = 10.82). Following upon we be approximating μwe can see should be 100. For now, let the sample size be n = 3, Pick 3 random numbers from X, compute X', and repeat the process a total of 50000 times. Plot a smooth version of the histogram of these 50000 values for X: the plot(density(...)) command in R will be useful. Now find the average of your 50000 values and make...

  • R1. Suppose X is a continuous RV with E(X-μ and Var(X-σ2 where both μ and σ...

    R1. Suppose X is a continuous RV with E(X-μ and Var(X-σ2 where both μ and σ are unknown. Note that X may not be a normal distribution. Show that X is an asymptotically unbiased estimator for μ2. (This problem does not require the computer.) R2. Let X ~ N(μ 10.82). Following up on R1, we will be approximating μ2, which we can see should be 100, For now, let the sample size be n 3. Pick 3 random numbers from...

  • RI. Suppose X is a continuous RV with E(X)-μ and Var(X)-σ2 where both μ and σ...

    RI. Suppose X is a continuous RV with E(X)-μ and Var(X)-σ2 where both μ and σ are unknown. Note that X may not be a normal distribution. Show that X is an asymptotically unbiased estimator for μ. (This problem does not require the computer.) R2. Let X ~ ŅĢi-10.82). Following up on RI, we will be approximating μ2, which we can see should be 100. For now, let the sample size be n = 3, Pick 3 random numbers from...

  • We start out with a couple of defintions and examples. Definition: Let X and Y have...

    We start out with a couple of defintions and examples. Definition: Let X and Y have joint pdf f(x,y). The conditional pdf of Y given X = x (resp. of X given Y = y) is defined by h(y|x) = f (x, y) resp. g(x|y) = f (x, y) f1(x) f2(y) If A is a subset of the real line, then P(Y ∈A|X =x)= h(y|x)dy resp. P(X ∈A|Y =y)= g(x|y)dx . AA Example 1 (seen in class) Consider the joint...

  • A polynomial p(x) is an expression in variable x which is in the form axn + bxn-1 + …. + jx + k, where a, b, …, j, k are...

    A polynomial p(x) is an expression in variable x which is in the form axn + bxn-1 + …. + jx + k, where a, b, …, j, k are real numbers, and n is a non-negative integer. n is called the degree of polynomial. Every term in a polynomial consists of a coefficient and an exponent. For example, for the first term axn, a is the coefficient and n is the exponent. This assignment is about representing and computing...

  • Experimental technique 5. [1pt] Which of the following statements are true for this experiment? E.g., enter...

    Experimental technique 5. [1pt] Which of the following statements are true for this experiment? E.g., enter AB. If none are true, enter N. You have 4 tries. Everyone must wear safety glasses. For each launch angle, the projectile range is measured for one speed setting. Never look into the barrel of the launcher when it is loaded. The launch angle θ measured using the plumb line is the angle of the launcher with respect to the vertical. The projectile is...

  • Need help with stats true or false questions Decide (with short explanations) whether the following statements are true or false a) We consider the model y-Ao +A(z) +E. Let (-0.01, 1.5) be a 95% con...

    Need help with stats true or false questions Decide (with short explanations) whether the following statements are true or false a) We consider the model y-Ao +A(z) +E. Let (-0.01, 1.5) be a 95% confidence interval for A In this case, a t-test with significance level 1% rejects the null hypothesis Ho : A-0 against a two sided alternative. b) Complicated models with a lot of parameters are better for prediction then simple models with just a few parameters c)...

  • 1. For each of the following regression models, write down the X matrix and 3 vector....

    1. For each of the following regression models, write down the X matrix and 3 vector. Assume in both cases that there are four observations (a) Y BoB1X1 + B2X1X2 (b) log Y Bo B1XiB2X2+ 2. For each of the following regression models, write down the X matrix and vector. Assume in both cases that there are five observations. (a) YB1XB2X2+BXE (b) VYBoB, X,a +2 log10 X2+E regression model never reduces R2, why 3. If adding predictor variables to a...

  • Partner: Date Name 11 Snell's Law Introduction When light passes from one material to another it ...

    Partner: Date Name 11 Snell's Law Introduction When light passes from one material to another it is always bent away from its original path. This process is known as refraction and the change in direction depends on the change in optical density (or refractive index) of the two materials. A larger change in refractive index results in a larger change in angle between incoming and outgoing light beams. A light beam bends closer to the normal in the material with...

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
ADVERTISEMENT