Estimation of a time-varying variance-covariance matrix using the local constant or the local linear kernel smoothing methodologies.
tvCov( x, bw = NULL, cv.block = 0, est = c("lc", "ll"), tkernel = c("Triweight", "Epa", "Gaussian") )
x | A matrix. |
---|---|
bw | A scalar. |
cv.block | A positive scalar with the size of the block in leave-one block-out cross-validation. By default 'cv.block=0' meaning leave-one-out cross-validation. |
est | A character, either "lc" or "ll" for local constant or local linear. |
tkernel | A character, either "Triweight, "Epa" or "Gaussian" kernel functions. |
A matrix of dimension obs x neq x neq.
Aslanidis, N. and Casas, I (2013) Nonparametric correlation models for portfolio allocation. Journal of Banking \& Finance, 37, 2268-2283
##Generate two independent (uncorrelated series) y <- cbind(rnorm(100, sd = 4), rnorm(100, sd = 1)) ##Estimation variance-variance matrix. If the bandwidth is unknown, it can ##calculated with function bwCov() Sigma.hat <- tvCov(y, bw = 1.4) ##The first time estimate print(Sigma.hat[,,1])#> [,1] [,2] #> [1,] 15.382965 -1.175845 #> [2,] -1.175845 1.033527#> [,1] [,2] #> [1,] 13.0650645 -0.8566088 #> [2,] -0.8566088 0.9647204##Generate two dependent variables y <- MASS::mvrnorm(n = 100, mu = c(0,0), Sigma = cbind(c(1, -0.5), c(-0.5, 4))) ##Estimation variance-variance matrix Sigma.hat <- tvCov(y, bw = 3.2) ##The first time estimate print(Sigma.hat[,,1])#> [,1] [,2] #> [1,] 0.8223837 -0.2518741 #> [2,] -0.2518741 3.1337540