Description Usage Arguments Details Value References See Also Examples
View source: R/breakpoints.glogisfit.R
Fitting univariate generalized logisitc distributions (Type I: skew-logistic with location, scale, and shape parameters) to segments of time series data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## S3 method for class 'glogisfit'
breakpoints(obj, h = 0.15, breaks = NULL, ic = "LWZ",
hpc = "none", ...)
## S3 method for class 'breakpoints.glogisfit'
refit(object, ...)
## S3 method for class 'breakpoints.glogisfit'
coef(object, log = TRUE, ...)
## S3 method for class 'breakpoints.glogisfit'
fitted(object, type = c("mean", "variance", "skewness"), ...)
## S3 method for class 'breakpoints.glogisfit'
confint(object, parm = NULL, level = 0.95, breaks = NULL,
meat. = NULL, ...)
|
obj |
an object of class |
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 |
ic |
character specifying the default information criterion that should
be employed for selecting the number of breakpoints. Default is |
hpc |
a character specifying the high performance computing support.
Default is |
object |
an object of class |
log |
logical option in |
type |
character specifying which moments of the segmented fitted distribution should be extracted. |
parm |
integer. Either |
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 |
... |
arguments passed to methods. |
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, currently using foreach
for the dynamic programming algorithm.
If hpc = "foreach"
is to be used, a parallel backend should be registered
before. See foreach
for more information.
breakpoints.glogisfit
returns an object of class "breakpoints.glogisfit"
that
inherits from "gbreakpointsfull"
.
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. http://dx.doi.org/10.1016/j.csda.2009.12.005.
glogisfit
, fxregimes
, breakpoints
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## 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)
## 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))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.