AIC.glmssn: AIC for glmssn objects

View source: R/AIC.glmssn.R

AICR Documentation

AIC for glmssn objects

Description

AIC.glmssn is a method that calculates AIC for fitted glmssn objects.

Usage

  ## S3 method for class 'glmssn'
AIC(object, ..., k = 2)

Arguments

object

an object of class glmssn

...

optionally more fitted model objects

k

numeric, the penalty per parameter to be used; the default k = 2 is the classical AIC.

Details

AIC is a generic function and this implements a method for glmssn objects

Value

a numeric AIC value for the specified glmssn object

Author(s)

Jay Ver Hoef support@SpatialStreamNetworks.com

See Also

glmssn

Examples


library(SSN)
#for examples, copy MiddleFork04.ssn directory to R's temporary directory
copyLSN2temp()
# NOT RUN
# Create a SpatialStreamNetork object that also contains prediction sites
#mf04p <- importSSN(paste0(tempdir(),'/MiddleFork04.ssn'), 
#  predpts = "pred1km", o.write = TRUE)
#use mf04p SpatialStreamNetwork object, already created
data(mf04p)
#for examples only, make sure mf04p has the correct path
#if you use importSSN(), path will be correct
mf04p <- updatePath(mf04p, paste0(tempdir(),'/MiddleFork04.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'))

#note the model was fitted using REML, so fixed effects have 
# been integrated out
summary(fitSp)
AIC(fitSp)


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