Learn R Programming

SSN (version 1.1.4)

CrossValidationStatsSSN: Compute Summary Statistics on Crossvalidation Values for glmssn Objects

Description

CrossValidationStatsSSN operates on glmssn objects and uses the CrossValidationSSN function to create a data.frame of crossvalidation predictions and standard errors. Then it computes summary statistics such as bias and confidence interval coverage based on cross-validation.

Usage

CrossValidationStatsSSN(object)

Arguments

object
an object of class 'glmssn'

Value

  • Output is a data.frame with with a single entry for the columns as listed above.

Details

This function uses the CrossValidationSSN function to create a data.frame of crossvalidation predictions and standard errors. Then it computes summary statistics on bias, root mean-squared prediction errors (RMSPE), and confidence interval coverage based on cross-validation. Output is a data.frame with with a single entry for the columns as describe below. In the descriptions, obs is an observed data value, pred is its prediction using crossvalidation, and predSE is the prediction standard error using crossvalidation. [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

See Also

InfoCritCompare, glmssn, CrossValidationSSN

Examples

Run this code
library(SSN)
# NOT RUN 
# mf04 <- importSSN(system.file("lsndata/MiddleFork04.ssn", 
#	        package = "SSN"), o.write = TRUE)
# use SpatialStreamNetwork object mf04 that was already created
data(mf04)
#make sure mf04 has the correct path, will vary for each users installation
mf04 <- updatePath(mf04, system.file("lsndata/MiddleFork04.ssn", package = "SSN"))

## NOT RUN Distance Matrix has already been created
## createDistMat(mf04)

# The models take a little time to fit, so they are NOT RUN 
# Uncomment the code to run them
# Alternatively, you can load the fitted models first to look at results
data(modelFits)

## 3 component spatial model
#fitSp <- glmssn(Summer_mn ~ ELEV_DEM + netID,
#    ssn.object = mf04, EstMeth = "REML", family = "Gaussian",
#    CorModels = c("Exponential.tailup","Exponential.taildown",
#    "Exponential.Euclid"), addfunccol = "afvArea")
CrossValidationStatsSSN(fitSp)

Run the code above in your browser using DataLab