rex(x, r = 2, k = 1, recursive = FALSE)
recursive=FALSE
, the default)
or repeat the extrapolation procedure until a best estimate
is obtained (recursive=TRUE
.
x
are assumed to
have been obtained using approximations with step sizes
$a, a/r, a/r^2, ...$
where $a$ is the initial step size (which does not need to be
specified).Estimates based on a step size $s$ are assumed to have an error of order $s^k$.
Thus, the default values r=2
and k=1 imply that the errors in
the second column of x
should be roughly $(1/r)^k = 1/2$ as large
as the errors in the first column, and so on.
Brezinski, C. and Zaglia, M.R. (1991) Extrapolation Methods. Theory and Practice. North-Holland.
bc
# integrals of sin(x) and cos(x) from 0 to pi
# correct answers: 2, 0
est <- function(nsteps) {
xx <- seq(0, pi, length=nsteps)
ans <- pi * c(mean(sin(xx)), mean(cos(xx)))
names(ans) <- c("sin", "cos")
ans
}
X <- cbind(est(10), est(20), est(40))
X
rex(X)
rex(X, recursive=TRUE)
# fitted Gibbs point process model
fit0 <- ppm(cells ~ 1, Strauss(0.07), nd=16)
fit1 <- update(fit0, nd=32)
fit2 <- update(fit0, nd=64)
co <- cbind(coef(fit0), coef(fit1), coef(fit2))
co
rex(co, k=2, recursive=TRUE)
Run the code above in your browser using DataLab