Question

Tail Moments of the Standard Normal Distribution. Your goal is to estimate the following conditional moment of the standard normal distribution: Z~N(0,1) (a) Write an R function that takes inputs n (sample size) and a > 0 and estimates θα using an accept/reject approach. For this part, draw proposals from a standard normal.

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


R-Code

#Defining the function

tail_moments=function(n,alpha)
{

z=rnorm(n)                             #Taking random sample from N(0,1)      
pos=which(z>alpha)              #Finding the position of varaibles having value > alpha
z_alpha=z[pos]                       #Selecting the numbers
theta_alpha=mean(z_alpha) #Finding the conditional mean
return(theta_alpha)                 #Returning the value
}

t=tail_moments(10000,0)        #Calling the function tail_moments

Add a comment
Know the answer?
Add Answer to:
Tail Moments of the Standard Normal Distribution. Your goal is to estimate the following conditional moment...
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
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