fxregimes {fxregime} | R Documentation |
Estimate changes/breaks between exchange rate regimes (based on exchange rate regression models).
fxregimes(formula, data, ...)
formula |
a "formula" describing the linear model to be fit (as
in fxlm . |
data |
a "zoo" time series. |
... |
further arguments passed to gbreakpoints (currently unexported,
see below), most of the arguments are identical to breakpoints.formula |
fxregimes
segments an exchange rate regression (Frankel-Wei regression)
into different regimes. The breakpoints are chosen to maximize the likelihood of
a Gaussian regression (with regime-specific variances). The number of breakpoints
are selected according to information criteria (by default LWZ, but BIC is also
reported).
The computing engine behind fxregime
is gbreakpoints
that generalizes
various aspects about breakpoints.formula
. Its interface
is not yet fixed, hence it is not exported in the namespace (and not documented).
Most arguments are similar to those of breakpoints.formula
,
in particular the minimal segment size h
and the maximal number of breaks
breaks
. To select the default information criterion the new argument
ic
can be set either to "LWZ"
(the default) or "BIC"
.
A set of methods for useful generic functions is available, including plot
,
print
, summary
, lines
, coef
, fitted
, residuals
,
breakfactor
, breakpoints
, breakdates
, etc. Mostly, they behave
like their "breakpoints"
counterparts. Querying information about the
models on each segment is made particularly easy by providing a refit
method that returns a list of fxlm
objects.
An object of class "fxregimes"
inheriting from "gbreakpointsfull"
,
"gbreakpoints"
, "breakpointsfull"
, "breakpoints"
.
Zeileis A., Kleiber C., Krämer W., Hornik K. (2003), Testing and Dating of Structural Changes in Practice, Computational Statistics and Data Analysis, 44, 109-123.
Shah A., Zeileis A., Patnaik I. (2005), What is the New Chinese Currency Regime?, Report 23, Department of Statistics and Mathematics, Wirtschaftsuniversitaet Wien, Research Report Series, November 2005.
Zeileis A., Shah A., Patnaik I. (2008), Testing, Monitoring, and Dating Structural Changes in Maximum Likelihood Models, Report 70, Department of Statistics and Mathematics, Wirtschaftsuniversitaet Wien, Research Report Series, August 2008.
## load package and data library("fxregime") data("FXRatesCHF", package = "fxregime") ## compute returns for CNY (and explanatory currencies) ## for one year after abolishing fixed USD regime cny <- fxreturns("CNY", frequency = "daily", start = as.Date("2005-07-25"), end = as.Date("2006-07-24"), other = c("USD", "JPY", "EUR", "GBP")) ## compute all segmented regression with minimal segment size of ## h = 20 and maximal number of breaks = 5. reg <- fxregimes(CNY ~ USD + JPY + EUR + GBP, data = cny, h = 20, breaks = 5, ic = "BIC") summary(reg) ## minimum BIC is attained for 2-segment (1-break) model plot(reg) ## two regimes ## 1: tight USD peg ## 2: slightly more relaxed USD peg round(coef(reg), digits = 3) sqrt(coef(reg)[, "(Variance)"]) ## inspect two individual models by re-fitting refit(reg)