Learn R Programming

tvReg (version 0.5.6)

tvSURE: Time-Varying Seemingly Unrelated Regression Equations Model

Description

Fits a set of balanced linear structural equations using Time-varying Ordinary Least Squares (tvOLS), Time-varying Seemingly Unrelated Regression (tvGLS), when the error variance-covariance matrix is known, or Time-varying Feasible Seemingly Unrelated Regression (tvFGLS), when the error variance-covariance matrix is unknown.

Usage

tvSURE(
  formula,
  z = NULL,
  ez = NULL,
  bw = NULL,
  cv.block = 0,
  data,
  method = c("tvOLS", "tvFGLS", "tvGLS"),
  Sigma = NULL,
  est = c("lc", "ll"),
  tkernel = c("Triweight", "Epa", "Gaussian"),
  bw.cov = NULL,
  singular.ok = TRUE,
  R = NULL,
  r = NULL,
  control = tvreg.control(...),
  ...
)

Arguments

formula

A list of formulas, one for each equation.

z

A vector containing the smoothing variable.

ez

(optional) A scalar or vector with the smoothing estimation values. If values are included then the vector z is used.

bw

An optional scalar or vector of length the number of equations. It represents the bandwidth in the estimation of trend coefficients. If NULL, it is selected by cross validation.

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.

data

A matrix or data frame containing variables in the formula.

method

A character, a matrix of dimensions neq x neq or an array of dimensions obs x neq x neq, where obs is the number of observations and neq is the number of equations. If method = identity or tvOLS (default) then the method used is a time-varying OLS. If method is a matrix (constant over time) or an array, then the tvGLS is called. If method = tvFGLS, then the covariance matrix is estimated nonparametrically and the estimation of the system is done as a whole.

Sigma

A matrix of dimensions neq x neq or an array of dimensions neq x neq x obs (neq = number of equations, obs = number of observations). It represents the covariance matrix of the error term. Only necessary for method tvGLS.

est

The nonparametric estimation method, one of "lc" (default) for linear constant or "ll" for local linear.

tkernel

A character, either "Triweight" (default), "Epa" or "Gaussian" kernel function.

bw.cov

An optional scalar. It represents the bandwidth in the "lc" nonparametric estimation of the time-varying covariance matrix. If NULL, it is selected by cross validation.

singular.ok

Logical. If FALSE, a singular model is an error.

R

An optional nrest x nvar x neq (nrest = number of restrictions, nvar = number of variables in each equation, neq = number of equations).

r

An optional vector of length the number of restrictions. By default it contains zeros.

control

list of control parameters. The default is constructed by the function tvreg.control. See the documentation of tvreg.control for details.

...

Other parameters passed to specific methods.

Value

tvSURE returns a list of the class tvsure containing the results of the whole system, results of the estimation and confidence instervals if chosen. The object of class tvsure have the following components:

coefficients

An array of dimension obs x nvar x neq (obs = number of observations, nvar = number of variables in each equation, neq = number of equations in the system) with the time-varying coefficients estimates.

Lower

If level non equal zero, an array of dimension obs x nvar x neq containing the confidence interval lower band.

Upper

If level non equal zero, an array of dimension obs x nvar x neq containing the confidence interval upper band.

Sigma

An array of dimension obs x neq x neq with the estimates of the errors covariance matrix.

fitted

The fitted values.

residuals

Estimation residuals.

x

A list with the regressors data.

y

A matrix with the dependent variable data.

z

A vector with the smoothing variable.

ez

A vector with the smoothing estimation values.

bw

Bandwidth of mean estimation.

obs

Integer specifying the number of observations in each equation (balanced sample).

neq

Integer specifying the number of equations.

nvar

Vector of integers specifying the number of variables in each equation.

method

Estimation method.

est

Nonparemtric estimation methodology.

tkernel

Kernel type.

bw.cov

Bandwidht of Sigma estimation.

level

Confidence interval range.

runs

Number of bootstrap replications.

tboot

Type of bootstrap.

BOOT

List with all bootstrap replications of coefficients, if done.

R

Restrictions matrix.

r

Restrictions vector.

formula

Initial formula.

Details

This function wraps up the kernel smoothing "tvOLS" and "tvGLS" estimators. The former is used when equations are considered independent while the later assumes that the error term is correlated amongst equations. This relation is given in matrix "Sigma" which is used in the estimation. When "Sigma" is known, the estimates are calculated via the "tvGLS", and via the "tvFGLS" when "Sigma" is unknown and must be estimated.

Bandwidth selection is of great importance in kernel smoothing methodologies and it is done automatically by cross-validation. One important aspect in the current packages is that the bandwidth is selected independently for each equation and then the average is taken to use the same bandwidth for each equation. It has been shown in Casas et al. (2017) that using different bandwidths for each equation is in general a bad practice, even for uncorrelated equations. Even though, the user may be able to use different bandwidths calling functions bw and tvGLS separatedly.

A system consists of "neq" number of equations with "obs" number of observations each and a number of variables not necessarily equal for all equations. The matrix notation is: $$Y_{t} = X_t \beta_{t}+u_{t}$$ where \(Y_t = (y_{1t}, y_{2t}, \ldots, y_{neq t})'\), \(X_t = diag (x_{1t}, x_{2t}, \ldots, x_{neq t})\) and \(\beta_{t} = \left(\beta _{1t}', \ldots, \beta _{neq t}'\right)'\) is a vector of order the total number of variables in the system. The error vector \(u_{t} = (u_{1t}, u_{2t}, \ldots, u_{neq t})'\) has zero mean and covariance matrix \(E(u_t u_t') = \Sigma_t\).

References

Casas, I., Ferreira, E., and Orbe, S. (2017) Time-Varying Coefficient Estimation in SURE Models: Application to Portfolio Management. Available at SSRN: https://ssrn.com/abstract=3043137

Chen, X. B., Gao, J., Li, D., and Silvapulle, P (2017) Nonparametric Estimation and Forecasting for Time-Varying Coefficient Realized Volatility Models. Journal of Business \& Economic Statistics, pp.1-13

Granger, C. W (2008) Non-Linear Models: Where Do We Go Next - Time Varying Parameter Models? Studies in Nonlinear Dynamics \& Econometrics, 12, pp. 1-11.

Kristensen, D (2012) Non-parametric detection and estimation of structural change. Econometrics Journal, 15, pp. 420-461.

Orbe, S., Ferreira, E., and Rodriguez-Poo, J (2004) On the estimation and testing of time varying constraints in econometric models, Statistica Sinica.

See Also

bw, tvCov, tvVAR, confint, plot, print and summary

Examples

Run this code
# NOT RUN {
data("Kmenta", package = "systemfit")
eqDemand <- consump ~ price + income
eqSupply <- consump ~ price + farmPrice + trend
system <- list(demand = eqDemand, supply = eqSupply)
eqSupply2 <- consump ~  price + farmPrice 
system2 <- list(demand = eqDemand, supply = eqSupply2)

##OLS estimation of a system
OLS <- systemfit::systemfit(system, method = "OLS", data = Kmenta)
##tvOLS estimation of a system with the local linear estimator
##removing trend because it is included in the intercept changing over time
TVOLS <- tvSURE(system2, data = Kmenta,  est = "ll")

##SUR/FGLS estimation
FGLS <- systemfit::systemfit(system, data = Kmenta, method = "SUR")
##tvSURE estimation
TVFGLS <- tvSURE(system, data = Kmenta, method = "tvFGLS")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab