Skip to contents

Refits y* = mu_hat + N(0, RSS / N) noise B times and forms type-7 percentile bands (ESL eq 8.6); uses the session RNG unless seed is given.

Usage

morie_esl_parametric_bootstrap(
  H,
  y,
  Hnew = NULL,
  B = 200,
  level = 0.95,
  seed = NULL
)

Arguments

H

Basis at the training inputs, N by p.

y

Response.

Hnew

Basis at evaluation points (default H).

B

Number of bootstrap draws.

level

Band level.

seed

Optional seed; the caller's RNG state is restored.

Value

Named list: fit, boot_se, lower, upper, B.

References

Hastie, Tibshirani & Friedman (2009), sec. 8.2.1.

Examples

x <- (1:30) / 10
morie_esl_parametric_bootstrap(cbind(1, x, x^2), sin(x), rbind(c(1, 1, 1)), B = 100,
  seed = 1)$boot_se
#> [1] 0.003742596