Description Usage Arguments Value Methods (by generic) See Also Examples
View source: R/TwoStepBootstrap.R
This function implements the esmation and inference for two-step estimators including Krig-and-regress(OLS), Krig-and-regress(GLS), two-step bootstrap.
1 2 3 4 5 6 7 | TwoStepBootstrap(DatR, VarR, DatY, VarY, variogram.model,
is.cov.misspecified, is.den.misspecified,
plot.start.value = TRUE, cutoff.R, cutoff.res,
start.value.method = 2, projected = FALSE)
## S3 method for class 'TwoStepBootstrap'
summary(object, ...)
|
DatR |
explanatory variable R, a spatial object, see coordintes() |
VarR |
name of variable R |
DatY |
outcome variable Y, a spatial object, see coordintes() |
VarY |
name of variable Y |
variogram.model |
variogram model type, e.g. "Exp", "Sph", "Gau", "Mat" |
is.cov.misspecified |
logical; if TRUE, the covariance function is misspecified |
is.den.misspecified |
logical; if TRUE, the density function is not Gaussian distribution. |
plot.start.value |
logical, if TRUE, plot the variogram and the fitted variogram curve corresponding to starting values |
cutoff.R |
cutoff for sample variogram of variable R |
cutoff.res |
cutoff for sample variogram of regression residuals |
start.value.method |
fitting method, see fit.variogram() |
projected |
logical; if FALSE, data are assumed to be unprojected, meaning decimal longitude/latitude. For projected data, Euclidian distances are computed, for unprojected great circle distances(km) are computed. |
object |
class |
|
the number of observations |
|
point estimates for variogram parameters(psill, range) |
|
estimated variance-covariance matrix for variogram parameters(psill, range) |
|
point estimates for Krig-and-OLS estimator |
|
estimated variance-covariance matrix for Krig-and-OLS estimator |
|
point estimates for Krig-and-GLS estimator |
|
estimated variance-covariance matrix for Krig-and-GLS estimator |
|
point estimates for Two-Step Bootstrap estimator |
|
estimated variance-covariance matrix for Two-Step Bootstrap estimator |
summary
: summary
method for class "TwoStepBootstrap
".
sp, gstat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | library(SpReg)
rivers <- read.csv(system.file("extdata", "rivers.csv", package = "SpReg"))
rivers <- rivers[which(rivers$FOR_NLCD<100),]
train_set <- sample(1:558,277);
test_set <- setdiff(1:558,train_set);
rivers_train <- rivers[train_set, ];
rivers_test <- rivers[test_set, ];
DatR <- rivers_train[,c("FOR_NLCD", "LAT_DD", "LON_DD")];
DatR$X <- log((DatR$FOR_NLCD)/(100-DatR$FOR_NLCD));
sp::coordinates(DatR) <- ~LON_DD+LAT_DD;
sp::proj4string(DatR) = "+proj=longlat +datum=WGS84";
DatY <- rivers_test[, c("CL","LAT_DD","LON_DD")];
DatY$Y <- log(DatY$CL);
sp::coordinates(DatY) <- ~LON_DD+LAT_DD;
sp::proj4string(DatY) = "+proj=longlat +datum=WGS84";
TwoStep_Results <- TwoStepBootstrap(DatR, "X", DatY, "Y", "Exp", FALSE, FALSE,
cutoff.R = 295, cutoff.res = 40);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.