plot_ordinal_cohens_kappa {otsfeatures} | R Documentation |
Constructs a serial dependence plot based on the ordinal Cohen's kappa considering the block distance
Description
plot_ordinal_cohens_kappa
constructs a serial dependence plot of an ordinal
time series based on the ordinal Cohen's kappa considering the block distance
Usage
plot_ordinal_cohens_kappa(
series,
states,
max_lag = 10,
alpha = 0.05,
plot = TRUE,
title = "Serial dependence plot",
bar_width = 0.12,
...
)
Arguments
series |
An OTS. |
states |
A numerical vector containing the corresponding states. |
max_lag |
The maximum lag represented in the plot (default is 10). |
alpha |
The significance level for the corresponding hypothesis test (default is 0.05). |
plot |
Logical. If |
title |
The title of the graph. |
bar_width |
The width of the corresponding bars. |
... |
Additional parameters for the function. |
Details
Constructs a serial dependence plot based on the ordinal Cohens's kappa, \widehat{\kappa}_d(l)
,
for several lags, where d
is the block distance between ordinal states, that is, d(s_i, s_j)=|i-j|
for two states s_i
and s_j
.
A dashed lined is incorporated indicating the critical value
of the test based on the following asymptotic approximation (under the i.i.d. assumption):
\sqrt{\frac{T\widehat{disp}_d^2}{4\sum_{k,l=0}^{n-1}(\widehat{f}_{min\{k,l\}}-\widehat{f}_k\widehat{f}_l)^2}}\bigg(\widehat{\kappa}_d(l)+\frac{1}{T}\bigg)\sim N\big(0, 1\big),
where T
is the series length,
\widehat{f_k}
is the estimated cumulative probability for state s_k
and \widehat{disp}_d
is the DIVC estimate of the dispersion.
Value
If plot = TRUE
(default), returns the serial dependence plot based on the ordinal Cohens's kappa. Otherwise, the function
returns a list with the values of the ordinal Cohens's kappa, the critical
value and the corresponding p-values.
Author(s)
Ángel López-Oriona, José A. Vilar
References
Weiß CH (2019). “Distance-based analysis of ordinal data and ordinal time series.” Journal of the American Statistical Association.
Examples
plot_ock <- plot_ordinal_cohens_kappa(series = AustrianWages$data[[100]],
states = 0 : 5, max_lag = 3) # Representing
# the serial dependence plot
list_ck <- plot_ordinal_cohens_kappa(series = AustrianWages$data[[100]],
states = 0 : 5, max_lag = 3, plot = FALSE) # Obtaining
# the values of the ordinal Cohens's kappa, the critical value and the p-values