InformationCriterion: Information criterion for scglr with factors

View source: R/InformationCriterion.R

InformationCriterionR Documentation

Information criterion for scglr with factors

Description

Information criterion for scglr with factors

Usage

InformationCriterion(x)

Arguments

x

an object from FactorSCGLR

Value

aic

akaike information criterion

bic

bayesian information criterion

Examples

# load sample data
data <- genus
# get variable names from dataset
n <- names(data)
ny <- n[grep("^gen",n)]
nx1 <- n[grep("^evi",n)]
nx2 <- n[grep("^pluvio",n)]
na <- c("geology", "altitude", "forest", "lon", "lat")
# build multivariate formula
form <- multivariateFormula(Y = ny, X = list(nx1, nx2), A = na)
# define family
fam <- rep("poisson", length(ny))
# run function
H <- c(2,2)
J <- 2
met <- methodSR(l=4, s=0.5)
res <- FactorSCGLR(formula=form, data=data, H=H, J=J,
                   family=fam, method=met, offset = data$surface)

# compute the information criterion
IC <- InformationCriterion(res)
IC$aic
IC$bic

julien-gibaud/FactorsSCGLR documentation built on March 27, 2024, 8:17 a.m.