monitorCointegration {cointmonitoR} | R Documentation |
This procedure is able to monitor a cointegration model for level or
trend cointegration and returns the corresponding break point, if available.
It is based on parameter estimation on a pre-break "calibration" period
at the beginning of the sample that is known or assumed to be free of
structural change and can be specified exactly via the m
argument
(see Details for further information).
monitorCointegration(x, y, m = 0.25, model = c("FM", "D", "IM"), trend = FALSE, kernel = c("ba", "pa", "qs", "tr"), bandwidth = c("and", "nw"), D.options = NULL, signif.level = 0.05, return.stats = TRUE, return.input = TRUE, check = TRUE, ...)
x |
[ |
y |
[ |
m |
[ |
model |
[ |
trend |
[ |
kernel |
[ |
bandwidth |
[ |
D.options |
[ |
signif.level |
[ |
return.stats |
[ |
return.input |
[ |
check |
[ |
... |
Arguments passed to |
The calibration period can be set by setting the argument m
to the
number of the last observation, that should be inside this period.
The corresponding fraction of the data's length will be calculated
automatically. Alternatively you can set m
directly to the fitting
fraction value, but you should pay attention to the fact, that the
calibration period may become smaller than intended: The last observation
is calculated as floor(m * N)
(with N
the length of x).
The kernel that is used for calculating the long-run variance can be one of the following:
"ba"
: Bartlett kernel
"pa"
: Parzen kernel
"qs"
: Quadratic Spectral kernel
"tr"
: Truncated kernel
[cointmonitoR
] object with components:
Hsm
[numeric(1)
]value of the test statistic
time
[numeric(1)
]detected time of structural break
p.value
[numeric(1)
]estimated p-value of the test (between 0.01 and 0.1)
cv
[numeric(1)
]critical value of the test
sig
[numeric(1)
]significance level used for the test
residuals
[numeric
]residuals of the modified OLS model to be used for calculating the test statistics
model
[character(1)
]cointOLS
model ("FM", "D", or "IM")
trend
[character(1)
]trend model ("level" or "trend")
name
[character(1)
]name(s) of data
m
[list(2)
]list with components:
$m.frac
[numeric(1)
]: calibration period (fraction)
$m.index
[numeric(1)
]: calibration period (length)
kernel
[character(1)
]kernel function
bandwidth
[list(2)
]$name
[character(1)
]: bandwidth function (name)
$number
[numeric(1)
]: bandwidth
statistics
[numeric
]values of test statistics with the same length as data, but NA
during calibration period (available if return.stats = TRUE
)
input
[numeric
| matrix
| data.frame
]copy of input data (available if return.stats = TRUE
)
D.options
[list
]information about further parameters (available if model = "D"
)
Wagner, M. and D. Wied (2015): "Monitoring Stationarity and Cointegration," Discussion Paper, DOI:10.2139/ssrn.2624657.
Other cointmonitoR: monitorStationarity
,
plot.cointmonitoR
,
print.cointmonitoR
set.seed(42) x = data.frame(x1 = cumsum(rnorm(200)), x2 = cumsum(rnorm(200))) eps1 = rnorm(200, sd = 2) eps2 = c(eps1[1:100], cumsum(eps1[101:200])) y = x$x1 - x$x2 + 10 + eps1 monitorCointegration(x = x, y = y, m = 0.5, model = "FM") y2 = y + seq(1, 30, length = 200) monitorCointegration(x = x, y = y2, m = 0.5, model = "FM") monitorCointegration(x = x, y = y2, m = 0.5, trend = TRUE, model = "FM") y3 = x$x1 - x$x2 + 10 + eps2 monitorCointegration(x = x, y = y3, m = 0.5, model = "FM") monitorCointegration(x = x, y = y3, m = 0.5, model = "D") monitorCointegration(x = x, y = y3, m = 0.5, model = "IM")