Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You must use R to solve. Please do not comment asking for other ways to solve, m

ID: 3847439 • Letter: Y

Question


You must use R to solve. Please do not comment asking for other ways to solve, must be using R. And disregard the how at the end of the question 2. (10 points) white a program to estimate the integral e-z dar, but instead of uniform random variables on 0,0.75], use importance sampling with exponential random variables on [0,0.75), i e., a random variable with a probability density function 1- e 0.75 0 S z S 0.75. The random variables with the above distribution should be obtained by pseudo-random numbers using the inverse cumulative distribution transformation. Use a sample size of 1000. What is your estimate of the integral and 99% confidence interval for your estimate? How

Explanation / Answer

#declaring function prototype
IntegralPrototype <- function(x){
exp(-x*x)
return(IntegralPrototype)
}
estimateMyIntegral <- function (x) {
integrate(IntegralPrototype(x), lower=0, upper=0.75)$value
}

#---------------------------------------------------------------------------------------------
#call the function to calculate integral
estimateMyIntegral(1)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote