Package REGARMA. R topics documented: October 1, Type Package. Title Regularized estimation of Lasso, adaptive lasso, elastic net and REGARMA

Similar documents
Package covtest. R topics documented:

Package metafuse. October 17, 2016

Package BayesNI. February 19, 2015

Package ShrinkCovMat

Package flexcwm. R topics documented: July 11, Type Package. Title Flexible Cluster-Weighted Modeling. Version 1.0.

Package flexcwm. R topics documented: July 2, Type Package. Title Flexible Cluster-Weighted Modeling. Version 1.1.

Package rarhsmm. March 20, 2018

Package ltsbase. R topics documented: February 20, 2015

Package SpatialVS. R topics documented: November 10, Title Spatial Variable Selection Version 1.1

Package jmcm. November 25, 2017

Package ARCensReg. September 11, 2016

Package darts. February 19, 2015

Package TSF. July 15, 2017

Package NonpModelCheck

Package CoxRidge. February 27, 2015

Package dlagm. January 17, 2018

Package RootsExtremaInflections

Package gsarima. February 20, 2015

Package horseshoe. November 8, 2016

Package penmsm. R topics documented: February 20, Type Package

Package survidinri. February 20, 2015

Package TimeSeries.OBeu

Package NlinTS. September 10, 2018

Package Grace. R topics documented: April 9, Type Package

Package scio. February 20, 2015

Package tspi. August 7, 2017

Package EnergyOnlineCPM

Package Blendstat. February 21, 2018

Package sym.arma. September 30, 2018

Package nardl. R topics documented: May 7, Type Package

Package rnmf. February 20, 2015

Package gma. September 19, 2017

Bayesian variable selection via. Penalized credible regions. Brian Reich, NCSU. Joint work with. Howard Bondell and Ander Wilson

Package SEMModComp. R topics documented: February 19, Type Package Title Model Comparisons for SEM Version 1.0 Date Author Roy Levy

Package factorqr. R topics documented: February 19, 2015

Package JointModel. R topics documented: June 9, Title Semiparametric Joint Models for Longitudinal and Counting Processes Version 1.

Package severity. February 20, 2015

Package basad. November 20, 2017

Package gtheory. October 30, 2016

Package icmm. October 12, 2017

Package BNN. February 2, 2018

Package TSPred. April 5, 2017

Package ForecastCombinations

Package EMVS. April 24, 2018

Package SimSCRPiecewise

Package spatial.gev.bma

Package msir. R topics documented: April 7, Type Package Version Date Title Model-Based Sliced Inverse Regression

Package rgabriel. February 20, 2015

Package mixture. R topics documented: February 13, 2018

Package multdm. May 18, 2018

Package TwoStepCLogit

Package netcoh. May 2, 2016

Package spcov. R topics documented: February 20, 2015

Package IsingFit. September 7, 2016

Package rbvs. R topics documented: August 29, Type Package Title Ranking-Based Variable Selection Version 1.0.

Package threg. August 10, 2015

Package CMC. R topics documented: February 19, 2015

Package varband. November 7, 2016

Package face. January 19, 2018

Package MultisiteMediation

Package ADPF. September 13, 2017

Package mpmcorrelogram

Package epr. November 16, 2017

Package bigtime. November 9, 2017

Package HIMA. November 8, 2017

Scenario 5: Internet Usage Solution. θ j

Package CorrMixed. R topics documented: August 4, Type Package

Package AID. R topics documented: November 10, Type Package Title Box-Cox Power Transformation Version 2.3 Date Depends R (>= 2.15.

Package DTK. February 15, Type Package

Package LIStest. February 19, 2015

Package idmtpreg. February 27, 2018

Package xdcclarge. R topics documented: July 12, Type Package

Package leiv. R topics documented: February 20, Version Type Package

Package AMA. October 27, 2010

Package mar. R topics documented: February 20, Title Multivariate AutoRegressive analysis Version Author S. M. Barbosa

STAT 436 / Lecture 16: Key

Package R1magic. August 29, 2016

Variable Selection in Restricted Linear Regression Models. Y. Tuaç 1 and O. Arslan 1

Package Tcomp. June 6, 2018

Introduction to Regression Analysis. Dr. Devlina Chatterjee 11 th August, 2017

Package anoint. July 19, 2015

Package unbalhaar. February 20, 2015

Forecasting using R. Rob J Hyndman. 2.4 Non-seasonal ARIMA models. Forecasting using R 1

Package MACAU2. R topics documented: April 8, Type Package. Title MACAU 2.0: Efficient Mixed Model Analysis of Count Data. Version 1.

Package thief. R topics documented: January 24, Version 0.3 Title Temporal Hierarchical Forecasting

Package bmem. February 15, 2013

Package LCAextend. August 29, 2013

Package WaveletArima

Package RcppSMC. March 18, 2018

Empirical Market Microstructure Analysis (EMMA)

Package mbvs. August 28, 2018

Package semgof. February 20, 2015

Package LBLGXE. R topics documented: July 20, Type Package

Package flora. R topics documented: August 29, Type Package. Title flora: taxonomical information on flowering species that occur in Brazil

Package scpdsi. November 18, 2018

Package CopulaRegression

Package wnl. April 2, 2018

Package rela. R topics documented: February 20, Version 4.1 Date Title Item Analysis Package with Standard Errors

Package mctest. February 26, 2018

Package clogitboost. R topics documented: December 21, 2015

Transcription:

Package REGARMA October 1, 2014 Type Package Title Regularized estimation of Lasso, adaptive lasso, elastic net and REGARMA Version 0.1.1.1 Date 2014-10-01 Depends R(>= 2.10.0) Imports tseries, msgps Author Hamed Haselimashhadi (www.hamedhaseli.webs.com) Maintainer Hamed Haseli <hamed.haselimashhadi@brunel.ac.uk>, <hamedhaseli@gmail.com> This package estimates Lasso, adaptive Lasso, elastic net and REGARMA regression using AIC, BIC and GCV. License GPL (>= 2) LazyLoad no Repository CRAN Date/Publication 2014-10-01 11:21:29 NeedsCompilation yes R topics documented: REGARMA-package.................................... 2 generatear......................................... 2 naics5809.......................................... 3 regarma.......................................... 4 sim.regarma....................................... 6 Index 8 1

2 generatear REGARMA-package Regularized estimation of a REGARMA model. Details This packages provides functions to fit an autoregressive moving average model with time-dependent predictors (REGARMA) using a penalised likelihood approach under AIC, BIC or GCV model selection criteria. Package: REGARMA Type: Package Version: 0.2-5 Date: 2014-01-15 License: GPL2 or newer LazyLoad: yes Author(s) Hamed Haselimashhadi <hamed.haselimashhadi@brunel.ac.uk>, Veronica Vinciotti <veronica.vinciotti@brunel.ac.uk> R. Tibshirani (1996), "Regression shrinkage and selection via the lasso", Journal of the Royal Statistical Society. Series B, 267-288. H. Wang, G. Li, C. Tsai (2007), "Regression coefficient and autoregressive order shrinkage and selection via the lasso", Journal of the Royal Statistical Society. Series B, 69, 63-78. H. Zou (2006), "The adaptive lasso and its oracle properties", Journal of the American statistical association, 476, 1418-1429. Haselimashhadi, H. and Vinciotti, V. (2014) Penalised estimation of autoregressive moving average models with time-dependent predictors. Submitted. generatear A function to generate autoregressive coefficients A function to generate autoregressive coefficients in a certain interval and with a mimum distance amongst any two coefficients. Usage generatear(n = 1, l = -1, u = 1, min.distance =.Machine$double.eps)

naics5809 3 Arguments n l u min.distance The number of coefficients Lower bound of coefficients Upper bound of coefficients Minimum distance among each two coefficients Author(s) Hamed Haselimashhadi <hamed.haselimashhadi@brunel.ac.uk> Haselimashhadi, H. and Vinciotti, V. (2014) Penalised estimation of autoregressive moving average models with time-dependent predictors (Working Paper). Brunel University London, UK See Also regarma Examples generatear(5,-1,1,.01) naics5809 NBER-CES Manufacturing Industry Database(1958-2009) Usage Format This database is a joint effort between the National Bureau of Economic Research (NBER) and U.S. Census Bureau s Center for Economic Studies (CES), containing annual industry-level data from 1958-2009 on output, employment, payroll and other input costs, investment, capital stocks, TFP, and various industry-specific price indexes. data(naics5809) A data frame with 23868 observations on the following 24 variables. sic : NAICS 4-digit Codes year : Year ranges from 1958 to 2009 emp : Total employment in 1000s pay : Total payroll in $1m prode : Production workers in 1000s prodh : Production worker hours in 1m prodw : Production worker wages in $1m vship : Total value of shipments in $1m

4 regarma matcost : Total cost of materials in $1m vadd : Total value added in $1m invest : Total capital expenditure in $1m invent : End-of-year inventories in $1m energy : Cost of electricity & fuels in $1m cap : Total real capital stock in $1m equip : Real capital: equipment in $1m plant : Real capital: structures in $1m piship : Deflator for VSHIP 1997=1.000 pimat : Deflator for MATCOST 1997=1.000 piinv : Deflator for INVEST 1997=1.000 pien : Deflator for ENERGY 1997=1.000 dtfp5 : 5-factor TFP annual growth rate tfp5 : 5-factor TFP index 1997=1.000 dtfp4 : 4-factor TFP annual growth rate tfp4 : 4-factor TFP index 1997=1.000 Source http://www.nber.org/nberces/ Official website: http://www.nber.org/data/nberces5809.html Variable description and summary statistics: http://www.nber.org/nberces/nberces5809/nberces_ 5809_summary_stats.pdf Updated documentation: http://www.nber.org/nberces/nberces5809/nberces_5809_technical_ notes.pdf Examples data(naics5809) str(naics5809) regarma A function for penalised estimation of a REGARMA model from timeseries regression data. This function estimates the parameters of a REGARMA model using lasso and adaptive lasso penalties for a given dataset with or without replications. It also selects the optimal model using AIC, BIC and GCV.

regarma 5 Usage regarma(data, ar = 0, ma = 0, method = c("alasso"), mselection = "BIC", alpha = 0, Ndf = 0, Sdf = 0, normalize = FALSE, auto.order = FALSE, debug = FALSE) Arguments data ar ma method mselection alpha Ndf Sdf normalize auto.order debug Raw data of the form of a matrix. The first column should contain ids of replications. Note that the points belonging to each replication id must be sorted with respect to time. The second column should contain the response variable (y), the remaining columns should contain the predictors (x). In the case of no replication, the first column should be simply 1:T, with T the number of time points. AR order of model MA order of model Type of penalties. Choose between elastic net (enet) and adaptive lasso (alasso). Note that lasso can be computed by choosing enet for method and setting alpha equals to zero. Model selection criteria. Choose between AIC, BIC and GCV for the selection of the tuning parameters. Weight in elastic net. Degree of differencing if necessary Degree of seasonal differencing if necessary Set to TRUE in order to normalize the data to mean zero and unit variance If TRUE, the optimal orders of the model are chosen according to AIC (if mselection="aic") or BIC (if mselection="bic" or "GCV"). To see a detailed report of process set this parameter to TRUE. Details More details about the parameter estimation approach are given in Haselimashhadi and Vinciotti (2014). Author(s) Hamed Haselimashhadi <hamed.haselimashhadi@brunel.ac.uk> Haselimashhadi, H. and Vinciotti, V. (2014) Penalised estimation of autoregressive moving average models with time-dependent predictors (Working Paper). Brunel University London, UK See Also sim.regarma

6 sim.regarma Examples # --------------- FIRST EXAMPLE: regarma without replications ----------------# # True regression coefficients beta=c(1:6,rep(0,200)) # Simulating data (100 time points) simdata=sim.regarma(n=100,beta=beta,phi=generatear(2,min.distance =.3),theta=generateAR(1), x.independent=true,var.error=.1) #Fitting a REGARMA(2,1) model regarma.fit=regarma(data = simdata$rawdata,ar = 2,ma = 1,method = 'alasso', mselection = 'BIC') #Printing true and estimated coefficients cat('coefficients:',beta[1:6],',0,..., ',0) print(round(as.vector(regarma.fit$betas),2)) print('-------------- OUTPUT structure --------------') str(regarma.fit) cat ("Press [enter] to see the second example");line <- readline() # ----------------------- SECOND EXAMPLE: regarma with replications ------------------------# data(naics5809) R=10;dif1=2;dif2=0;ar=2;ma=1 # Select the first 10 ids. 52 time points are available for each id # Note that naics5809 contains two response variables namely, emp and pay. The analysis below considers pay fo # Data are sorted for each id (based on time). data=as.matrix(naics5809)[1:(52*r),-(2:3)] data[is.na(data)==true]=0 # ----------------------- Fitting model ------------------------# regarma.fit=regarma(data=data,ar=ar,ma=ma,method='alasso',ndf=dif1,sdf=dif2) # ----------------------- Printing outputs ------------------------# print('-------------- OUTPUT structure --------------') str(regarma.fit) sim.regarma A function to simulate data from a REGARMA model This function simulates a Gaussian lagged regression variable in the presence of autocorrelation among residuals (REGARMA) Usage sim.regarma(n = 5, beta = c(0.62), x.independent = TRUE, phi = c(0.3), theta = c(0.5), var.error = 1, draw.plot = FALSE)

sim.regarma 7 Arguments n beta x.independent phi theta var.error draw.plot The number of datapoints to be simulated Regression coefficients * Note that coefficients must be in [-1,1] for time-series data (x.independent=false). Set this option to true if regression variables are assumed to be independent Autoregressive coefficients * Note that, for stationarity, all roots of the polynomial must site outside of a unit circle Residuals coefficients * Note that, for stationarity, all roots of the polynomial include coefficients must site outside of a unit circle Variance of the process If TRUE, a time series plot is drawn Author(s) Hamed Haselimashhadi <hamed.haselimashhadi@brunel.ac.u> Haselimashhadi, H. and Vinciotti, V. (2014) Penalised estimation of autoregressive moving average models with time-dependent predictors (Working Paper). Brunel University London, UK See Also regarma Examples simdata=sim.regarma(n = 100,beta =.1,x.independent = TRUE,phi =.4, theta = -.4,var.error = 1,draw.plot = TRUE) str(simdata)

Index Topic \textasciitildekwd1 generatear, 2 regarma, 4 sim.regarma, 6 Topic \textasciitildekwd2 generatear, 2 regarma, 4 sim.regarma, 6 Topic datasets naics5809, 3 Topic package REGARMA-package, 2 generatear, 2 naics5809, 3 REGARMA (REGARMA-package), 2 regarma, 3, 4, 7 REGARMA-package, 2 sim.regarma, 5, 6 8