aic: AIC and BIC guided aggregation of segments

Description Usage Arguments Details Value Examples

Description

Functions to aggregate the last segments in a rseg object in order to optimize the AIC or BIC.

Usage

1
2
3
4
aic(x, criterion = c("AIC", "BIC")[1], family = c("gaussian",
  "binomial", "censored")[1])

bic(x, family = c("gaussian", "binomial", "censored")[1])

Arguments

x

an object of class rseg fit by cseg, eseg or rseg.

criterion

type of information criterion used. Accepted values are "AIC" (= default) and "BIC".

family

a description of the error distribution/scale of the outcome. Accepted values are "gaussian", "binomial" and "censored".

Details

Depending on the value of the family argument, the AIC and BIC are extracted from a generalized linear model with identity link function (= "gaussian"), logit link function (= "binomial") or a Cox proportional hazards regression model (= "censored"). The segmentation provided by x is used as factor variable in these models.

Value

An object of class rseg.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
airq <- subset(airquality, !is.na(Ozone))
irisseg <- cseg(Ozone ~ ., minsplit = 10L, minbucket = 3L, data = airq)
irisseg

## The AIC does not suggest aggregation of segments
aic(irisseg, family = 'gaussian')

## The stricter BIC suggests aggregation of segments
aic(irisseg, criterion = 'BIC', family = 'gaussian')
## This is equivalent to
bic(irisseg, family = 'gaussian')

rseg documentation built on May 2, 2019, 6:38 p.m.

Related to aic in rseg...