m argument
(see Details for further information).
monitorStationarity(x, m = 0.25, trend = FALSE, kernel = c("ba", "pa", "qs", "tr"), bandwidth = c("and", "nw"), signif.level = 0.05, return.stats = TRUE, return.input = TRUE, check = TRUE, ...)numeric | matrix | data.frame]
Data on which to apply the monitoring procedure. If matrix, it may
have only one row or column, if data.frame just one column.numeric(1)]
Length of calibration period as fraction of the data's length
(between 0.1 and 0.9) or as number of observations (see Details).logical]
Should an intercept and a linear trend be included?
If FALSE (default), only an intercept is included.character(1)]
The kernel function to use for calculating the long-run variance.
Default is Bartlett kernel ("ba"), see Details for alternatives.character(1) | numeric(1)]
The bandwidth to use for calculating the long-run variance.
Default is Andrews (1991) ("and"), an alternative is Newey West
(1994) ("nw"). You can also set the bandwidth manually.numeric(1)]
Level of significance (between 0.01 and 0.1).
Detection time will be calculated only if the estimated
p-value is smaller than signif.level. Default is 0.05.logical]
Whether to return all test statistics. Default is TRUE.logical]
Whether to return the input data, default is TRUE.logical]
Wheather to check (and if necessary convert) the arguments.
See checkVars for further information.getBandwidthNW (inter,
weights), if bandwidth = "nw".cointmonitoR] object with components:
Hsm [numeric(1)]time [numeric(1)]p.value [numeric(1)]cv [numeric(1)]sig [numeric(1)]trend [character(1)]name [character(1)]m [list(2)]$m.frac [numeric(1)]: calibration period (fraction)
$m.index [numeric(1)]: calibration period (length)kernel [character(1)]bandwidth [list(2)]$name [character(1)]: bandwidth function (name)
$number [numeric(1)]: bandwidthstatistics [numeric]NA
during calibration period (available if return.stats = TRUE)input [numeric | matrix | data.frame]return.stats = TRUE)m
to the number of its last observation.
The corresponding fraction of the data's length will be calculated
automatically. Alternatively you can set m directly to the fitting
fraction value. Attention: The calibration period may become smaller than
intended: The last observation is calculated as floor(m * N)
(with N = 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
monitorCointegration,
plot.cointmonitoR,
print.cointmonitoR
set.seed(1909)
x <- rnorm(200)
x2 <- c(x[1:100], cumsum(x[101:200]) / 2)
# Specify the calibration period
# as fraction of the total length of x:
monitorStationarity(x, m = 0.25)
monitorStationarity(x2, m = 0.465)
# Specify the calibration period
# by setting its last observation exactly:
monitorStationarity(x, m = 50)
monitorStationarity(x2, m = 93)
Run the code above in your browser using DataLab