wllag | R Documentation |
This function estimates lead-lag parameters on a scale-by-scale basis from non-synchronously observed bivariate processes, using the estimatiors proposed in Hayashi and Koike (2018b).
wllag(x, y, J = 8, N = 10, tau = 1e-3, from = -to, to = 100, verbose = FALSE, in.tau = FALSE, tol = 1e-6)
x |
a |
y |
a |
J |
a positive integer. Scale-by scale lead-lag parameters are estimated up to the level |
N |
The number of vanishing moments of Daubechies' compactly supported wavelets. This should be an integer between 1 and 10. |
tau |
the step size of a finite grid on which objective functions are evaluated. Note that this value is identified with the finest time resolution of the underlying model.
The default value |
from |
a negative integer. |
to |
a positive integer. |
verbose |
a logical. If |
in.tau |
a logical. If |
tol |
tolelance parameter to avoid numerical errors in comparison of time stamps. All time stamps are divided by |
Hayashi and Koike (2018a) introduced a bivariate continuous-time model having different lead-lag relationships at different time scales. The wavelet cross-covariance functions of this model, computed based on the Littlewood-Paley wavelets, have unique maximizers in absolute values at each time scale. These maximizer can be considered as lead-lag parameters at each time scale. To estimate these parameters from discrete observation data, Hayashi and Koike (2018b) constructed objective functions mimicking behavior of the wavelet cross-covariance functions of the underlying model. Then, estimates of the scale-by-scale lead-lag parameters can be obtained by maximizing these objective functions in absolute values.
If verbose
is FALSE
, a numeric vector with length J
, corresponding to the estimated scale-by-scale lead-lag parameters, is returned. Note that their positive values indicate that the first process leads the second process.
Otherwise, an object of class "yuima.wllag"
, which is a list with the following components, is returned:
lagtheta |
the estimated scale-by-scale lead-lag parameters. The j th component corresponds to the estimate at the level j. A positive value indicates that the first process leads the second process. |
obj.values |
the values of the objective functions evaluated at the estimated lead-lag parameters. |
obj.fun |
a list of values of the objective functions. The j th component of the list corresponds to a |
theta.hry |
the lead-lag parameter estimate in the sense of Hoffmann, Rosenbaum and Yoshida (2013). |
cor.hry |
the correltion coefficient in the sense of Hoffmann, Rosenbaum and Yoshida (2013), evaluated at the estimated lead-lag parameter. |
ccor.hry |
a |
Smaller levels correspond to finer time scales. In particular, the first level corresponds to the finest time resolution, which is defined by the argument tau
.
If there are multiple maximizers in an objective function, wllag
takes a maximizer farthest from zero (if there are two such values, the function takes the negative one). This behavior is different from llag
.
The objective functions themselves do NOT consitently estimate the corresponding wavelet covariance functions. This means that values in obj.values
and obj.fun
cannot be interpreted as covaraince estimates (their scales depend on the degree of non-synchronicity of observation times).
Yuta Koike with YUIMA Project Team
Hayashi, T. and Koike, Y. (2018a). Wavelet-based methods for high-frequency lead-lag analysis, SIAM Journal of Financial Mathematics, 9, 1208–1248.
Hayashi, T. and Koike, Y. (2018b). Multi-scale analysis of lead-lag relationships in high-frequency financial markets. doi: 10.48550/arXiv.1708.03992.
Hoffmann, M., Rosenbaum, M. and Yoshida, N. (2013) Estimation of the lead-lag parameter from non-synchronous data, Bernoulli, 19, no. 2, 426–461.
simBmllag
, llag
## An example from a simulation setting of Hayashi and Koike (2018b) set.seed(123) # Simulation of Bm driving the log-price processes n <- 15000 J <- 13 tau <- 1/2^(J+1) rho <- c(0.3,0.5,0.7,0.5,0.5,0.5,0.5,0.5) theta <- c(-1,-1, -2, -2, -3, -5, -7, -10) * tau dB <- simBmllag(n, J, rho, theta) Time <- seq(0, by = tau, length.out = n) # Time index x <- zoo(diffinv(dB[ ,1]), Time) # simulated path of the first process y <- zoo(diffinv(dB[ ,2]), Time) # simulated path of the second process # Generate non-synchronously observed data x <- x[as.logical(rbinom(n + 1, size = 1, prob = 0.5))] y <- y[as.logical(rbinom(n + 1, size = 1, prob = 0.5))] # Estimation of scale-by-scale lead-lag parameters (compare with theta/tau) wllag(x, y, J = 8, tau = tau, tol = tau, in.tau = TRUE) # Estimation with other information out <- wllag(x, y, tau = tau, tol = tau, in.tau = TRUE, verbose = TRUE) out # Plot of the HRY cross-correlation function plot(out$ccor.hry, xlab = expression(theta), ylab = expression(U(theta))) # Plot of the objective functions op <- par(mfrow = c(4,2)) plot(out) par(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.