USING R Your first function should be called normprob(), and should calculate the exact value of P(aXb)=ba 1/2 exp[(x)^2/2^2]dx (normal distribution…

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

Calculate your essay price
(550 words)

Approximate price: $

Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)
Our guarantees

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.

Money-back guarantee

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

Zero-plagiarism guarantee

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

Free-revision policy

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

Privacy policy

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

Fair-cooperation guarantee

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