path.Breg: Regularizaiton path of Bayesian predictive regression

Description Usage Arguments Details Value See Also Examples

Description

This functions computes the Bayesian regularization path for coefficient, prediction, correlation and 1-step ahead impulse, given a sequence of lambda or gamma.

Usage

1
path(x,y=NULL,lambda,gamma,r.type = "var",p.type = "coef",alpha=1,Time=5)

Arguments

x

For r.type = "var", an N \times K matrix conataining observations of VAR(1).

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

y

For r.type = "var", NULL;

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

r.type

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

p.type

Path type: "coef"(default), "pred", "corr", "impul".

lambda

See Breg.

gamma

See Breg.

alpha

See Breg.

Time

See Breg.

Details

Only one of lambda and gamma can be an increasing sequence and another one is a non-negative scalar (typical 0).

For p.type = "coef","pred", lambda is a sequence.

For p.type = "corr","impul", gamma is a sequence.

Value

path

A vector/matrix/array of regularization result. The first dimension size equals to the length of parameter sequence.

See Also

Breg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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,]

## set the regularization parameter lambda
lambda = seq(0,0.1,by=0.01)

## compute regularization path
path(x=x,gamma=0,lambda=lambda,p.type="pred",r.type="var")

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