predict.glmssn: Calculate Predictions for Prediction Sites

View source: R/predict.glmssn.R

predict.glmssnR Documentation

Calculate Predictions for Prediction Sites

Description

The predict.glmssn function calculates prediction values for prediction sites based on the results stored within an object of class glmssn

Usage

## S3 method for class 'glmssn'
predict(object, predpointsID, ...)

Arguments

object

the glmssn object

predpointsID

the prediction points ID

...

other arguments passed to predict

Details

predict.glmssn is a generic function that has been modified for glmssn objects. Two new columns are added to the prediction points data.frame (point.data) within the existing glmssn object. The first column contains prediction values and has the same name as the response variable. The second column <response name>.predSE contains the standard errors for the predictions.

Value

The overall structure is the same as an object of class glmssn, except the prediction points data.frame in the SpatialStreamNetwork object (list-item 2) is appended by the following columns:

    <response name> # The prediction value for each prediction site
    <response name>.predSE # The standard error of the prediction value
  

Details of this object structure can be found using the names command.

Author(s)

Jay Ver Hoef support@SpatialStreamNetworks.com

See Also

glmssn

Examples

library(SSN)

# get some model fits stored as data objects
data(modelFits)
#NOT RUN use this one
#fitSp <- glmssn(Summer_mn ~ ELEV_DEM + netID,
#    ssn.object = mf04p, EstMeth = "REML", family = "Gaussian",
#    CorModels = c("Exponential.tailup","Exponential.taildown",
#    "Exponential.Euclid"), addfunccol = "afvArea")
#for examples only, make sure fitSp has the correct path
#if you use importSSN(), path will be correct
fitSp$ssn.object <- updatePath(fitSp$ssn.object, 
	paste0(tempdir(),'/MiddleFork04.ssn'))

ssnpred <- predict(fitSp, predpointsID = "pred1km")
names(ssnpred)
names(ssnpred$ssn.object) ## Note additional predicted columns in pred1km
plot(ssnpred)



SSN documentation built on March 7, 2023, 5:30 p.m.