Question

In: Statistics and Probability

from monte carlo methods, use importance sampling to estimate P(X > 3) where e^(-sqrt(x)) [sin(x)]^2 and...

from monte carlo methods, use importance sampling to estimate P(X > 3)

where e^(-sqrt(x)) [sin(x)]^2 and x > 0

Solutions

Expert Solution

>
> set.seed(0)
>
> ## proposal density as exponential function is given hence exponential
>
> x = rexp(1000)
> head(x)
[1] 0.1840366 0.1457067 0.1397953 0.4360686 2.8949685 1.2295621
>
> ## Target density that is the given density funcition
>
> f = function(x) exp(-sqrt(x))*sin(x)*sin(x)
>
> targ_den = f(x)
> head(targ_den)
[1] 0.02180668 0.01439152 0.01335902 0.09217575 0.01087209 0.29298628
>
> ## importance weights of the sample
>
> w = f(x) / dexp(x)
> head(w)
[1] 0.02621293 0.01664893 0.01536339 0.14256039 0.19659928 1.00193441
>
> target_Sampl = w * x
> head(target_Sampl)
[1] 0.004824139 0.002425861 0.002147729 0.062166114 0.569148740 1.231940533
>
> event_X = length(which(target_Sampl >3))
>
> PX = event_X/length(target_Sampl)
> PX
[1] 0.03

>

Hence, P(X>3) = 0.03


Related Solutions

Use logarithmic differentiation to find the derivative of the function: y= sqrt(x)e^(x^3) (x^4 +1)^9 sin x
Use logarithmic differentiation to find the derivative of the function: y= sqrt(x)e^(x^3) (x^4 +1)^9 sin x
integrate from infinity to 1: (1+(sin^2(x))/sqrt (x)) dx
integrate from infinity to 1: (1+(sin^2(x))/sqrt (x)) dx
Running a Monte Carlo simulation to calculate the probability that the daily return from S&P will...
Running a Monte Carlo simulation to calculate the probability that the daily return from S&P will be > 5%. We will assume that the historical S&P daily return follows a normal distribution with an average daily return of 0.03 (%) and a standard deviation of 0.97 (%). To begin we will generate 100 random samples from the normal distribution. For the generated samples we will calculate the mean, standard deviation, and probability of occurrence where the simulation result is greater...
1. Compare paramatric, historical, and monte carlo simulation methods in identifying VaR (value at risk) 2....
1. Compare paramatric, historical, and monte carlo simulation methods in identifying VaR (value at risk) 2. What are the pros and cons of those? 3. Identify some weights on historical losses that you think should make more sense in current trading war environment.
Estimate the area under the graph of f(x) =5 sqrt x. from x=0 to x=4 using...
Estimate the area under the graph of f(x) =5 sqrt x. from x=0 to x=4 using four approximating rectangles and right endpoints. sketch the graph and rectangles. is your estimate an underestimate or overestimate? Repeat using left endpoints
f(x)=e^x/(3+e^x) Find the first derivative of f. Use interval notation to indicate where f(x) is increasing....
f(x)=e^x/(3+e^x) Find the first derivative of f. Use interval notation to indicate where f(x) is increasing. List the x coordinates of all local minima of f. If there are no local maxima, enter 'NONE'. List the x coordinates of all local maxima of f. If there are no local maxima, enter 'NONE'. Find the second derivative of f: Use interval notation to indicate the interval(s) of upward concavity of f(x). Use interval notation to indicate the interval(s) of downward concavity...
Let f ( x , y ) = x^ 2 + y ^3 + sin ⁡...
Let f ( x , y ) = x^ 2 + y ^3 + sin ⁡ ( x ^2 + y ^3 ). Determine the line integral of f ( x , y ) with respect to arc length over the unit circle centered at the origin (0, 0).
Show that the set of all real numbers of the form a+b sqrt(2)+c sqrt(3)+d sqrt(6),where a,b,c,d...
Show that the set of all real numbers of the form a+b sqrt(2)+c sqrt(3)+d sqrt(6),where a,b,c,d ∈Q, forms a subfield of R
let Q(sqrt(2),sqrt(3)) be the field generated by elements of the form a+bsqrt(2)+csqrt(3)+dsqrt(6) where a,b,c,d are in...
let Q(sqrt(2),sqrt(3)) be the field generated by elements of the form a+bsqrt(2)+csqrt(3)+dsqrt(6) where a,b,c,d are in Q(sqrt(2),sqrt(3)) is a vector space of dimension 4 over A. find a basis for Q(sqrt(2),sqrt(3))
Find dy/dx by implicit differentiation. 11. ycosx=x^2+y^2 13. sqrt(x+y)=x^4+y^4 15. tan(x/y)=x+y 17. sqrt(xy)=1+(x^2)*(y) 19. sin(xy) =...
Find dy/dx by implicit differentiation. 11. ycosx=x^2+y^2 13. sqrt(x+y)=x^4+y^4 15. tan(x/y)=x+y 17. sqrt(xy)=1+(x^2)*(y) 19. sin(xy) = cos(x+y)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT