Learn R Programming

glogis (version 1.0-2)

breakpoints.glogisfit: Segmented Fitting of the Generalized Logistic Distribution

Description

Fitting univariate generalized logisitc distributions (Type I: skew-logistic with location, scale, and shape parameters) to segments of time series data.

Usage

# S3 method for glogisfit
breakpoints(obj, h = 0.15, breaks = NULL, ic = "LWZ",
  hpc = "none", …)

# S3 method for breakpoints.glogisfit refit(object, …)

# S3 method for breakpoints.glogisfit coef(object, log = TRUE, …)

# S3 method for breakpoints.glogisfit fitted(object, type = c("mean", "variance", "skewness"), …)

# S3 method for breakpoints.glogisfit confint(object, parm = NULL, level = 0.95, breaks = NULL, meat. = NULL, …)

Arguments

obj

an object of class glogisfit.

h

numeric. Minimal segment size either given as fraction relative to the sample size or as an integer giving the minimal number of observations in each segment.

breaks

integer specifying the maximal number of breaks to be calculated. By default the maximal number allowed by h is used.

ic

character specifying the default information criterion that should be employed for selecting the number of breakpoints. Default is "LWZ" (Liu-Wu-Zidek criterion, a modified BIC). Instead the classic "BIC" can be used.

hpc

a character specifying the high performance computing support. Default is "none", can be set to "foreach".

object

an object of class breakpoints.glogisfit as returned by the breakpoints method.

log

logical option in coef method indicating whether scale and shape parameters should be reported in logs (default) or the original levels.

type

character specifying which moments of the segmented fitted distribution should be extracted.

parm

integer. Either parm or breaks may be set, see below.

level

numeric. The confidence level to be used.

meat.

function. A function for extracting the meat of a sandwich estimator from a fitted object. By default, the inverse of bread is used, i.e., a correctly specified model is assumed.

arguments passed to methods.

Value

breakpoints.glogisfit returns an object of class "breakpoints.glogisfit" that inherits from "gbreakpointsfull".

Details

To test whether sequences (typically time series) of observations follow the same generalized logistic distribution, the stability of the parameters can be tested. If there is evidence for parameter instability, breakpoints can be estimated to find segments with stable parameters.

The methods from the strucchange and fxregime packages are leveraged. For testing, the generalized M-fluctuation tests from strucchange can directly be employed using gefp. For breakpoint estimation, the methods documented here provide a user interface to some internal functionality from the fxregime packages. They employ the (unexported) workhorse function gbreakpoints which is modeled after breakpoints from the strucchange package but employing user-defined estimation methods.

Optional support for high performance computing is available in the breakpoints method based on the foreach package for the dynamic programming algorithm. If hpc = "foreach" is to be used, a parallel backend should be registered before. See breakpoints for more information.

References

Windberger T, Zeileis A (2014). Structural Breaks in Inflation Dynamics within the European Monetary Union. Eastern European Economics, 52(3), 66--88.

Zeileis A, Shah A, Patnaik I (2010). Testing, Monitoring, and Dating Structural Changes in Exchange Rate Regimes. Computational Statistics and Data Analysis, 54(6), 1696--1706. 10.1016/j.csda.2009.12.005.

See Also

glogisfit, fxregimes, breakpoints

Examples

Run this code
# NOT RUN {
## artifical data with one structural change
set.seed(1071)
x <- c(rglogis(50, -1, scale = 0.5, shape = 3), rglogis(50, 1, scale = 0.5, shape = 1))
x <- zoo(x, yearmon(seq(2000, by = 1/12, length = 100)))

## full sample estimation
gf <- glogisfit(x)

if(require("strucchange")) {

## structural change testing
gf_scus <- gefp(gf, fit = NULL)
plot(gf_scus, aggregate = FALSE)
plot(gf_scus, functional = meanL2BB)
sctest(gf_scus)
sctest(gf_scus, functional = meanL2BB)

# }
# NOT RUN {
## breakpoint estimation
gf_bp <- breakpoints(gf)
plot(gf_bp)
summary(gf_bp)
breakdates(gf_bp)
coef(gf_bp)
confint(gf_bp)

## fitted model
plot(x)
lines(gf_bp)
lines(fitted(gf_bp, type = "mean"), col = 4)
lines(confint(gf_bp))
# }
# NOT RUN {
}
# }

Run the code above in your browser using DataLab