Learn R Programming

tvReg (version 0.5.0)

tvCov: Time-varying Variance-Covariance Estimation

Description

Estimation of a time-varying variance-covariance matrix using the local constant or the local linear kernel smoothing methodologies.

Usage

tvCov(x, bw, est = c("lc", "ll"), tkernel = c("Epa", "Gaussian"))

Arguments

x

A matrix.

bw

A scalar.

est

A character, either "lc" or "ll" for local constant or local linear.

tkernel

A character, either "Gaussian" or "Epa" kernel types.

Value

A matrix of dimension obs x neq x neq.

References

Aslanidis, N. and Casas, I (2013) Nonparametric correlation models for portfolio allocation. Journal of Banking \& Finance, 37, 2268-2283

See Also

bwCov

Examples

Run this code
# NOT RUN {
##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])
##The mean over time of all estimates
print(apply(Sigma.hat, 1:2, mean))
##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])

# }

Run the code above in your browser using DataLab