Description Usage Arguments Details Value Examples
Functions to aggregate the last segments in a rseg
object in order to optimize the AIC or BIC.
1 2 3 4 |
x |
an object of class |
criterion |
type of information criterion used. Accepted values are |
family |
a description of the error distribution/scale of the outcome. Accepted values are |
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.
An object of class rseg
.
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')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.