Skip to contents

Points and weights for Simpson's rule numerical integration from p 349 - 350 of Jennison and Turnbull book. This is not used for arbitrary integration, but for the canonical form of Jennison and Turnbull. mu is computed elsewhere as drift parameter times sqrt of information. Since this is a lower-level routine, no checking of input is done; calling routines should ensure that input is correct. Lower limit of integration can be -Inf and upper limit of integration can be Inf

Usage

gridpts(r = 18, mu = 0, a = -Inf, b = Inf)

Arguments

r

Integer, at least 2; default of 18 recommended by Jennison and Turnbull

mu

Mean of normal distribution (scalar) under consideration

a

lower limit of integration (scalar)

b

upper limit of integration (scalar > a)

Value

A list with grid points in z and numerical integration weights in w

Details

Jennison and Turnbull (p 350) claim accuracy of 10E-6 with r=16. The numerical integration grid spreads out at the tail to enable accurate tail probability calcuations.

Specification

The contents of this section are shown in PDF user manual only.

Examples


# approximate variance of standard normal (i.e., 1)
g <- gridpts()
sum((g$z)^2 * g$w * dnorm(g$z))
#> [1] 1.000001

# approximate probability above .95 quantile (i.e., .05)
g <- gridpts(a = qnorm(.95), b = Inf)
sum(g$w * dnorm(g$z))
#> [1] 0.05000011