View source: R/GeoVarestbootstrap.R
| GeoVarestbootstrap | R Documentation |
GeoFit object using parametric bootstrap for std error estimation.The procedure updates a GeoFit object using a
classical parametric bootstrap. The fitted model is simulated and refitted
for each bootstrap replication; the empirical covariance matrix of the
successful parameter estimates is used as the bootstrap covariance estimate.
A faster score-bootstrap alternative is GeoVarest. Full/Standard
likelihood fits are not accepted; obtain their Hessian-based standard errors
directly with GeoFit(..., varest = TRUE).
GeoVarestbootstrap(
fit, K = 100, sparse = FALSE,
optimizer = NULL, lower = NULL, upper = NULL,
method = "cholesky", alpha = 0.95, L = 10000,
parallel = FALSE, ncores = 6, progress = TRUE,
seed = NULL, min_success_rate = 0.8
)
fit |
A fitted object obtained from the
|
K |
The number of simulations in the parametric bootstrap. |
sparse |
Logical; if |
optimizer |
The type of optimization algorithm (see |
lower |
An optional named list giving the values for the lower bound of the space parameter
when the optimizer is |
upper |
An optional named list giving the values for the upper bound of the space parameter
when the optimizer is |
method |
String; The method of simulation. Default is |
alpha |
Numeric; The level of the confidence interval. |
L |
Numeric; the number of lines in the turning band method. |
parallel |
Logical; default |
ncores |
Positive integer or |
progress |
Logic; If TRUE then a progress bar is shown. |
seed |
Optional integer seed for reproducibility of the simulated samples. |
min_success_rate |
Minimum fraction of successful bootstrap refits required to return variance estimates. The default is 0.8. |
For spatio-temporal fits, the original numeric coordt values stored in fit are reused. Irregularly spaced times are supported with method = "cholesky"; approximate simulation methods retain the restrictions documented in GeoSimapprox.
The function updates a GeoFit object by refitting each simulated
data set. A sensitivity matrix is not required to estimate bootstrap standard
errors and confidence intervals. If fit$sensmat is available, CLIC and
CLBIC penalties are also computed. For stochastic nearest-neighbor fits, the
realized retained-pair graph from the original fit is reused unchanged across
all bootstrap refits.
Parallel multisession workers are started with the package-library paths of the calling R session, including the library containing the loaded GeoModels installation.
For method = "TB" without a copula, parallel workers are persistent and replications are streamed one at a time (simulate, evaluate, release). This keeps peak memory bounded when both L and K are large while still reusing the selected pair graph and static fitting context within each worker. For fitted copula models, method="TB" is simulated through the turning-bands backend of GeoSimCopula; the copula path is currently not streamed replicate-by-replicate. On platforms where future reports forked multicore execution as safe, GeoModels uses it automatically to reduce worker startup and serialization overhead; otherwise it falls back to multisession with the current GeoModels library path propagated explicitly.
Returns an updated object of class GeoFit. The main updated components
include stderr, varcov, godambe when invertible,
conf.int, pvalues, and estimates. When a compatible
sensmat is available, claic/clic, clbic,
and clic_penalty are also updated.
For a purely spatial univariate fit with explicit irregular three-dimensional
Euclidean coordinates, method = "TB" is supported when no
anisopars were used. Method "CE" remains restricted to
regular two-dimensional grids. Use method = "cholesky" for
bivariate, spatio-temporal, anisotropic, or other unsupported
three-dimensional cases.
Moreno Bevilacqua, moreno.bevilacqua89@gmail.com,https://sites.google.com/view/moreno-bevilacqua/home, Víctor Morales Oñate, victor.morales@uv.cl, https://sites.google.com/site/moralesonatevictor/, Christian Caamaño-Carrillo, chcaaman@ubiobio.cl,https://www.researchgate.net/profile/Christian-Caamano
GeoFit for the fitted objects used as input
library(GeoModels)
################################################################
###
### Example 1. Test on the parameter
### of a regression model using conditional composite likelihood
###
###############################################################
set.seed(342)
model="Gaussian"
# Define the spatial-coordinates of the points:
NN=3500
x = runif(NN, 0, 1)
y = runif(NN, 0, 1)
coords = cbind(x,y)
# Parameters
mean=1; mean1=-1.25; # regression parameters
sill=1 # variance
# matrix covariates
X=cbind(rep(1,nrow(coords)),runif(nrow(coords)))
# model correlation
corrmodel="Matern"
smooth=0.5;scale=0.1; nugget=0;
# simulation
param=list(smooth=smooth,mean=mean,mean1=mean1,
sill=sill,scale=scale,nugget=nugget)
data = GeoSim(coordx=coords, corrmodel=corrmodel,
model=model, param=param,X=X)$data
I=Inf
fixed=list(nugget=nugget,smooth=smooth)
start=list(mean=mean,mean1=mean1,scale=scale,sill=sill)
lower=list(mean=-I,mean1=-I,scale=0,sill=0)
upper=list(mean=I,mean1=I,scale=I,sill=I)
# Maximum pairwise composite-likelihood fitting of the RF:
fit = GeoFit(data=data,coordx=coords,corrmodel=corrmodel, model=model,
likelihood="Conditional",type="Pairwise",sensitivity=TRUE,
lower=lower,upper=upper,neighb=3,
optimizer="nlminb",X=X,
start=start,fixed=fixed)
unlist(fit$param)
#fit_update=GeoVarestbootstrap(fit,K=100,parallel=TRUE)
#fit_update$stderr
#fit_update$conf.int
#fit_update$pvalues
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.