Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3.2 Evaluation of integral Back to our Example 1, we write a= E[X] = E[h(Y)], where X = h(Y) and Y ~ U(0,1). In other
3.2 Evaluation of integral Back to our Example 1, we write a= E[X] = E[h(Y)], where X = h(Y) and Y ~ U(0,1). In other words, although X-sampling is not directly available in python, one can use U(0,1) random generator (see numpy.random.uniform) to produce Y, then compute h(Y) for the sample Xi. DN is total number of samples Ds is the sum of samples Algorithm 1 Integral by MC - Example 1 1: procedure MCINTEGRAL(N) sto 3: for i = 1...N do 4: generate two numbers Y from U(0,1) sts+h(Y) 6: return D use numpy.random.uniform 5: Sastb D return the average Example 2 Implement Algo 1 for estimator n; Estimate MSEn) for N = 25 ..., 210 and plot log-log chart. 3.2 Evaluation of integral Back to our Example 1, we write a= E[X] = E[h(Y)], where X = h(Y) and Y ~ U(0,1). In other words, although X-sampling is not directly available in python, one can use U(0,1) random generator (see numpy.random.uniform) to produce Y, then compute h(Y) for the sample Xi. DN is total number of samples Ds is the sum of samples Algorithm 1 Integral by MC - Example 1 1: procedure MCINTEGRAL(N) sto 3: for i = 1...N do 4: generate two numbers Y from U(0,1) sts+h(Y) 6: return D use numpy.random.uniform 5: Sastb D return the average Example 2 Implement Algo 1 for estimator n; Estimate MSEn) for N = 25 ..., 210 and plot log-log chart
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started