as well as its approximation using Simpson’s rule. For the exact value, you should use the pnorm() command in R. The arguments to this function should be: mu, the mean of the distribution (i.e. μ in the formulae above); sigmasq, the variance (i.e. σ 2 in the formulae); a and b, the integration limits a and b; and n, the value of n to use in Simpson’s rule. The default value of n should be 100. Your function should return a list containing components p.approx, the Simpson approximation to the probability; p.exact, the value obtained using pnorm(); n, the value of n; and p.error, the difference p.approx-p.exact. You may use the dnorm()command to calculate the normal probability density function if you wish.
Your second function should be called SimpsonTest(). Its purpose is to evaluate the error of the Simpson approximation to P(a < X ≤ b) for different values of n, and to estimate the value of α as described in the introduction above. The arguments to this second function should be: mu, sigmasq, a, b, and n.grid. These all have the same interpretation as the corresponding arguments to normprob(), except for n.grid which should be a vector of values for n. Your SimpsonTest()function should use normprob()to obtain a vector of approximation errors for each value of n in n.grid. It should then use lm() to regress the log of the absolute approximation error against the log of n.grid, and take the estimated slope of the regression as an estimate of -α. The function should return a list containing components n.grid (the value of n.grid), p.error (a vector containing the absolute values of the approximation errors) and alpha (the estimate of α).
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.Read more
Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.Read more
Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.Read more
Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.Read more
By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.Read more