This question aims to make concrete the moment generating function via simulatio
ID: 3332920 • Letter: T
Question
This question aims to make concrete the moment generating function via simulation in R: (Note: this is a computational exercise; almost no theo- retical work is required) (a) Simulate 1000 values from X ~ N(3,1) distribution, that is, the Normal Distribution with mean 3, variance 1 b) Let Veoo1X. Using your simulations from (a), obtain 1000 simu- lations from V. Using your simulations find approximately E(V) Hint: Both of these steps are very easy in R (c) Let W = e-0.01x. Using your simulations from (a), obtain 1000 simulations from W. Using your simulations find approximately E(W) = E(e-0.01x) Is this what you expect? Explain. (d) Using your answers to (b) and (c), find aE(e x)It=0 approximately. Hint 2 for small .Explanation / Answer
See the R-code below:
set.seed(1001)
n <- 1000
########## (a)
X <- rnorm(n,3,1)
########## (b)
V <- exp(0.01*X)
mean(V)
########## (c)
W <- exp(-0.01*X)
mean(W)
########## (d)
dE = function(d,n=1000)
{
x <- rnorm(n,3,1)
v <- exp(d*x)
w <- exp(-d*x)
return((mean(v)-mean(w))/(2*d))
}
d <- 0.00001
dE(d)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.