Select Page

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 α).

#### Why Choose Us

• 100% non-plagiarized Papers
• Affordable Prices
• Any Paper, Urgency, and Subject
• Will complete your papers in 6 hours
• On-time Delivery
• Money-back and Privacy guarantees
• Unlimited Amendments upon request
• Satisfaction guarantee

#### How it Works

• Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
• Fill in your paper’s requirements in the "PAPER DETAILS" section.