library("fxregime")
## load package and data
library("fxregime")
data("FXRatesCHF", package = "fxregime")
## compute returns for CNY (and explanatory currencies)
## after abolishing fixed USD regime until end of 2005
cny <- fxreturns("CNY", frequency = "daily",
start = as.Date("2005-07-25"), end = as.Date("2005-12-31"),
other = c("USD", "JPY", "EUR", "GBP"))
## estimate full-sample exchange rate regression model
fm <- fxlm(CNY ~ USD + JPY + EUR + GBP, data = cny)
## check for plain USD peg:
fxpegtest(fm)Wald test for pegged FX regime
Model 1: CNY ~ USD + JPY + EUR + GBP
Model 2: CNY ~ USD (fixed = 1)
Res.Df RSS Df Sum of Sq F Pr(>F)
1 108 0.068387
2 104 0.067570 4 0.00081633 0.3141 0.868
## no deviation from a plain USD peg