Breg: Regularize Bayesian predictive regression

Description Usage Arguments Value References See Also Examples

View source: R/Breg.R

Description

Given regularization parameters, this function uses an iterative method to estimate the VAR(1) model,

X_t = β X_{t-1} + ε_t

where all eigenvalues of β are smaller than one in modulus. The noise vector is assumed to be multivariate normally distributed with mean 0 and covariance Σ.

or SUR model

y_i = X^T β_{i} + ε_{i}

where y_i is N \times 1, β_i is K \times 1 and ε_i is N \times 1; X^T is the design matrix. i = 1,2, ..., m.

Usage

1
Breg(x,y=NULL,lambda,gamma,alpha=1,type = "var",tol=10^-7,Time=10,r=10^-14,step.size=10^3)

Arguments

x

For type = "var", an N \times K matrix containing observations of the VAR(1) model;

For type = "sur", an N \times K design matrix.

y

For type = "var", NULL;

For type = "sur", an N \times M response matrix.

lambda

Regularization parameter for β estimation. Must be a nonnegative scalar.

gamma

Regularization parameter for Σ estiamtion. Must be a nonnegative scalar. The penalty is defined as ||P*Σ||_1 where P is a K \times K matrix of all 1 and with 0 on the diagonal to ensure the positive-definiteness.

alpha

Elastic-net mixing parameter as in glmnet, with 0 ≤ α ≤ 1. The coefficient penalty is defined as

λ*\{(1-α)/2||β||_2^2+α||β||_1\}.

alpha=1 is the lasso penalty, and alpha=0 is the ridge penalty.

type

Model type: "var"(default), "sur".

tol

Convergence threshold for the iterative estimation. The convergence criteria is defined as

||β^{(i)}-β^{(i-1)}||_m ≤ tol

||Σ^{(i)}-Σ^{(i-1)}||_m ≤ tol

where 'm' denotes the maximum modulus of all the elements.

Time

Maximum number of iterations.

r

Condition number threshold when check if correlation matrix is singular.

step.size

Parameter used in spcov.

Value

beta

The estimate of coefficients.

For type = "var", an K \times K matrix;

For type = "sur", a vector of length K*M.

sigma

The estimate of noise variance matrix.

For type = "var", an K \times K matrix.

For type = "sur", an M \times M matrix.

References

Guanhao Feng and Nicholas G. Polson (2016), Regularizing Bayesian Predictive Regressions. https://arxiv.org/abs/1606.01701

See Also

glmnet,spcov

Examples

1
2
3
4
5
6
7
8
9
## simulating data
beta <- matrix(c(0.9,-0.1,-0.1,0.8),2,2)
x <- t(rep(0,2))
for (i in 1:1000)
  x<-rbind(x,t(beta%*%x[i,])+rnorm(2))
x <- x[-1,]

## estimating the model
Breg(x,lambd=0,gamma=0,alpha=1,tol=10^-3,Time=30)

Jianeng/FinReg documentation built on May 14, 2019, 8:41 a.m.