Package StVAR. February 11, 2017

Similar documents
Package endogenous. October 29, 2016

Package mvprobit. November 2, 2015

Package palmtree. January 16, 2018

Package intccr. September 12, 2017

Package SSLASSO. August 28, 2018

Package DBfit. October 25, 2018

Package SPIn. R topics documented: February 19, Type Package

Package lgarch. September 15, 2015

Package sfadv. June 19, 2017

Package BayesCR. September 11, 2017

Package DPBBM. September 29, 2016

Package MultiRR. October 21, 2015

Package GLDreg. February 28, 2017

Package PSTR. September 25, 2017

Package truncreg. R topics documented: August 3, 2016

Package mtsdi. January 23, 2018

Package sfa. R topics documented: February 20, 2015

Package Bergm. R topics documented: September 25, Type Package

Package MSwM. R topics documented: February 19, Type Package Title Fitting Markov Switching Models Version 1.

Package rngsetseed. February 20, 2015

Package gpr. February 20, 2015

Package glmmml. R topics documented: March 25, Encoding UTF-8 Version Date Title Generalized Linear Models with Clustering

Package dirmcmc. R topics documented: February 27, 2017

Package robustreg. R topics documented: April 27, Version Date Title Robust Regression Functions

Package ridge. R topics documented: February 15, Title Ridge Regression with automatic selection of the penalty parameter. Version 2.

Package RLRsim. November 4, 2016

Package biglars. February 19, 2015

Package dkdna. June 1, Description Compute diffusion kernels on DNA polymorphisms, including SNP and bi-allelic genotypes.

Package cwm. R topics documented: February 19, 2015

Package swcrtdesign. February 12, 2018

Package pnmtrem. February 20, Index 9

Package mcemglm. November 29, 2015

Package TANDEM. R topics documented: June 15, Type Package

Package psda. September 5, 2017

Package robustgam. February 20, 2015

Package CompGLM. April 29, 2018

Package sparsereg. R topics documented: March 10, Type Package

Package rpst. June 6, 2017

Package GenSA. R topics documented: January 17, Type Package Title Generalized Simulated Annealing Version 1.1.

Package binomlogit. February 19, 2015

Package svapls. February 20, 2015

Package oaxaca. January 3, Index 11

Package samplingdatacrt

Package influence.sem

Package ihs. February 25, 2015

Package ConvergenceClubs

Package lclgwas. February 21, Type Package

Package sglr. February 20, 2015

Package CatEncoders. March 8, 2017

Fathom Dynamic Data TM Version 2 Specifications

Package Combine. R topics documented: September 4, Type Package Title Game-Theoretic Probability Combination Version 1.

Package flsa. February 19, 2015

CSSS 510: Lab 2. Introduction to Maximum Likelihood Estimation

Package BigVAR. R topics documented: April 3, Type Package

Standard Errors in OLS Luke Sonnet

Package REndo. November 8, 2017

Package assortnet. January 18, 2016

Package SoftClustering

Package bdots. March 12, 2018

Package merror. November 3, 2015

Package MIICD. May 27, 2017

Package svalues. July 15, 2018

Package LINselect. June 9, 2018

Package acebayes. R topics documented: November 21, Type Package

Package lhs. R topics documented: January 4, 2018

Package spatialtaildep

Package libstabler. June 1, 2017

Package dglm. August 24, 2016

Package autovarcore. June 4, 2018

Package flexcwm. May 20, 2018

Package bayeslongitudinal

Package OrthoPanels. November 11, 2016

Package GWRM. R topics documented: July 31, Type Package

Package ruv. March 12, 2018

Package ArCo. November 5, 2017

Package StagedChoiceSplineMix

Package mlvar. August 26, 2018

Package SAENET. June 4, 2015

Package esabcv. May 29, 2015

Package diagis. January 25, 2018

Analysis of Panel Data. Third Edition. Cheng Hsiao University of Southern California CAMBRIDGE UNIVERSITY PRESS

Package SeleMix. R topics documented: November 22, 2016

Package abe. October 30, 2017

Package coxsei. February 24, 2015

Package RAMP. May 25, 2017

2 cubist.default. Fit a Cubist model

Package logitnorm. R topics documented: February 20, 2015

Package robustgam. January 7, 2013

Package LVGP. November 14, 2018

Package TVsMiss. April 5, 2018

Package ParetoPosStable

Package Numero. November 24, 2018

Package oglmx. R topics documented: May 5, Type Package

Package mrm. December 27, 2016

Package desirability

Package longclust. March 18, 2018

Package simsurv. May 18, 2018

Package OutlierDC. R topics documented: February 19, 2015

Package survivalmpl. December 11, 2017

Package freeknotsplines

Transcription:

Type Package Title Student's t Vector Autoregression (StVAR) Version 1.1 Date 2017-02-10 Author Niraj Poudyal Maintainer Niraj Poudyal <nirajp6@vt.edu> Package StVAR February 11, 2017 Description Estimation of multivariate Student's t dynamic regression models for a given degrees of freedom and lag length. Users can also specify the trends and dummies of any kind in matrix form. Imports ADGofTest,numDeriv, MCMCpack, matlab License GPL-2 NeedsCompilation no Repository CRAN Date/Publication 2017-02-11 17:43:11 R topics documented: StAR............................................ 1 StDLRM.......................................... 4 StVAR............................................ 6 Index 9 StAR Student s t Autoregression (StAR) Description Maximum likelihood estimation of StAR model is the purpose of this function. It can be used to estimate the linear autoregressive function (conditional mean) and the quadratic autosckedastic function (conditional variance). Users can specify the model with deterministic variables such as trends and dummies in matrix form. 1

2 StAR Usage StAR(Data, Trend=1, lag=1, v=1, maxiter=1000, meth="bfgs", ="FALSE", ="na") Arguments Data Trend lag v A data vector with one column. Cannot be empty. A matrix with columns representing deterministic variables like trends and dummies. If 1 (default), model with only constant intercept is estimated. If 0, the model is estimated without an intercept term. A positive integer (default value is 1) as lag length. A scalar (default value is 1) greater than or equal to 1. Degrees of freedom parameter. maxiter Maximum number of iteration. Must be an integer bigger than 10. meth Details One of the optimization method from optim function (default value is BFGS). See details of optim function. Logical (default value is FALSE). If TRUE produces estimated sian matrix and the standard errors of estimates. If na (default), ial values for optimization are generated from a uniform distribution. A vector of ial values can also be used (not recommended). The length of the vector must be equal to the number of parameters of the joint distribution. For the functional form of the autoregressive function and the autoskedastic function, see Spanos (1994) and Poudyal (2012). Value beta coef var.coef like sigma cvar trend res fitted coefficients of the autoregressive function including the coefficients of trends in matrix form. coefficients of the autoregressive function, standard errors and p-values if =TRUE. If some of the standard errors are NA s, the StVAR() function has to be run again. coefficients of the autoregressive function, standard errors and p-values if =TRUE. maximum log likelihood value. contemporary variance covariance matrix. (v/(v+lag*l-2))*sigma*cvar is the fitted value of the autoskedastic function where l is the rank of Data estimated trend in the variables. nonstandardized residuals fitted values of the autoregressive function. estimates of the joint distribution parameters. It can be used as new ial value in StVAR() to improve optimization further.

StAR 3 S ad estimated sian matrix. variance covariance matrix of the joint distribution. Anderson-Darling test for Student s t distribution. Author(s) Niraj Poudyal <nirajp6@vt.edu> References Poudyal, N. (2012), Confronting Theory with Data: the Case of DSGE Modeling. Doctoral dissertation, Virginia Tech. Spanos, A. (1994), On Modeling Heteroskedasticity: the Student s t and Elliptical Linear Regression Models. Econometric Theory, 10: 286-315. Examples ## StAR Model##### ## Random number seed set.seed(4093) ## Creating trend variable. t <- seq(1,100,1) # Generating data on y and x. y <- 0.004 + 0.0045*t - 0.09*t^2 + 0.001*t^3 + 50*rt(100,df=5) # The trend matrix Trend <- cbind(1,poly(t,3,raw=true)) # Estimating the model star <- StAR(y,lag=1,Trend=Trend,v=5,maxiter=2000) # Generate arbitrary dates dates <- seq(as.date("2014/1/1"), as.date("2016/1/1"), "weeks") ## Plotting the variable y, its estimated trend and the fitted value. d <- dates[2:length(y)] ; Y <- cbind(y[2:length(y)],star$fitted,star$trend) color <- c("black","blue","black") ; legend <- c("data","trend","fitted values") cvar <- cbind(star$cvar) par(mfcol=c(3,1)) matplot(d,y,xlab="months",type='l',lty=c(1,2,3),lwd=c(1,1,3),col=color,ylab="",xaxt="n") axis.date(1,at=seq(as.date("2014/1/1"), as.date("2016/1/1"),"months"),labels=true) legend("bottomleft",legend=legend,lty=c(1,2,3),lwd=c(1,1,3), col=color,cex=.85) hist(star$res,main="residuals",xlab="",ylab="frequency") ## Histogram of y matplot(d,cvar,xlab="months",type='l',lty=2,lwd=1,ylab="fitted variance",xaxt="n") axis.date(1,at=seq(as.date("2014/1/1"), as.date("2016/1/1"),"months"),labels=true)

4 StDLRM StDLRM Student s t Dynamic Linear Regression Model (StDLRM) Description Usage Maximum likelihood estimation of StDLRM model is the purpose of this function. It can be used to estimate the dynamc linear autoregressive function (conditional mean) and the quadratic autosckedastic function (conditional variance). Users can specify the model with deterministic variables such as trends and dummies in the matrix form. StDLRM(y, X, Trend=1, lag=1, v=1, maxiter=1000, meth="bfgs", ="FALSE", ="na") Arguments y X Trend lag v A vector representing dependent variable. Cannot be empty. A data matrix whose columns represent exogeneous variables. Cannot be empty. A matrix with columns representing deterministic variables like trends and dummies. If 1 (default), model with only constant intercept is estimated. If 0, the model is estimated without an intercept term. A positive integer (default value is 1) as lag length. A scalar (default value is 1) greater than or equal to 1. Degrees of freedom parameter. maxiter Maximum number of iteration. Must be an integer bigger than 10. meth Details Value One of the optimization method from optim function (default value is BFGS). See details of optim function. Logical (default value is FALSE). If TRUE produces estimated sian matrix and the standard errors of estimates. If na (default), ial values for optimization are generated from a uniform distribution. A vector of ial values can also be used (not recommended). The length of the vector must be equal to the number of parameters of the joint distribution. For the functional form of the autoregressive function and the autoskedastic function, see Spanos (1994) and Poudyal (2012). beta coef coefficients of the autoregressive function including the coefficients of trends in matrix form. coefficients of the autoregressive function, standard errors and p-values if =TRUE. If some of the standard errors are NA s, the StVAR() function has to be run again.

StDLRM 5 var.coef like sigma cvar coefficients of the autoskedastic function, standard errors and p-values if if =TRUE maximum log likelihood value. contemporary variance covariance matrix. (v/(v+lag*l-2))*sigma*cvar is the fitted value of the autoskedastic function where l is the rank of Data trend estimated trend in the variable y. res fitted S ad Author(s) nonstandardized residuals Niraj Poudyal <nirajp6@vt.edu> References fitted values of the autoregressive function. estimates of the joint distribution parameters. It can be used as new ial value in StVAR() to improve optimization further. variance covariance matrix of the joint distribution. Anderson-Darling test for Student s t distribution. Poudyal, N. (2012), Confronting Theory with Data: the Case of DSGE Modeling. Doctoral dissertation, Virginia Tech. Spanos, A. (1994), On Modeling Heteroskedasticity: the Student s t and Elliptical Linear Regression Models. Econometric Theory, 10: 286-315. Examples ## StDLRM Model##### ## Random number seed set.seed(7504) ## Creating trend variable. t <- seq(1,100,1) # Generating data on y and x. y <- 0.004 + 0.0045*t - 0.09*t^2 + 0.001*t^3 + 50*rt(100,df=5) x <- 0.05-0.005*t + 0.09*t^2-0.001*t^3 + 50*rt(100,df=5) z <- 0.08-0.006*t + 0.08*t^2-0.001*t^3 + 50*rt(100,df=5) # The trend matrix Trend <- cbind(1,poly(t,3,raw=true)) # Estimating the model stdlrm <- StDLRM(y,cbind(x,z),lag=1,Trend=Trend,v=5,maxiter=2000) # Generate arbitrary dates dates <- seq(as.date("2014/1/1"), as.date("2016/1/1"), "weeks") ## Plotting the variable y, its estimated trend and the fitted value.

6 StVAR d <- dates[2:length(y)] ; Y <- cbind(y[2:length(y)],stdlrm$fit,stdlrm$trend) color <- c("black","blue","black") ; legend <- c("data","trend","fitted values") cvar <- cbind(stdlrm$cvar) par(mfcol=c(3,1)) matplot(d,y,xlab="months",type='l',lty=c(1,2,3),lwd=c(1,1,3),col=color,ylab=" ",xaxt="n") axis.date(1,at=seq(as.date("2014/1/1"), as.date("2016/1/1"),"months"),labels=true) legend("bottomleft",legend=legend,lty=c(1,2,3),lwd=c(1,1,3),col=color,cex=.85) hist(stdlrm$res,main="residuals",xlab="",ylab="frequency") ## Histogram of y matplot(d,cvar,xlab="months",type='l',lty=2,lwd=1,ylab="fitted variance",xaxt="n") axis.date(1,at=seq(as.date("2014/1/1"),as.date("2016/1/1"),"months"),labels=true) StVAR Student s t Vector Autoregression (StVAR) Description Maximum likelihood estimation of StVAR model is the purpose of this function. It can be used to estimate the linear autoregressive function (conditional mean) and the quadratic autosckedastic function (conditional variance). Users can specify the model with deterministic variables such as trends and dummies in the matrix form. Usage StVAR(Data, Trend=1, lag=1, v=1, maxiter=1000, meth="bfgs", ="FALSE", ="na") Arguments Data Trend lag v A data matrix with at least two columns. Cannot be empty. A matrix with columns representing deterministic variables like trends and dummies. If 1 (default), model with only constant intercept is estimated. If 0, the model is estimated without the intercept term. A positive integer (default value is 1) as lag length. A scalar (default value is 1) greater than or equal to 1. Degrees of freedom parameter. maxiter Maximum number of iteration. Must be an integer bigger than 10. meth One of the optimization method from optim function (default value is BFGS). See details of optim function. Logical (default value is FALSE). If TRUE produces estimated sian matrix and the standard errors of estimates. If na (default), ial values for optimization are generated from a uniform distribution. A vector of ial values can also be used (not recommended). The length of the vector must be equal to the number of parameters of the joint distribution.

StVAR 7 Details Value For the functional form of the autoregressive function and the autoskedastic function, see Spanos (1994) and Poudyal (2012). beta coef var.coef like sigma cvar trends res fitted S ad coefficients of the autoregressive function including the coefficients of trends in matrix form. coefficients of the autoregressive function, standard errors and p-values. If some of the standard errors are NA s, the StVAR() function has to be run again. coefficients of the autoskedastic (conditional variance) function, standard errors and p-values. maximum log likelihood value. contemporary variance-covariance matrix. (v/(v+lag*l-2))*sigma*cvar is the fitted value of the autoskedastic function where l is the rank of Data estimated trends in the variables. nonstandardized residuals fitted values of the autoregressive function. estimates of the joint distribution parameters. It can be used as new ial value in StVAR() to improve optimization further. the estiamted sian matrix if =TRUE. variance covariance matrix of the joint distribution. Anderson-Darling test for Student s t distribution. Author(s) Niraj Poudyal <nirajp6@vt.edu> References Poudyal, N. (2012), Confronting Theory with Data: the Case of DSGE Modeling. Doctoral dissertation, Virginia Tech. Spanos, A. (1994), On Modeling Heteroskedasticity: the Student s t and Elliptical Linear Regression Models. Econometric Theory, 10: 286-315. Examples ## StVAR Model##### ## Random number seed set.seed(7504) ## Creating trend variable. t <- seq(1,100,1)

8 StVAR # Generating data on y and x. y <- 0.004 + 0.0045*t - 0.09*t^2 + 0.001*t^3 + 50*rt(100,df=5) x <- 0.05-0.005*t + 0.09*t^2-0.001*t^3 + 50*rt(100,df=5) # The trend matrix Trend <- cbind(1,poly(t,3,raw=true)) # Estimating the model stvar <- StVAR(cbind(y,x),lag=1,Trend=Trend,v=5,maxiter=2000) # Generate arbitrary dates dates <- seq(as.date("2014/1/1"), as.date("2016/1/1"), "weeks") ## Plotting the variable y, its estimated trend and the fitted value. d <- dates[2:length(y)]; Y <- cbind(y[2:length(y)],stvar$fit[,1],stvar$trend[,1]) color <- c("black","blue","black") ; legend <- c("data","trend","fitted values") cvar <- cbind(stvar$cvar) par(mfcol=c(3,1)) matplot(d,y,xlab="months",type='l',lty=c(1,2,3),lwd=c(1,1,3),col=color,ylab=" ",xaxt="n") axis.date(1,at=seq(as.date("2014/1/1"), as.date("2016/1/1"),"months"),labels=true) legend("bottomleft",legend=legend,lty=c(1,2,3),lwd=c(1,1,3), col=color,cex=.85) hist(stvar$res[,1],main="residuals",xlab="",ylab="frequency") ## Histogram of y matplot(d,cvar,xlab="months",type='l',lty=2,lwd=1,ylab="fitted variance",xaxt="n") axis.date(1,at=seq(as.date("2014/1/1"),as.date("2016/1/1"),"months"),labels=true)

Index StAR, 1 StDLRM, 4 StVAR, 6 9