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 tibble 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

library(dplyr)
#> 
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#> 
#>     filter, lag
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, setdiff, setequal, union

# approximate variance of standard normal (i.e., 1)
gsdmvn:::gridpts_() %>% summarise(var = sum(z^2 * w * dnorm(z)))
#> # A tibble: 1 × 1
#>     var
#>   <dbl>
#> 1  1.00

# approximate probability above .95 quantile (i.e., .05)
gsdmvn:::gridpts_(a = qnorm(.95), b = Inf) %>% summarise(p05 = sum(w * dnorm(z)))
#> # A tibble: 1 × 1
#>      p05
#>    <dbl>
#> 1 0.0500