Description Usage Arguments Value See Also Examples
The method uses neural network and bagging to estimate a trend and then correct for spatial correlation in the residual. The method uses a single hidden layer network that is carried out by nnet. Initially, the input variables are transformed using a SVD decomposition and the trend is obtained by aggregating (average) several bootstrap samples. The residuals are further predicted using kriging or thin plate spline.
1 |
form |
Formula defining the trend. |
x |
Data for training the model |
xnew |
Data at new locations. |
n |
Number of units |
k |
Number of bootstrap sample |
model |
Model for the residuals. Either 'tps' or variogram models (see vgm). |
loc |
Formula providing the spatial coordinates |
... |
Other argument pass to autoKrige |
pred |
Prediction at new locations. |
vgm |
Sample variogram. |
model |
Fitted variogram model. See vgm. |
resid.se |
Standard deviations of the kriging. |
gamKrige, roiKrige.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Gather info in on data.frame
xd <- cbind( l1 = log(sapply(floodStream, mean)),
floodVars, lon = floodCoord[,1], lat = floodCoord[,2])
nsite <- nrow(xd)
## identify a validation and a training set
valid <- seq(nsite) %in% sample(seq(nsite), round(.2*nsite))
train <- !valid
l1Form <- l1 ~ area + slope + elev + map + len + wb
fit <- nnKrige(l1Form, x = xd[train,], xnew = xd[valid,], n = 30,
model = c('Exp','Gau','Sph'), loc = ~lon+lat)
print(fit)
plot(fit)
predict(fit)
fit <- nnKrige(l1Form, x = xd[train,], xnew = xd[valid,], n = 30,
model = 'tps', loc = ~lon+lat)
fit <- nnKrige(l1Form, x = xd[train,], xnew = xd[valid,], n = 30)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.