predict.SSN2 {SSN2} | R Documentation |
Model predictions (Kriging)
Description
Predicted values and intervals based on a fitted model object.
Usage
## S3 method for class 'ssn_lm'
predict(
object,
newdata,
se.fit = FALSE,
interval = c("none", "confidence", "prediction"),
level = 0.95,
block = FALSE,
...
)
## S3 method for class 'ssn_glm'
predict(
object,
newdata,
type = c("link", "response"),
se.fit = FALSE,
interval = c("none", "confidence", "prediction"),
newdata_size,
level = 0.95,
var_correct = TRUE,
...
)
Arguments
object |
|
newdata |
A character vector that indicates the name of the prediction data set
for which predictions are desired (accessible via |
se.fit |
A logical indicating if standard errors are returned.
The default is |
interval |
Type of interval calculation. The default is |
level |
Tolerance/confidence level. The default is |
block |
A logical indicating whether a block prediction over the entire
region in |
... |
Other arguments. Not used (needed for generic consistency). |
type |
The scale ( |
newdata_size |
The |
var_correct |
A logical indicating whether to return the corrected prediction
variances when predicting via models fit using |
Details
The (empirical) best linear unbiased predictions (i.e., Kriging
predictions) at each site are returned when interval
is "none"
or "prediction"
alongside standard errors. Prediction intervals
are also returned if interval
is "prediction"
. When
interval
is "confidence"
, the estimated mean is returned
alongside standard errors and confidence intervals for the mean.
Value
If se.fit
is FALSE
, predict.ssn()
returns
a vector of predictions or a matrix of predictions with column names
fit
, lwr
, and upr
if interval
is "confidence"
or "prediction"
. If se.fit
is TRUE
, a list with the following components is returned:
-
fit
: vector or matrix as above -
se.fit:
standard error of each fit
Examples
# Copy the mf04p .ssn data to a local directory and read it into R
# When modeling with your .ssn object, you will load it using the relevant
# path to the .ssn data on your machine
copy_lsn_to_temp()
temp_path <- paste0(tempdir(), "/MiddleFork04.ssn")
mf04p <- ssn_import(temp_path, predpts = "pred1km", overwrite = TRUE)
ssn_mod <- ssn_lm(
formula = Summer_mn ~ ELEV_DEM,
ssn.object = mf04p,
tailup_type = "exponential",
additive = "afvArea"
)
predict(ssn_mod, "pred1km")