1. [20 ptecte last problem of your n-class exam If Yt is positively corelated, t
ID: 3055906 • Letter: 1
Question
1. [20 ptecte last problem of your n-class exam If Yt is positively corelated, the probability of making the type 1error would be You want to test H0 : = 0 vs Ha : 0 at the significance level a. Here. indicates the mean of a stationary time series { . Consider test statistic the significance level a ) greater than ii) smaller than ii ekse to where Yn is the sample mean and s is the sample standard deviation. You are planning to use t(n -1 as the null distribution. That is, you would reject Ho if I> ta/(n1), What was your answer to this question? (a) Design a siulstion progra in R to double check your snswer. Hint: If you are not ure what to do, follow these stepa. 1. Choose your own significanoe level a 2. Choose any process Yt i that is stationary, positively corTelated, and have mean 3. Choose a large enough sample size (say,n-500) and a large enough number of Monte Carlo simlation (say, M- 10000). 1. In R, generate one sequence of Y, t-1... .Ti. 5. Conduct the t-test using this sequece. In R, you can use t.test function. Record if you rejected Ho. 6. Repeat the above two steps (stes 4 a 5) M times. 7. Compute the proportion (out of M replications) of rejection. Since you have eedY under Ho (recall that you doso Y to be mean zero), these are falso rojections. That is, this proportion you are caleulating in this step is (roughly) the probability of type 1 error (b) Wat can you say about the probability of type 1 errors, if Yi is (i) white noise or where ta indicates ath upper quantile of t1 dlstribution. Suppose the sample size n is large enough. Recall that the type 1 error happens when you falsely reject Ho. Fill in the blank in the following sentence: (ii) nogatively correlated Your answer should be based on to additional siula tions (simply change your Y process in step 2 sbove) as well as some theoretical justificationsfintuitions.Explanation / Answer
If Yt is positively correlated, the probability of making the type 1 error would be greater than the significance level.
n=500 # sample size
mu=0 # true value of a parameter
sig=5 # true value of a parameter
Sim=5000 # Set the number of simulations
reject=0
for(i in 1:Sim){ # simulation loop
y=rnorm(n, mu, sig) # generate normal random number
sig_y=sqrt(var(y)/n) # compute standard error
mu_y=sum(y)/n # compute estimator
tobs=(mu_y-mu)/sig_y # compute test statistic
if(abs(tobs)>qt(0.95,n-1)){ # rejection criterion
reject=1+reject
}
}
al=reject/Sim
al
0.094
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.