LocLinear {mlrv} | R Documentation |
Local linear Regression
Description
Local linear estimates for time varying coefficients
Usage
LocLinear(bw, t, y, X, db_kernel = 0L, deriv2 = 0L, scb = 0L)
Arguments
bw |
double, bandwidth |
t |
vector, time, 1:n/n |
y |
vector, response series to be tested for long memory in the next step |
X |
matrix, covariates matrix |
db_kernel |
bool, whether to use jackknife kernel, default 0 |
deriv2 |
bool,whether to return second-order derivative, default 0 |
scb |
bool, whether to use the result for further calculation of simultaneous confidence bands. |
Details
The time varying coefficients are estimated by \[(\hat{\boldsymbol{\beta}}_{b_{n}}(t), \hat{\boldsymbol{\beta}}_{b_{n}}^{\prime}(t)) = \mathbf{arg min}_{\eta_{0},\eta_{1}}[\sum_{i=1}^{n}{y_{i}-\mathbf{x}_{i}^{\mathrm{T}}\eta_{0}-\mathbf{x}_{i}^{\mathrm{T}} \eta_{1}(t_{i}-t)}^{2} \boldsymbol{K}_{b_{n}}(t_{i}-t)]\] where beta0 is \(\hat{\boldsymbol{\beta}}_{b_{n}}(t)\), mu is \(X^T \hat{\boldsymbol{\beta}}_{b_{n}}(t)\)
Value
a list of results
mu: the estimated trend
beta0: time varying coefficient
X_reg: a matrix whose j'th row is \(x_j^T\hat{M}(t_j)\)
t: 1:n/n
bw: bandwidth used
X: covariates matrix
y: response
n: sample size
p: dimension of covariates including the intercept
invM: inversion of M matrix, when scb = 1
References
Zhou, Z., & Wu, W. B. (2010). Simultaneous inference of linear models with time varying coefficients. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 72(4), 513-531.
Examples
param = list(d = -0.2, heter = 2, tvd = 0,
tw = 0.8, rate = 0.1, cur = 1, center = 0.3,
ma_rate = 0, cov_tw = 0.2, cov_rate = 0.1,
cov_center = 0.1, all_tw = 1, cov_trend = 0.7)
n = 500
t = (1:n)/n
data = Qct_reg(n, param)
result = LocLinear(0.2, t, data$y, data$x)