| Type: | Package |
| Title: | Generalized Autoregressive Score Models |
| Version: | 0.3.4.1 |
| Description: | Simulate, estimate and forecast using univariate and multivariate GAS models as described in Ardia et al. (2019) <doi:10.18637/jss.v088.i06>. |
| License: | GPL-3 |
| BugReports: | https://github.com/LeopoldoCatania/GAS/issues |
| URL: | https://github.com/LeopoldoCatania/GAS |
| LazyData: | TRUE |
| Imports: | Rcpp (≥ 0.12.2), Rsolnp, MASS, xts, numDeriv, zoo, cubature |
| LinkingTo: | Rcpp, RcppArmadillo |
| Depends: | R (≥ 3.4.0), methods |
| Suggests: | testthat |
| NeedsCompilation: | yes |
| Packaged: | 2024-08-19 08:41:50 UTC; hornik |
| Repository: | CRAN |
| Date/Publication: | 2024-08-19 09:00:52 UTC |
| Author: | Leopoldo Catania |
| Maintainer: | Leopoldo Catania <leopoldo.catania@econ.au.dk> |
Generalized Autoregressive Score models in R
Description
The GAS package allows us to simulate, estimate and forecast using univariate and multivariate GeneralizedAutoregressive Score (GAS) models (also known as Dynamic Conditional Score (DCS) models),see e.g., Creal et. al. (2013) and Harvey (2013). A detailed implementation of the package functionalities are reported in Ardia et. al. (2018, 2019).
Details
The authors acknowledge Google for financial support via the Google Summer ofCode 2016 project "GAS"; seehttps://summerofcode.withgoogle.com/archive/2016/projects/4537082387103744/.
Current limitations:
The multivariate GAS model for N>4 does not report the exact update for thecorrelation parameters since the Jacobian of the hyperspherical coordinates transformationneeds to be coded for the case N>4. The Jacobian for N>4 is replaced by the identity matrix.
Note
By usingGAS you agree to the following rules:
You must cite Ardia et al. (2019) in working papers and published papers that use
GAS. Usecitation("GAS").You must place the following URL in a footnote to help others find
GAS:https://CRAN.R-project.org/package=GAS.You assume all risk for the use of
GAS.
Author(s)
Leopoldo Catania [aut,cre], Kris Boudt [ctb], David Ardia [ctb]
Maintainer: Leopoldo Catania <leopoldo.catania@econ.au.dk>
References
Ardia D, Boudt K and Catania L (2018)."Downside Risk Evaluation with the R Package GAS."R Journal, 10(2), 410-421.doi:10.32614/RJ-2018-064.
Ardia D, Boudt K and Catania L (2019)."Generalized Autoregressive Score Models in R: The GAS Package."Journal of Statistical Software, 88(6), 1-28.doi:10.18637/jss.v088.i06.
Creal D, Koopman SJ, Lucas A (2013)."Generalized Autoregressive Score Models with Applications."Journal of Applied Econometrics, 28(5), 777-795.doi:10.1002/jae.1279.
Harvey AC (2013).Dynamic Models for Volatility and Heavy Tails: With Applications toFinancial and Economic Time Series.Cambridge University Press.
Backtest a series of one-step ahead density predictions.
Description
TheBacktestDensity() function accepts an object of the classuGASRoll, and returns alist withtwo elements: (i) the averages Negative Log Score (NLS) and weighted Continuous Ranked Probability Score (wCRPS)introduced by Gneiting and Ranjan (2012), and (ii) their values at each point in time. The wCRPS isevaluated using 5 weight functions, see Details.
Usage
BacktestDensity(Roll, lower, upper, K = 1000, a = NULL, b = NULL)Arguments
Roll | an object of the classuGASRoll. |
lower |
|
upper |
|
K |
|
a |
|
b |
|
Details
The average Negative Log Score (NLS) is computed as the negative of the average of the log scores evaluatedduring the out-of-sample period. The average weighted Continuous Ranked Probability Score (wCRPS) is computed asthe average of the wCRPS evaluated during the out-of-sample period, see Gneiting and Ranjan (2012).
The wCRPS is evaluated using Equation 16 of Gneiting and Ranjan (2012). The weights functions implemented are:
w(z) = 1: Uniform,w(z) = \phi_{a,b}(z): Center,w(z) = 1 - \phi_{a,b}(z): Tails,w(z) = \Phi_{a,b}(z): Right tail,w(z) = 1 - \Phi_{a,b}(z): Left tail,
where\phi_{a,b}(z) and\Phi_{a,b}(z) are the pdf and cdf of a Gaussian distribution with meanaand standard deviationb, respectively. The label "Uniform" represents the case where equalemphasis is given to all the parts of the distribution.
Value
Alist with elements:average,series. The element "average" is a named vectorwith the averages NLS and wCRSP. The element "series" is alist: the fist element,LS, containsthe out-of-sample Log Score (not with the negative sign), the second element,WCRPS, contains amatrixwith the wCRPS series. The columns of this matrix are named: "uniform", "center", "tails","tail_r", "tail_l", which are associated with the wCRSP with emphasis on: Uniform, Center, Tails,Right tail and Left tail, respectively.
Author(s)
Leopoldo Catania
References
Gneiting T, Ranjan R (2011)."Comparing Density Forecasts using Threshold -and Quantile-Weighted Scoring Rules."Journal of Business & Economic Statistics, 29(3), 411-422.doi:10.1198/jbes.2010.08110.
Examples
## Not run: data("cpichg")GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity", GASPar = list(location = TRUE, scale = TRUE, shape = FALSE))Roll = UniGASRoll(cpichg, GASSpec, ForecastLength = 50, RefitEvery = 10, RefitWindow = c("moving"))BackTest = BacktestDensity(Roll, lower = -100, upper = 100)BackTest$average## End(Not run)Backtest Value at Risk (VaR)
Description
This function implements several backtesting procedures for the Value at Risk (VaR). These are: (i) The statisticaltests of Kupiec (1995), Christoffesen (1998) and Engle and Manganelli (2004), (ii) The tick loss functiondetailed in Gonzalez-Rivera et al. (2004), the mean and max absolute loss used by McAleer and DaVeiga (2008) and the actual over expected exceedance ratio.
Usage
BacktestVaR(data, VaR, alpha, Lags = 4)Arguments
data |
|
VaR |
|
alpha |
|
Lags |
|
Details
This function implements several backtesting procedure for the Value at Risk.The implemented statistical tests are:
LRucThe unconditional coverage test of Kupiec (1995).LRccThe conditional coverage test of Christoffesen (1998).DQThe Dynamic Quantile test of Engle and Manganelli (2004).
The implemented VaR backtesting quantities are:
ADmean and maximum absolute deviation between the observations and the quantiles as in McAleer and Da Veiga (2008).LossAverage quantile loss and quantile loss series as in Gonzalez-Rivera et al. (2004).AEActual over Expected exceedance ratio.
Value
Alist with elements:LRuc,LRcc,DQ,AD,AE.
Author(s)
Leopoldo Catania
References
Christoffersen PF (1998)."Evaluating Interval Rorecasts."International Economic Review, 39(4), 841-862.
Engle RF and Manganelli S. (2004)."CAViaR: Conditional Autoregressive Value at Risk by Regression Quantiles."Journal of Business & Economic Statistics, 22(4), 367-381.doi:10.1198/073500104000000370.
Gonzalez-Rivera G, Lee TH, and Mishra, S (2004)."Forecasting Volatility: A Reality Check Based on Option Pricing, Utility Function, Value-at-Risk, and Predictive Likelihood."International Journal of Forecasting, 20(4), 629-645.doi:10.1016/j.ijforecast.2003.10.003.
Kupiec PH (1995)."Techniques for Verifying the Accuracy of Risk Measurement Models."The Journal of Derivatives, 3(2), 73-84.doi:10.3905/jod.1995.407942
McAleer M and Da Veiga B (2008)."Forecasting Value-at-Risk with a Parsimonious Portfolio Spillover GARCH (PS-GARCH) Model."Journal of Forecasting, 27(1), 1-19.doi:10.1002/for.1049.
Examples
data("StockIndices")GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity", GASPar = list(location = FALSE, scale = TRUE, shape = FALSE))FTSEMIB = StockIndices[, "FTSEMIB"]InSampleData = FTSEMIB[1:1500]OutSampleData = FTSEMIB[1501:2404]Fit = UniGASFit(GASSpec, InSampleData)Forecast = UniGASFor(Fit, Roll = TRUE, out = OutSampleData)alpha = 0.05VaR = quantile(Forecast, alpha)BackTest = BacktestVaR(OutSampleData, VaR, alpha)Build confidence bands for the filtered parameters
Description
Build confidence bands for the filtered parameters sampling the coefficientsfrom the asymptotic distribution as in Blasques et al. (2016).
Usage
ConfidenceBands(object, B = 10000, probs = c(0.01,0.1,0.9,0.99), ...)Arguments
object | |
B |
|
probs |
|
... | Additional arguments. |
Details
This function implements the "In-Sample Simulation-Based Bands" Section 3.3 of Blasques et al. (2016).
Value
An object of the classarray of dimension (T+1) x B x K, where T is the length ofthe time series, K is the number of parameters and B the number of draws. The first slice reportsthe estimated filtered parameters. The one step ahead prediction is also reported, this why T+1.
Author(s)
Leopoldo Catania
References
Blasques F, Koopman SJ, Lasak K, and Lucas, A (2016)."In-sample Confidence Bands and Out-of-Sample Forecast Bands for Time-Varying Parameters in Observation-Driven Models."International Journal of Forecasting, 32(3), 875-887.doi:10.1016/j.ijforecast.2016.04.002.
Examples
## Not run: # show the information of all the supported distributionslibrary("GAS")data("cpichg")GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity", GASPar = list(location = TRUE, scale = TRUE, shape = FALSE))Fit = UniGASFit(GASSpec, cpichg)Bands = ConfidenceBands(Fit)## End(Not run)Information for the supported distributions
Description
Print the information regarding distributions supported in the GAS package.
Usage
DistInfo(DistLabel = NULL, N = 2, FULL = TRUE)Arguments
DistLabel |
|
. RunDistLabels() to seethe labels of the currently implemented distributions.
N |
|
FULL |
|
Details
The information are printed in the console.
Author(s)
Leopoldo Catania
Examples
# show the information of all the supported distributionslibrary("GAS")DistInfo()Fissler and Ziegel (2016) (FZ) joint loss function for Value at Risk and Expected Shortfall.
Description
This function implements Fissler and Ziegel (2016) (FZ) joint loss function for Value at Risk and Expected Shortfall.
Usage
FZLoss(data, VaR, ES, alpha)Arguments
data |
|
VaR |
|
ES |
|
alpha |
|
Details
This function implements Fissler and Ziegel (2016) (FZ) joint loss function for Value at Risk and Expected Shortfall. The parameterization used is that of Patton et al. (2017) and is given by:
\frac{1}{\alpha ES_t^\alpha}I_t^\alpha(y_t - VaR_t^\alpha) + \frac{VaR_t^\alpha}{ES_t^\alpha} + \log{-ES_t^\alpha} - 1.
See also Fissler et al. (2015).
Value
Anumeric vector containing the joing VaR and ES loss values.
Author(s)
Leopoldo Catania
References
Fissler, T., Ziegel, J.F., (2016)."Higher order elicitability and Osband's principle."The Annals of Statistics 44, 1680-1707.
Fissler, T., Ziegel, J.F., Tilmann, G. (2015)."Expected Shortfall is jointly elicitable with Value at Risk - Implications for backtesting."arXiv preprint arXiv:1507.00244.
Patton, A. J., Ziegel, J.F., Chen, R. (2017)."Dynamic semiparametric models for expected shortfall (and Value-at-Risk)."arXiv preprint arXiv:1707.05108.
Examples
data("StockIndices")GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity", GASPar = list(location = FALSE, scale = TRUE, shape = FALSE))FTSEMIB = StockIndices[, "FTSEMIB"]InSampleData = FTSEMIB[1:1500]OutSampleData = FTSEMIB[1501:2404]Fit = UniGASFit(GASSpec, InSampleData)Forecast = UniGASFor(Fit, Roll = TRUE, out = OutSampleData)alpha = 0.05vVaR = quantile(Forecast, alpha)vES = ES(Forecast, alpha)FZ = FZLoss(OutSampleData, vVaR, vES, alpha)data: Goals scored by England against Scotland in international football matches.
Description
Number of goals scored by England against Scotland in international football matches.This is a 116 x 2 zoo object spanning the period 1872-1987 with a yearly frequency.The first column reports the number of goals scored by England against Scotland. The secondcolumn is a dummy variable equal 1 for matches played in England.This data set is taken from the Harvey (1989) pg 524.
Usage
data("Goals")Format
A zoo object containing 116 x 2 observations.
Source
Harvey (1989) pg. 524
References
Harvey, A. C. (1990). Forecasting, structural time series models and the Kalman filter. Cambridge university press.https://cran.r-project.org/package=rugarch.
Estimate multivariate GAS models
Description
Estimate multivariate GAS models by Maximum Likelihood.
Usage
MultiGASFit(GASSpec, data, fn.optimizer = fn.optim, Compute.SE = TRUE)Arguments
GASSpec | An object of the classmGASSpec created using the functionMultiGASSpec |
data |
|
fn.optimizer |
|
Compute.SE |
|
Details
Maximum Likelihood estimation of GAS models is an on-going research topic.General results are reported by Blasques et al. (2014b), Blasques et al. (2014a) and Harvey(2013), while results for specific models have been derived by Blasques et al. (2014c) andAndres (2014).
Starting values for the optimizer are chosen in the following way: (i) estimate the staticversion of the model (i.e., with A = 0 and B = 0) and set the initial value of theintercept parameter accordingly, and (ii) perform a grid search for thecoefficients contained in A and B. Further technical details are presented in Section 3.2 of Ardia et. al. (2016a).
The user is free to employ his/her own optimization routine via thefn.optimizer argument.fn.optimizeraccepts afunction object. The user provided optimizer has to satisfy strict requirements. The arguments of thefn.optimizer are : i)par0 a vector of starting values, ii)data the data provided, iii)GASSpecan object of the classuGASSpec, and iv)FUN the likelihood function. The output offn.optimizer hasto be an object of the classlist with four named elements: i)pars: anumeric vectorwhere the estimated parameters are stored, ii)value: anumeric containing the value of the negative log likelihoodevaluated at its minimum, iii)hessian, anumeric matrix containing the Hessian matrix evaluated atthe minimum of the negative log likelihood, this is used for inferential purposes, and iv)convergence anumeric variable reporting information about the convergence of the optimization. This quantity is printed by theshow() andsummary() methods.convergence = 0 has to indicates successful completion.
The user is allowed to not include the last two elements of the output of thefn.optimizer function, that is, the valueshessian = NULL andconvergence = NULL are admissible. In the case ofhessian = NULL, the Hessian matrix isevaluated numerically using the hessian function in thenumDeriv package of Gilbert and Varadhan (2016). If the provided hessian is not positive definite, a try with the hessian evaluation used by the BFGS quasi-Newton implementation in the functionoptim is made.
By default, theoptim optimizer withmethod = "BFGS" is employed.
Value
An object of the classmGASFit.
Author(s)
Leopoldo Catania
References
Ardia D, Boudt K and Catania L (2016a)."Generalized Autoregressive Score Models in R: The GAS Package."https://www.ssrn.com/abstract=2825380.
Blasques F, Koopman SJ, Lucas A (2014a)."Maximum Likelihood Estimation for Correctly Specified Generalized Autoregressive Score Models: Feedback Effects, Contraction Conditions and Asymptotic Properties." techreport TI 14-074/III, Tinbergen Institute.https://www.tinbergen.nl/discussionpaper/?paper=2332.
Blasques F, Koopman SJ, Lucas A (2014b)."Maximum Likelihood Estimation for Generalized Autoregressive Score Models."techreport TI 2014-029/III, Tinbergen Institute.https://www.tinbergen.nl/discussionpaper/?paper=2286.
Blasques F, Koopman SJ, Lucas A, Schaumburg J (2014c)."Spillover Dynamics for Systemic Risk Measurement using Spatial Financial Time Series Models."techreport TI 2014-103/III, Tinbergen Institute.https://www.tinbergen.nl/discussionpaper/?paper=2369.
Creal D, Koopman SJ, Lucas A (2013)."Generalized Autoregressive Score Models with Applications."Journal of Applied Econometrics, 28(5), 777-795.doi:10.1002/jae.1279.
Ghalanos A, Theussl S (2016)."Rsolnp: General Non-Linear Optimization using Augmented Lagrange Multiplier Method."https://cran.r-project.org/package=Rsolnp.
Gilbert P, Varadhan R (2016).numDeriv: Accurate Numerical Derivatives. R package 2016.8-1,https://CRAN.R-project.org/package=numDeriv.
Harvey AC (2013).Dynamic Models for Volatility and Heavy Tails: With Applications to Financial and Economic Time Series.Cambridge University Press.
Ye Y (1988).Interior Algorithms for Linear, Quadratic, and Linearly Constrained Convex Programming.Ph.D. thesis, Stanford University.
Examples
## Not run: # Specify an GAS model with multivariate Student-t# conditional distribution and time-varying scales and correlationslibrary("GAS")data("StockIndices")GASSpec = MultiGASSpec(Dist = "mvt", ScalingType = "Identity", GASPar = list(scale = TRUE, correlation = TRUE))Fit = MultiGASFit(GASSpec, StockIndices)Fit## End(Not run)Forecast with multivariate GAS models
Description
Forecast with multivariate GAS models. One-step ahead prediction of the conditional densityis available in closed form. Multistep ahead prediction are performed by simulation as detailed in Blasques et al. (2016).
Usage
MultiGASFor(mGASFit, H = NULL, Roll = FALSE, out = NULL, B = 10000, Bands = c(0.1, 0.15, 0.85, 0.9), ReturnDraws = FALSE)Arguments
mGASFit | An object of the classmGASFit created using the functionMultiGASFit |
H |
|
Roll |
|
out |
|
B |
|
Bands |
|
ReturnDraws |
|
Value
An object of the classmGASFor
Author(s)
Leopoldo Catania
References
Blasques F, Koopman SJ, Lasak K, and Lucas, A (2016)."In-sample Confidence Bands and Out-of-Sample Forecast Bands for Time-Varying Parameters in Observation-Driven Models."International Journal of Forecasting, 32(3), 875-887.doi:10.1016/j.ijforecast.2016.04.002.
Examples
## Not run: # Specify a GAS model with multivatiate Student-t conditional# distribution and time-varying scales and correlations.# Stock returns forecastset.seed(123)data("StockIndices")mY = StockIndices[, 1:2]# Specification mvtGASSpec = MultiGASSpec(Dist = "mvt", ScalingType = "Identity", GASPar = list(location = FALSE, scale = TRUE, correlation = TRUE, shape = FALSE))# Perform H-step ahead forecast with confidence bands# EstimationFit = MultiGASFit(GASSpec, mY)# ForecastForecast = MultiGASFor(Fit, H = 50)Forecast# Perform 1-Step ahead rolling forecastInSampleData = mY[1:1000, ]OutSampleData = mY[1001:2404, ]# EstimationFit = MultiGASFit(GASSpec, InSampleData)Forecast = MultiGASFor(Fit, Roll = TRUE, out = OutSampleData)Forecast## End(Not run)Rolling forecast with multivariate GAS models
Description
One-step ahead rolling forecasts with model re-estimation. The function also reportsseveral quantity for backtesting for point and density forecasts.
Usage
MultiGASRoll(data, GASSpec, ForecastLength = 500, Nstart = NULL, RefitEvery = 23, RefitWindow = c("moving", "recursive"), cluster = NULL, Compute.SE = FALSE, ...)Arguments
data |
|
GASSpec | An object of the classmGASSpec created using the functionMultiGASSpec |
ForecastLength |
|
Nstart |
|
RefitEvery |
|
RefitWindow |
|
cluster | A |
Compute.SE |
|
... | Additional arguments forMultiGASFit |
Value
An object of the classmGASRoll
Author(s)
Leopoldo Catania
Examples
## Not run: # Specify a GAS model with Multivariate Student-t conditional# distribution and time-varying scale and correlation parameters# stock returns Forecastdata("StockIndices")mY = StockIndices[, 1:2]# Specification mvtGASSpec = MultiGASSpec(Dist = "mvt", ScalingType = "Identity", GASPar = list(location = FALSE, scale = TRUE, correlation = TRUE, shape = FALSE))# Perform 1-step ahead rolling forecast with refitlibrary(parallel)Roll = MultiGASRoll(mY, GASSpec, ForecastLength = 250, RefitEvery = 100, RefitWindow = c("moving"))Roll## End(Not run)Simulate multivariate GAS processes
Description
Simulate multivariate GAS processes.
Usage
MultiGASSim(fit = NULL, T.sim = 1000, N = NULL, kappa = NULL, A = NULL, B = NULL, Dist = NULL, ScalingType = NULL)Arguments
fit | An estimated object of the classmGASFit. By default |
T.sim |
|
N |
|
kappa |
|
A |
|
B |
|
Dist |
|
ScalingType |
|
Details
The function permits to simulate from an estimatedmGASFit object. Iffit is not provided, the usercan specify a GAS model via the additional argumentskappa,A,B,Dist andScalingType.
All the information regarding the supported multivariate conditional distributions can beinvestigated using theDistInfo function. The model is specified as:
y_{t}\sim p(y|\theta_{t})
where\theta_{t} is the vector of parameters for the densityp(y|.). Note that,\theta_{t}includes also those parameters that are not time-varying. The GAS recursionfor\theta_{t} is:
\theta_{t} = \Lambda(\tilde{\theta}_{t})
\tilde{\theta}_{t}=\kappa + A*s_{t-1} + B*\tilde{\theta}_{t-1}
whereh(.) is the mapping function (seeMultiMapParameters) and\tilde{\theta}_{t} isthe vector of reparametrised parameters. The process is initialized at\theta_{1}=(I - B)^{-1}\kappa,where\kappa is theKappa vector. The vectors_{t} is the scaled score ofp(y|.) with respect to\tilde{\theta}_{t}.See Ardia et. al. (2016a) for further details.
Value
An object of the classmGASSim
Author(s)
Leopoldo Catania
References
Ardia D, Boudt K and Catania L (2016a)."Generalized Autoregressive Score Models in R: The GAS Package."https://www.ssrn.com/abstract=2825380.
Creal D, Koopman SJ, Lucas A (2013)."Generalized Autoregressive Score Models with Applications."Journal of Applied Econometrics, 28(5), 777-795.doi:10.1002/jae.1279.
Harvey AC (2013).Dynamic Models for Volatility and Heavy Tails: With Applications to Financial and Economic Time Series.Cambridge University Press.
Examples
# Simulate from a GAS process with Multivariate Student-t conditional# distribution, time-varying locations, scales, correlations# and fixed shape parameter.library("GAS")set.seed(786)T.sim = 1000 # Number of observations to simulate.N = 3 # Trivariate series.Dist = "mvt" # Conditional Multivariate Studen-t distribution.# Build unconditional vector of reparametrised parameters.Mu = c(0.1, 0.2, 0.3) # Vector of location parameters (this is not transformed).Phi = c(1.0, 1.2, 0.3) # Vector of scale parameters for the firs, second and third variables.Rho = c(0.1, 0.2, 0.3) # This represents vec(R), where R is the correlation matrix. # Note that is up to the user to ensure that vec(R) implies a # proper correlation matrix.Theta = c(Mu, Phi, Rho, 7) # Vector of parameters such that the degrees of freedom are 7.kappa = MultiUnmapParameters(Theta, Dist, N)A = matrix(0, length(kappa), length(kappa))# Update scales and correlations, do not update locations and shape parameters.diag(A) = c(0, 0, 0, 0.05, 0.01, 0.09, 0.01, 0.04, 0.07, 0)B = matrix(0, length(kappa), length(kappa))# Update scales and correlations, do not update locations and shape parameters.diag(B) = c(0, 0, 0, 0.7, 0.7, 0.5, 0.94, 0.97, 0.92, 0)Sim = MultiGASSim(fit = NULL, T.sim, N, kappa, A, B, Dist, ScalingType = "Identity")SimMultivariate GAS specification
Description
Specify the conditional distribution, scaling mechanism and time-varying parameters for multivariate GAS models.
Usage
MultiGASSpec(Dist = "mvnorm", ScalingType = "Identity", GASPar = list(location = FALSE, scale = TRUE, correlation = FALSE, shape = FALSE), ScalarParameters = TRUE)Arguments
Dist |
|
.
ScalingType |
|
GASPar |
|
ScalarParameters |
|
Details
All the information regarding the supported multivariate conditional distributions can be investigated using theDistInfo function.
Value
An object of the classmGASSpec
Author(s)
Leopoldo Catania
References
Creal D, Koopman SJ, Lucas A (2011). "A Dynamic Multivariate Heavy-Tailed Model for Time-Varying Volatilities and Correlations." Journal of Business & Economic Statistics, 29(4), 552-563.doi:10.1198/jbes.2011.10070.
Creal D, Koopman SJ, Lucas A (2013). "Generalized Autoregressive Score Models with Applications." Journal of Applied Econometrics, 28(5), 777-795.doi:10.1002/jae.1279.
Harvey AC (2013). Dynamic Models for Volatility and Heavy Tails: With Applications to Financial and Economic Time Series. Cambridge University Press.
Examples
# Specify a GAS model with multivariate Student-t# conditional distribution and time-varying locations,# scales and correlations parameters but constant shape parameter.library("GAS")GASSpec = MultiGASSpec(Dist = "mvt", ScalingType = "Identity", GASPar = list(location = TRUE, scale = TRUE, correlation = TRUE, shape = FALSE))GASSpecMapping function for univariate distributions
Description
Map unrestricted vector of parameters into the proper space. This function transforms the parameters updated using the GAS recursion into their proper space.
Usage
MultiMapParameters(Theta_tilde, Dist, N)Arguments
Theta_tilde |
|
Dist |
|
N |
|
Details
The order of the parameters is generally: locations, scales, correlations, shape. When the distribution defined byDist does not have, say, the shape parameter, this should be simply omitted. See alsoDistInfo for specific distributions.
Value
Anumeric vector of parameters.
Author(s)
Leopoldo Catania
Examples
# Map unrestricted parameters for the Multivariate Student-t distribution with N=3library("GAS")N = 3Dist = "mvt"# Vector of location parameters (this is not transformed).Mu_tilde = c(0.1,0.2,0.3)# Vector of unrestricted scales parameters such that# the scales will be equal to 1.0, 1.2 and 0.3, for the first, second and# third variables, respectively.Phi_tilde = c(log(1.0), log(1.2), log(0.3))# The vector c(0.1,0.2,0.3) represents vec(R),# where R is the correlation matrix.# Note that is up to the user to ensure that# vec(R) implies a proper correlation matrix# The function UnMapR_C transforms vec(R) in a vector of unrestricted parameters. It is# the inverse of the hyperspherical coordinates transformration.Rho_tilde = UnMapR_C(c(0.1,0.2,0.3), N)# Vector of unconditional reparametrised parameters such that the# degrees of freedom are 7.## LowerNu() prints the lower bound numerical parameter for the degree# of freedom, see help(LowerNu)#Theta_tilde = c(Mu_tilde, Phi_tilde , Rho_tilde, log(7 - LowerNu()))Theta = MultiMapParameters(Theta_tilde, Dist, N)ThetaInverse ofMultiMapParameters
Description
Transform distribution parameters into the unrestricted parameters. The unrestricted vector of parameters is updated using the GAS recursion.
Usage
MultiUnmapParameters(Theta, Dist, N)Arguments
Theta |
|
Dist |
|
N |
|
Details
The order of the parameters is generally: locations, scales, correlations, shape. When the distribution defined byDist does not have, say, the shape parameter, this should be simply omitted. See alsoDistInfo for specific distributions.
Value
Anumeric vector of parameters.
Author(s)
Leopoldo Catania
Examples
# Unmap parameters for the Multivariate Student-t distribution with N=3library(GAS)N = 3Dist = "mvt"# Vector of location parameters (this is not transformed).Mu = c(0.1, 0.2, 0.3)# Vector of scales parameters for the firs, second and third variables.Phi = c(1.0, 1.2, 0.3)# This represents vec(R), where R is the correlation matrix.# Note that is up to the user to ensure that vec(R) implies a proper correlation matrixRho = c(0.1, 0.2, 0.3)# Vector of parameters such that the degrees of freedom are 7.Theta = c(Mu, Phi, Rho, 7)Theta_tilde = MultiUnmapParameters(Theta, Dist, N)Theta_tilde# It worksall(abs(MultiMapParameters(Theta_tilde, Dist, N) - Theta) < 1e-16)Numerical bounds imposed in parameters transformation.
Description
Prints the numerical bounds.
Usage
UpperNu()LowerNu()UpperA()LowerA()UpperB()LowerB()Details
UpperNu() andLowerNu() print the numerical upper and lower bounds for the degree of freedom parameter of the Student–t distribution,std. (including alsosstd andmvt).UpperA() andLowerA() print the numerical upper and lower bounds for the score parameter in the GAS recursion. These bounds are applied to each diagonal element of the matrixA that premultiplies the scaled score.UpperB() andLowerB() print the numerical upper and lower bounds for the autoregressive parameter in the GAS recursion. These bounds are applied to each diagonal element of the matrixB that premultiplies the past value of the parameters.
Value
Prints the numerical bounds.
Author(s)
Leopoldo Catania
Examples
UpperNu()LowerNu()UpperA()LowerA()UpperB()LowerB()Goodness of fit for conditional densities
Description
This function implements density goodness of fit procedure of Diebold et al. (1998).
Usage
PIT_test(U, G = 20, alpha = 0.05, plot = FALSE)Arguments
U |
|
G |
|
alpha |
|
plot |
|
Details
This function implements density goodness of fit procedure of Diebold et al. (1998). The test relays on theresult that, if the series of estimated conditional distributions is the true one, then the PIT seriesevaluated accordingly are iid Unif(0, 1) distributed. The test of the iid Uniform(0, 1) assumptionconsists of two parts. The first part concerns the independent assumption, and it tests if all theconditional moments of the data, up to the fourth one, have been accounted for by the model, whilethe second part checks if the conditional distribution assumption is reliable by testing if thePITs are Uniform over the interval (0, 1). See also Jondeau and Rockinger (2006) and Vlaar and Palm (1993).
Value
Alist with elements: (i)Hist and (ii)IID. The fist elementHist concernsthe test of the unconditional assumption of uniformity of the PIT, it is alist with elements:
testStatistic test.critThe critical value of the test.pvalueThe pvalue of the test.histThe histogram, evaluated using thehist function.confidenceApproximated asymptotic confidence level.
The second elementIID concerns the iid assumption, it is alist with elements:
testA namednumericvector with elements:test1,test2,test3,test4representing the Lagrange Multiplier test for the first four conditional moments of the PITs.critThe critical value of the test.pvalueA namednumericvector with elements:pvalue1,pvalue2,pvalue3,pvalue4representing the pvalues of the Lagrange Multiplier test for the first four conditional moments of the PITs.
Author(s)
Leopoldo Catania
References
Diebold FX, Gunther TA and Tay AS (1998)."Evaluating Density Forecasts with Applications to Financial Risk Management."International Economic Review, 39(4), 863-883.
Jondeau E and Rockinger M (2006)."The Copula-Garch Model of Conditional Dependencies: An International Stock Market Application."Journal of International Money and Finance, 25(5), 827-853.doi:10.1016/j.jimonfin.2006.04.007.
Vlaar PJ and Palm FC (1993)."The Message in Weekly Exchange Rates in the European Monetary System: Mean Reversion, Conditional Heteroscedasticity, and Jumps."Journal of Business & Economic Statistics, 11(3), 351-360.doi:10.1080/07350015.1993.10509963.
Examples
data("StockIndices")GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity", GASPar = list(location = FALSE, scale = TRUE, shape = FALSE))FTSEMIB = StockIndices[, "FTSEMIB"]Fit = UniGASFit(GASSpec, FTSEMIB)U = pit(Fit)Test = PIT_test(U, G = 20, alpha = 0.05, plot = TRUE)Data: Daily logarithmic returns in percentage points of the DAX, FTSEMIBand CAC40 from 2007-01-03 to 2016-06-24
Description
Daily logarithmic returns in percentage points of the DAX, FTSEMIB and CAC40from 2007-01-03 to 2016-06-24 obtained from Yahoo.
Usage
data("StockIndices")Format
Amatrix object of dimension 2,445 x 3 containing the daily logarithmic returnsin percentage points from 2007-01-03 to 2016-06-24. Missing values are simply removed.
References
Yahoo finance.
Estimate univariate GAS models
Description
Estimate univariate GAS models by Maximum Likelihood.
Usage
UniGASFit(GASSpec, data, fn.optimizer = fn.optim, Compute.SE = TRUE)Arguments
GASSpec | An object of the classuGASSpec created using the functionUniGASSpec |
.
data |
|
fn.optimizer |
|
Compute.SE |
|
Details
Maximum Likelihood estimation of GAS models is an on-going research topic.General results are reported by Blasques et al. (2014b), Blasques et al. (2014a) and Harvey(2013), while results for specific models have been derived by Blasques et al. (2014c) andAndres (2014).
Starting values for the optimizer are chosen in the following way: (i) estimate the staticversion of the model (i.e., with A = 0 and B = 0) and set the initial value of the intercept parameteraccordingly, and (ii) perform a grid search for the coefficients contained in A and B.Further technical details are presented in Section 3.2 of Ardia et. al. (2016a).
The user is free to employ his/her own optimization routine via thefn.optimizer argument.fn.optimizeraccepts afunction object. The user provided optimizer has to satisfy strict requirements. The arguments of thefn.optimizer are : i)par0 a vector of starting values, ii)data the data provided, iii)GASSpecan object of the classuGASSpec, and iv)FUN the likelihood function. The output offn.optimizer hasto be an object of the classlist with four named elements: i)pars: anumeric vectorwhere the estimated parameters are stored, ii)value: anumeric containing the value of the negative log likelihoodevaluated at its minimum, iii)hessian, anumeric matrix containing the Hessian matrix evaluated atthe minimum of the negative log likelihood, this is used for inferential purposes, and iv)convergence anumeric variable reporting information about the convergence of the optimization. This quantity is printed by theshow() andsummary() methods.convergence = 0 has to indicate successful completion.
The user is allowed to not include the last two elements of the output of thefn.optimizer function, that is, the valueshessian = NULL andconvergence = NULL are admissible. In the case ofhessian = NULL, the Hessian matrix isevaluated numerically using the hessian function in thenumDeriv package of Gilbert and Varadhan (2016). If the provided hessian is not positive definite, a try with the hessian evaluation used by the BFGS quasi-Newton implementation in the functionoptim is made.
By default, theoptim optimizer withmethod = "BFGS" is employed.
Value
An object of the classuGASFit
Author(s)
Leopoldo Catania
References
Ardia D, Boudt K and Catania L (2016a)."Generalized Autoregressive Score Models in R: The GAS Package."https://www.ssrn.com/abstract=2825380.
Blasques F, Koopman SJ, Lucas A (2014a)."Maximum Likelihood Estimation for Correctly Specified Generalized Autoregressive Score Models: Feedback Effects, Contraction Conditions and Asymptotic Properties." techreport TI 14-074/III, Tinbergen Institute.https://www.tinbergen.nl/discussionpaper/?paper=2332.
Blasques F, Koopman SJ, Lucas A (2014b)."Maximum Likelihood Estimation for Generalized Autoregressive Score Models."techreport TI 2014-029/III, Tinbergen Institute.https://www.tinbergen.nl/discussionpaper/?paper=2286.
Blasques F, Koopman SJ, Lucas A, Schaumburg J (2014c)."Spillover Dynamics for Systemic Risk Measurement using Spatial Financial Time Series Models."techreport TI 2014-103/III, Tinbergen Institute.https://www.tinbergen.nl/discussionpaper/?paper=2369.
Creal D, Koopman SJ, Lucas A (2013)."Generalized Autoregressive Score Models with Applications."Journal of Applied Econometrics, 28(5), 777-795.doi:10.1002/jae.1279.
Gilbert P, Varadhan R (2016).numDeriv: Accurate Numerical Derivatives. R package 2016.8-1,https://CRAN.R-project.org/package=numDeriv.
Ghalanos A, Theussl S (2016)."Rsolnp: General Non-Linear Optimization using Augmented Lagrange Multiplier Method."https://cran.r-project.org/package=Rsolnp.
Harvey AC (2013).Dynamic Models for Volatility and Heavy Tails: With Applications to Financial and Economic Time Series.Cambridge University Press.
Ye Y (1988).Interior Algorithms for Linear, Quadratic, and Linearly Constrained Convex Programming.Ph.D. thesis, Stanford University.
Examples
## Not run: # Specify an univariate GAS model with Student-t# conditional distribution and time-varying scale.library("GAS")data("sp500ret")GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity", GASPar = list(location = FALSE, scale = TRUE, shape = FALSE))Fit = UniGASFit(GASSpec, sp500ret)Fit# Estimate the model with a different optimizer.# Assume we want to use the Nelder and Mead optimization provided by# the optim() function, we create# the wrapper fn.NM.optim in this wayfn.NM.optim <- function(par0, data, GASSpec, FUN) { optimizer = optim(par0, FUN, data = data, GASSpec = GASSpec, method = "Nelder-Mead", control = list(trace = 0), hessian = TRUE) out = list(pars = optimizer$par, value = optimizer$value, hessian = optimizer$hessian, convergence = optimizer$convergence) return(out)}Fit.NM.optim = UniGASFit(GASSpec, sp500ret, fn.optimizer = fn.NM.optim )Fit.NM.optim# Estimate time-varying Negative Binomial distribution for the Goals dataset.# Let's use the gosolnp() optimizer for the time-varying model estimation and# the solnp() optimizer for estimation of the static model for the choice of# the starting values. The logical is(GASSpec, "list") is TRUE when the function# is evaluated for the choice of starting values, and FALSE when the function# is evaluated for the time-varying model.# We can also make use of parallel computation calling a cluster object defined# in the Global environment.library("Rsolnp")fn.gosolnp <- function(par0, data, GASSpec, FUN) { if (is(GASSpec, "list")) { optimiser = suppressWarnings(solnp(par0, FUN, data = data, GASSpec = GASSpec, control = list(trace = 0))) } else { cluster = get("cluster", envir = globalenv()) optimiser = suppressWarnings(gosolnp( pars = NULL, fun = FUN, data = data, cluster = cluster, GASSpec = GASSpec, n.sim = 100000, n.restarts = 10, LB = c(-5, -2, -2, -2), UB = c(5, 8, 3.0, 5.0)) ) } out = list(pars = optimiser$pars, value = tail(optimiser$values, 1), hessian = optimiser$hessian, convergence = optimiser$convergence) return(out)}data("Goals")library("parallel")cluster = makeCluster(2)GASSpec = UniGASSpec(Dist = "negbin", ScalingType = "Inv", GASPar = list(location = TRUE, scale = FALSE))vY = na.omit(Goals[, 1])Fit = UniGASFit(GASSpec, vY, fn.optimizer = fn.gosolnp)FitstopCluster(cluster)rm("cluster")## End(Not run)Forecast with univariate GAS models
Description
Forecast with univariate GAS models. The one-step ahead prediction of the conditionaldensity is available in closed form. The multi-step ahead prediction is performed bysimulation as detailed in Blasques et al. (2016).
Usage
UniGASFor(uGASFit, H = NULL, Roll = FALSE, out = NULL, B = 10000, Bands = c(0.1, 0.15, 0.85, 0.9), ReturnDraws = FALSE)Arguments
uGASFit | An object of the classuGASFit created using the functionUniGASFit. |
H |
|
Roll |
|
out |
|
B |
|
Bands |
|
ReturnDraws |
|
Value
An object of the classuGASFor.
Author(s)
Leopoldo Catania
References
Blasques F, Koopman SJ, Lasak K, and Lucas, A (2016)."In-sample Confidence Bands and Out-of-Sample Forecast Bands for Time-Varying Parameters in Observation-Driven Models."International Journal of Forecasting, 32(3), 875-887.doi:10.1016/j.ijforecast.2016.04.002.
Examples
# Specify an univariate GAS model with Student-t# conditional distribution and time-varying location, scale and shape parameter# Inflation Forecastset.seed(123)data("cpichg")GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity", GASPar = list(location = TRUE, scale = TRUE, shape = FALSE))# Perform H-step ahead forecast with confidence bandsFit = UniGASFit(GASSpec, cpichg)Forecast = UniGASFor(Fit, H = 12)Forecast# Perform 1-Step ahead rolling forecastInsampleData = cpichg[1:250]OutSampleData = cpichg[251:276]Fit = UniGASFit(GASSpec, InsampleData)Forecast = UniGASFor(Fit, Roll = TRUE, out = OutSampleData)ForecastRolling forecast with univariate GAS models
Description
One-step ahead rolling forecasts with model re-estimation. The function alsoreports several quantity for backtesting for point and density forecasts.
Usage
UniGASRoll(data, GASSpec, ForecastLength = 500, Nstart = NULL, RefitEvery = 23, RefitWindow = c("moving", "recursive"), cluster = NULL, Compute.SE = FALSE, ...)Arguments
data |
|
GASSpec | An object of the classuGASSpec created using the functionUniGASSpec. |
ForecastLength |
|
Nstart |
|
RefitEvery |
|
RefitWindow |
|
cluster | A |
Compute.SE |
|
... | Additional arguments forUniGASFit |
Value
An object of the classuGASRoll.
Author(s)
Leopoldo Catania
Examples
# Specify an univariate GAS model with Student-t# conditional distribution and time-varying location, scale and shape parameter# Inflation Forecastdata("cpichg")help(cpichg)GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity", GASPar = list(location = TRUE, scale = TRUE, shape = FALSE))# Perform 1-step ahead rolling forecast with refitlibrary("parallel")Roll = UniGASRoll(cpichg, GASSpec, ForecastLength = 50, RefitEvery = 12, RefitWindow = c("moving"))RollSimulate Univariate GAS processes
Description
Simulate Univariate GAS processes.
Usage
UniGASSim(fit = NULL, T.sim = 1000, kappa = NULL, A = NULL, B = NULL, Dist = NULL, ScalingType = NULL)Arguments
fit | An estimated object of the classuGASFit. By default |
T.sim |
|
kappa |
|
A |
|
B |
|
Dist |
|
ScalingType |
|
Details
The function permits to simulate from an estimateduGASFit object. Iffit is not provided, the usercan specify a GAS model via the additional argumentskappa,A,B,Dist andScalingType.
All the information regarding the supported univariate conditional distributions can be investigatedusing theDistInfo function. The model is specified as
y_{t}\sim p(y|\theta_{t})
,where\theta_{t} is the vector of parameters for the densityp(y|.). Note that,\theta_{t} includesalso those parameters that are not time-varying.The GAS recursion for\theta_{t} is
\theta_{t} = \Lambda(\tilde{\theta}_{t})
,
\tilde{\theta}_{t}=\kappa + A*s_{t-1} + B*\tilde{\theta}_{t-1}
,where\Lambda(.) is the mapping function (seeUniMapParameters) and\tilde{\theta}_{t} is the vector ofreparametrised parameters. The process is initialized at\theta_{1}=(I - B)^{-1}\kappa, where\kappa isthevKappa vector. The vectors_{t} is the scaled score ofp(y|.) with respect to\tilde{\theta}_{t}.See Ardia et. al. (2016a) for further details.
Value
An object of the classuGASSim.
Author(s)
Leopoldo Catania
References
Ardia D, Boudt K and Catania L (2016a)."Generalized Autoregressive Score Models in R: The GAS Package."https://www.ssrn.com/abstract=2825380.
Creal D, Koopman SJ, Lucas A (2013)."Generalized Autoregressive Score Models with Applications."Journal of Applied Econometrics, 28(5), 777-795.doi:10.1002/jae.1279.
Harvey AC (2013).Dynamic Models for Volatility and Heavy Tails: With Applications to Financial and Economic Time Series.Cambridge University Press.
Examples
# Simulate from a GAS process with Student-t conditional# distribution, time-varying location, scale and fixed shape parameter.library(GAS)set.seed(786)T.sim = 1000 # number of observations to simulateDist = "std" # conditional Studen-t distribution# vector of unconditional reparametrised parameters such that, the unconditional level of# \eqn{\theta}_{t} is (0, 1.5 ,7), i.e. location = 0, scale = 1.5,# degrees of freedom = 7.kappa = c(0.0, log(1.5), log(7-2.01))# in this way we specify that the shape parameter is constant while the score# coefficients for the location and the scale# parameters are 0.001 and 0.01, respectively.A = matrix(c(0.001 , 0.0 , 0.0 , 0.0 , 0.01 , 0.0 , 0.0 , 0.0 , 0.0 ), 3, byrow = TRUE)B = matrix(c(0.7 , 0.0 , 0.0 , 0.0 , 0.98, 0.0 , 0.0 , 0.0 , 0.0),3,byrow = TRUE) # Matrix of autoregressive parameters.Sim = UniGASSim(fit = NULL, T.sim, kappa, A, B, Dist, ScalingType = "Identity")SimUnivariate GAS specification
Description
Specify the conditional distribution, scaling mechanism and time–varying parameters for univariate GAS models.
Usage
UniGASSpec(Dist = "norm", ScalingType = "Identity", GASPar = list(location = FALSE, scale = TRUE, skewness = FALSE, shape = FALSE, shape2 = FALSE))Arguments
Dist |
|
ScalingType |
|
GASPar |
|
Details
All the information regarding the supported univariate conditional distributionscan be investigated using theDistInfo function.
Value
An object of the classuGASSpec.
Author(s)
Leopoldo Catania
References
Ardia D, Boudt K and Catania L (2016)."Generalized Autoregressive Score Models in R: The GAS Package."https://www.ssrn.com/abstract=2825380.
Creal D, Koopman SJ, Lucas A (2013)."Generalized Autoregressive Score Models with Applications."Journal of Applied Econometrics, 28(5), 777-795.doi:10.1002/jae.1279.
Harvey AC (2013).Dynamic Models for Volatility and Heavy Tails: With Applications to Financial and Economic Time Series.Cambridge University Press.
Examples
# Specify an univariate GAS model with Student-t# conditional distribution and time-varying location, scale and shape parameterlibrary("GAS")GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity", GASPar = list(location = TRUE, scale = TRUE, shape = TRUE))GASSpecMapping function for univariate distributions
Description
Map unrestricted vector of parameters into the proper space. This function transforms the parameters updated using the GAS recursion into their proper space.
Usage
UniMapParameters(Theta_tilde, Dist)Arguments
Theta_tilde |
|
Dist |
|
Details
The order of the parameters is generally:location,scale,skewness,shape,shape2. When the distribution defined byDist does not have, say, theshape parameter, this should be simply omitted. See alsoDistInfo for specific distributions.
Value
Anumeric vector of parameters.
Author(s)
Leopoldo Catania
Examples
# Map unrestricted parameters for the Student-t distribution.library("GAS")Dist = "std"# Vector of unconditional reparametrised parameters such that,# Theta = c(0, 1.5 ,7), i.e., location = 0, scale = 1.5,# degrees of freedom = 7.# LowerNu() prints the lower bound numerical parameter for the degree# of freedom, see help(LowerNu).Theta_tilde = c(0.1, log(1.5), log(7 - LowerNu()))Theta = UniMapParameters(Theta_tilde, Dist)ThetaUnmapping function for univariate distributions, i.e. inverse ofUniMapParameters
Description
Transform distribution parameters into the unrestricted parameters. The unrestricted vector of parameters is updated using the GAS recursion.
Usage
UniUnmapParameters(Theta, Dist)Arguments
Theta |
|
Dist |
|
Details
The order of the parameters is generally:location,scale,skewness,shape,shape2. When the distribution defined byDist does not have, say, theshape parameter, this should be simply omitted. See alsoDistInfo for specific distributions.
Value
Anumeric vector of parameters.
Author(s)
Leopoldo Catania
Examples
# Unmap parameters for the Student-t distributionlibrary("GAS")Dist = "std"# Vector of parameters such that,# Theta = c(0, 1.5 ,7), i.e., location = 0, scale = 1.5,# degrees of freedom = 7.Theta = c(0.1, 1.5, 7)Theta_tilde = UniUnmapParameters(Theta, Dist)Theta_tilde# It works.all(abs(UniMapParameters(Theta_tilde, Dist) - Theta) < 1e-16)Data: Quarterly logarithmic change in percentage points of the Consumer Price Index for All Urban Consumers: All Items (CPIAUCSL) from 1947-04-01 to 2016-05-01
Description
Quarterly logarithmic change in percentage points of the Consumer Price Index for All Urban Consumers: All Items (CPIAUCSL) from 1947-04-01 to 2016-05-01 available athttps://fred.stlouisfed.org/series/CPIAUCSL.
Usage
data("cpichg")Format
A xts object containing 276 observations from 1947-04-01 to 2016-05-01.
References
US. Bureau of Labor Statistics, Consumer Price Index for All Urban Consumers: All Items [CPIAUCSL], retrieved from FRED, Federal Reserve Bank of St. Louis; https://fred.stlouisfed.org/series/CPIAUCSL, June 24, 2016.
Distributions of the GAS package
Description
Density, distribution function, quantile function, random generator, moments, scores and information matrix of univariate and multivariate distributions of the GAS package.
Usage
ddist_Uni(y, Theta, Dist, log = FALSE)pdist_Uni(q, Theta, Dist)qdist_Uni(p, Theta, Dist)rdist_Uni(Theta, Dist)mdist_Uni(Theta, Dist)Score_Uni(y, Theta, Dist)IM_Uni(Theta, Dist)ddist_Multi(y, Theta, Dist, log = FALSE)rdist_Multi(Theta, N, Dist)Score_Multi(y, Theta, Dist)Arguments
y,q |
|
p |
|
Theta |
|
Dist |
|
log |
|
N |
|
Details
The functionmdist_Uni returns a vector with four elements:mean,variance,skewness andkurtosis coefficients. The functionsScore_Uni andIM_Uni returns the score and the Fisher information matrix for univariate distributions. The functionScore_Multi returns the score for multivariate distributions. SeeDistInfo for the lists of supported distributions. These functions are not vectorized.ddist_Uni andddist_Multi give the density,pdist_Uni gives the distribution function,qdist_Uni gives the quantile function, andrdist_Uni andrdist_Multi generate random deviates.
Value
numericscalar for:ddist_Uni,pdist_Uni,qdist_Uni,rdist_Uni,numericvector for:Score_Uni,Score_Multiandrdist_Multi,matrixforIM_Uni.
Author(s)
Leopoldo Catania
Examples
# Skew Student-t distribution# log densityTheta = c("location" = 0, "scales" = 1, "skewness" = 1.2, "shape" = 7)ddist_Uni(y = 0.5, Theta, "sstd", TRUE)# probabilitypdist_Uni(q = -1.69, Theta, "sstd")#quantileqdist_Uni(p = 0.05, Theta, "sstd")#random generatorrdist_Uni(Theta, "sstd")#momentsmdist_Uni(Theta, "sstd")data: Dow Jones 30 Constituents Closing Value Log Return in percentage points
Description
This dataset is taken from therugarch package of Ghalanos (2015). Returns are in percentage points.
Dow Jones 30 Constituents closing value log returns from 1987-03-16 to2009-02-03 from Yahoo Finance. Note that AIG was replaced by KFT (Kraft Foods)on September 22, 2008. This is not reflected in this data set as that wouldbring the starting date of the data to 2001.
Usage
data("dji30ret")Format
A data.frame containing 5,521x30 observations.
Source
Yahoo Finance
References
Ghalanos A (2015)."rugarch: Univariate GARCH models."https://cran.r-project.org/package=rugarch.
A wrapper to theoptim function.
Description
This function is a wrapper to the standardoptim optimizer withmethod = "BFGS".
Usage
fn.optim(par0, data, GASSpec, FUN)Arguments
par0 |
|
data |
|
GASSpec | An object of the classuGASSpec ormGASSpec, created via theUniGASSpec andMultiGASSpec functions. |
FUN | Afunction to optimize. |
Details
The following control parameters are used forcontrol:
trace = 0abstol = 1e-8
See the documentation ofoptim.
Value
It returns a named list with four elements: i)pars: anumeric vectorwhere the estimated parameters are stored, ii)value: anumeric containing the value of the negative log likelihoodevaluated at its minumum, iii)hessian, anumeric matrix containing the Hessian matrix evaluated atthe minimum of the negative log likelihood, iv)convergence anumeric element indicating the convergence results ofoptim.
Author(s)
Leopoldo Catania
See Also
help(optim)
A wrapper to the solnp function of theRsolnp package of Ghalanos and Theussl (2016).
Description
This function is a wrapper to the solnp function of theRsolnp package of Ghalanos and Theussl (2016).
Usage
fn.solnp(par0, data, GASSpec, FUN)Arguments
par0 |
|
data |
|
GASSpec | An object of the classuGASSpec ormGASSpec, created via theUniGASSpec andMultiGASSpec functions. |
FUN | Afunction to optimize. |
Details
The following control parameters are used:trace = 0,rho = 1,outer.iter = 400,inner.iter = 1800,delta = 1e-08,tol = 1e-08. See the documentation of solnp.
Value
It returns a named list with four elements: i)pars: anumeric vectorwhere the estimated parameters are stored, ii)value: anumeric containing the value of the negative log likelihoodevaluated at its minumum, iii)hessian, anumeric matrix containing the Hessian matrix evaluated atthe minimum of the negative log likelihood, and iv)convergence anumeric element indicating the convergence results ofsolnp.
Author(s)
Leopoldo Catania
References
Alexios Ghalanos and Stefan Theussl (2015)."Rsolnp: General Non-linear Optimization Using Augmented LagrangeMultiplier Method". R package version 1.16.
See Also
help(solnp)
Class for the Multivariate GAS fitted object
Description
Class for the multivariate GAS fitted object.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
Data:Object of class
list. Contains the user's data.Estimates:Object of class
list. Contains:lParListlist ofestimated parameters,optimiserobject delivered from the optimization function,StaticFitMLestimates for the constant model,Inferenceinferential results for the estimated parameters.GASDyn:Object of class
list. Contains: the series of filtered dynamic (GASDyn$mTheta)for the time–varying parameters, the series of scaled scores (GASDyn$mInnovation), the series ofunrestricted filtered parameters (GASDyn$mTheta_tilde), the series of log densities (GASDyn$vLLK), thelog likelihood evaluated at its optimum value (GASDyn$dLLK)ModelInfo:Object of class
list. Contains information about the GAS specification:SpecObject of the classuGASSpec containing the GAS specification.iTnumericNumber of observation.elapsedTimeNumericelapsed time in seconds.
Methods
showsignature(object = 'mGASFit'): print object information.summarysignature(object = 'mGASFit'): Show summary.plot
signature(x='mGASFit', y='missing'): Plot filtered dynamic and other estimated quantities.getFilteredParameters
signature(object = "mGASFit"): Extract filtered parameters.getObs
signature(object = "mGASFit"): Extract original observations.coefsignature(object = 'uGASFit'): Returns a named vector of estimated coefficients.Also accepts the additional logical argumentdo.list. Ifdo.list = TRUE, estimated coefficientsare organized in a list with arguments:vKappathe intercept vector,mAthe A system matrix,mBthe B system matrix. By default,do.list = FALSE.getMoments
signature(object = "mGASFit"): Extract conditional moments.residualssignature(object = 'mGASFit'): Extract the residuals.Also accepts the additional logical argumentstandardize. Ifstandardize = TRUE,residuals are standardized by cholesky of the filtered covariance matrix. By defaultstandardize = FALSE.convergencesignature(object = 'mGASFit'): Extract convergence information.
Author(s)
Leopoldo Catania
Class for the Multivariate GAS Forecast object
Description
Class for the multivariate GAS forecast object.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
Forecast:Object of class
list. Contains forecasts:PointForecast:matrixwith parameters forecasts.Moments:listwith centered moments forecasts. The first element contains amatrixwith the predicted conditional means. The second element contains anarraywith the predicted conditional covariances.vLS:numericLog Score (Predictive Log Likelihood).
Bands:arraywith confidence bands parameters forecasts. Available only ifRoll = TRUE.Draws:If
ReturnsDraws = TRUEit is a iH x iBmatrixof draws from the predictive distribution.Info:listwith forecast information.Data:listwith original data.
Methods
showsignature(object = "uGASFor"): Show summary.plotsignature(x='uGASFor',y='missing'): Plot forecasted quantities.getForecastsignature(object = "uGASFor"): Extract parameters forecast.getObssignature(object = "uGASFor"): Extract original observations.getMomentssignature(object = "uGASFor"): Extract moments forecasts.LogScoresignature(object = "uGASFor"): Extract Log Scores.
Author(s)
Leopoldo Catania
Class for the Multivariate GAS Rolling object
Description
Class for the multivariate GAS rolling object.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
Forecast:Object of class
list. Contains forecasts:PointForecast:matrixwith parameters forecasts.Moments:listwith centered moments forecasts. The first elementcontains amatrixwith the predicted conditional means. The second element containsanarraywith the predicted conditional covariances.vLS:numericLog Score (Predictive Log Likelihood).
Info:listwith forecast information.Data:listwith original data.
Methods
showsignature(object = 'mGASRoll'): Show summary.plotsignature(x = 'mGASRoll',y = 'missing'): Plot forecasted quantities.getForecastsignature(object = 'mGASRoll'): Extract parameters forecast.getObssignature(object = 'mGASRoll'): Extract original observations.getMomentssignature(object = 'mGASRoll'): Extract moments forecasts.LogScoresignature(object = 'mGASRoll'): Extract Log Scores.residualssignature(object = 'mGASRoll'): Extract the forecast errors.Also accepts the additional logical argumentstandardize. Ifstandardize = TRUE,forecast errors are standardized by cholesky of the forecast covariance matrix. By defaultstandardize = FALSE.coefsignature(object = 'mGASFit'): Returns a matrix of estimated coefficients.Each row of the matrix corresponds to a refit of the model during the forecast period according to theRefitEveryargument provided in theMultiGASRoll function.Also accepts the additional logical argumentdo.list. Ifdo.list = TRUE, estimated coefficientsare organized in a list of lists according according to theRefitEveryargument providedin theMultiGASRoll function. Each list is populated by three arguments:vKappathe intercept vector,mAthe A system matrix,mBthe B system matrix.By default,do.list = FALSE.
Author(s)
Leopoldo Catania
Class for Multivariate GAS Simulation
Description
Class for multivariate GAS model simulation.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
ModelInfo:Object of class
list. Contains information about the multivariate GAS specification:iT:
numericTime length of simulated observations.iN:
numericCross sectional dimension.iK :
numericnumber of (possibly) time–varying parameters implied by the distributional assumption.vKappa
numericvector of unconditional level for the reparametrized vector of parameters.mA
matrixof coefficients of dimension iK x iK that premultiply the conditional score in the GAS updating recursion.mB
matrixof autoregressive coefficients of dimension iK x iK.Dist
characterlabel of the conditional distribution, seeDistInfoScalingType
characterrepresenting the scaling mechanism for the conditional score, seeDistInfo
GASDyn:Object of class
list. Contains: the series of simulated parameters (GASDyn$mTheta), the series of scaled scores (GASDyn$mInnovation), the series of unrestricted simulated parameters (GASDyn$mTheta_tilde), the series of log densities (GASDyn$vLLK), the log likelihood evaluated at its optimum value (GASDyn$dLLK)Data:Object of class
matrix. Matrix of dimension iN x iT of simulated data
Methods
showsignature(object = 'mGASSim'): Show summary.plotsignature(x = 'mGASSim',y = 'missing'): Plot simulated data and parameters.getFilteredParameterssignature(object = 'mGASSim'): Extract simulated parameters.getObssignature(object = 'mGASSim'): Extract simulated observationscoefsignature(object = 'mGASSim'): Extract delivered coefficientsgetMomentssignature(object = 'uGASFor'): Extract simulated moments.
Author(s)
Leopoldo Catania
Class for the Multivariate GAS model specification
Description
Class for the Multivariate GAS model specification.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
Spec:Object of class
list. Contains information abount the multivariate GAS specification:Dist:characterContaining the conditional distribution assumption.ScalingType:characterindicating the scaling mechanism for the conditional score.GASPar:listwith elements: location, scale, correlation, shape.ScalarParameters:logicalindicates if the parameters of the locations, scales and correlations dynamic have to be scalars or a diagonal matrices.
Methods
showsignature(object = 'mGASSpec'): Show summary.
Author(s)
Leopoldo Catania
Plot output from an object of the from theGAS package.
Description
This method provides plot functionalities for theuGASFit,mGASFit,uGASSim,mGASSim,uGASFor,mGASFor,uGASRoll andmGASRoll objects definedin theGAS package.
Usage
plot(x, y, ...) PlotMenu(x)Arguments
x,y | objects of classuGASFit,mGASFit,uGASSim,mGASSim,uGASFor,mGASFor,uGASRoll,mGASRoll. |
... | additional arguments, see Details |
Details
plot accepts the additional argumentnumeric argumentwhich. By defaultwhich = NULL. Ifwhich is provided,plot() does not show the interactive menu and plot the corresponding option. The available options for each object class is printed by the functionPlotMenu(x). By defaultwhich = NULL, that is,plot() display an interactive menu.
Value
Displays a plot of an object of classuGASFit,mGASFit,uGASSim,mGASSim,uGASFor,mGASFor,uGASRoll,mGASRoll.
Author(s)
Leopoldo Catania
Examples
## Not run: ## Plot filtered estimates of a GAS model estimated on the## Quarterly logarithmic change in percentage points of the Consumer Price Index data set (cpichg)library("GAS")data("cpichg")GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity", GASPar = list(location = TRUE, scale = TRUE, shape = FALSE))Fit = UniGASFit(GASSpec, cpichg)plot(Fit, which = 1)## End(Not run)Data: Daily logarithmic returns in percentage points of the S&P500 index from 1950-01-04 to 2016-06-24
Description
Daily logarithmic returns in percentage points of the S&P500 index from 1950-01-04 to 2016-06-24obtained from yahoo finance.
Usage
data("sp500ret")Format
A xts object of dimension 16,727 x 1 containing the daily logarithmicreturns in percentage points from 1950-01-04 to 2016-06-24.
Source
Yahoo Finance
Data: SP500 Daily 5 minutes Realized Volatility from 2000-01-03 to 2000-01-10
Description
Oxford-Man Institute Daily 5 minutes Realized Volatility from 2000-01-03 to 2000-01-10for the SP500 Index available athttps://realized.oxford-man.ox.ac.uk/data.
Usage
data("sp500rv")Format
A xts object containing 4,310 observations from 2000-01-03 to 2000-01-10.
References
https://realized.oxford-man.ox.ac.uk/data
Data from Bien et al (2011).
Description
From the readme.bnp.txt file in the JAE Data Archive available athttp://qed.econ.queensu.ca/jae/2011-v26.4/bien-nolte-pohlmeier/:
The high-frequency data used in the paper come from the Trades and Quotation(TAQ) database. The data contains time-stamped quotations of Citicorp stocktraded at the NYSE over the period from 20th February to 23rd February 2001.
In the study, 30-second bid and ask quote changes are constructed from theirregularly-spaced quote data. The study covers observations recorded from9:35 EST until 16:00 EST.
The data contains 3080 rows and eight columns - in order:
1.year2.month3.day4.time in number of seconds after the 9:35 EST5.best ask quote6.best bid quote7.30-second change of the ask quote in number of ticks8.30-second change of the bid quote in number of ticks.
Usage
data("tqdata")Format
Adata.frame object containing 3,080 observat. ions.
References
Bien K, Nolte, I, Pohlmeier W (2011)."An Inflated Multivariate Integer Count Hurdle Model: An Application to Bid and Ask Quote Dynamics".Journal of Applied Econometrics, 26(4), 669-707.doi:10.1002/jae.1122
Class for the univariate GAS fitted object
Description
Class for the univariate GAS fitted object.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
ModelInfo:Object of class
list. Contains information about the GAS specification:Spec: object of the classuGASSpec containing the GAS specification.iT:numericnumber of observation.elapsedTime:numericelapsed Time in seconds.
GASDyn:Object of class
list. Contains: the series of filtered dynamic (GASDyn$mTheta)for the time–varying parameters, the series of scaled scores (GASDyn$mInnovation), the series ofunrestricted filtered parameters (GASDyn$mTheta_tilde), the series of logdensities (GASDyn$vLLK), the log likelihood evaluated at its optimum value (GASDyn$dLLK)
.
Estimates:Object of class
list. Contains:lParListlist ofestimated parameters,optimiserobject delivered from the optimizationfunction,StaticFitML estimates for the constant model,Inferenceinferential results for the estimated parameters.Data:The user's data.
Testing:Statistical tests results.
Methods
showsignature(object = 'uGASFit'): print object information.summarysignature(object = 'uGASFit'): Show summary.plotsignature(x = 'uGASFit',y = 'missing'): Plot filtered dynamic and other estimated quantities.getFilteredParameterssignature(object = 'uGASFit'): Extract filtered parameters.getObssignature(object = 'uGASFit'): Extract original observations.coefsignature(object = 'uGASFit'): Returns a named vector of estimated coefficients.Also accepts the additional logical argumentdo.list. Ifdo.list = TRUE, estimated coefficientsare organized in a list with arguments:vKappathe intercept vector,mAthe A system matrix,mBthe B system matrix. By default,do.list = FALSE.pitsignature(object = 'uGASFit'): Extract Probability Integral Transformation.getMomentssignature(object = 'uGASFit'): Extract conditional moments.residualssignature(object = 'uGASFit'): Extract the residuals.Also accepts the additional logical argumentstandardize. Ifstandardize = TRUE,residuals are standardized by the filtered standard deviation. By defaultstandardize = FALSE.convergencesignature(object = 'uGASFit'): Extract convergence information.quantilesignature(object = 'uGASSim'): Compute quantiles of the filtered estimated density at each point in time. It accepts the additional argumentprobsrepresenting the vector of probabilities.ESsignature(object = 'uGASSim'): Compute Expected Shortfall of the filtered estimated density at each point in time. It accepts the additional argumentprobsrepresenting the vector of probabilities.
Author(s)
Leopoldo Catania
Class for the univariate GAS forecast object
Description
Class for the univariate GAS forecast object.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
Forecast:Object of class
list. Contains forecasts:PointForecast:matrixwith parameters forecasts.Moments:matrixwith centered moments forecasts.vLS:numericLog Score (Predictive Log Likelihood).vU:numericOut-of-sample Probability Integral Transformation (PIT).
Bands:arraywith confidence bands parameters forecasts. Available only ifRoll = TRUE.Draws:If
ReturnsDraws = TRUEit is a iH x iBmatrixof draws from the predictive distribution.Info:listwith forecast information.Data:listwith original data.
Methods
showsignature(object = 'uGASFor'): Show summary.plotsignature(x = 'uGASFor', y = 'missing'): Plot forecasted quantities.getForecastsignature(object = 'uGASFor'): Extract parameters forecast.getObssignature(object = 'uGASFor'): Extract original observations.pitsignature(object = 'uGASFor'): Extract Probability Integral Transformation, only ifRoll = TRUE.quantilesignature(object = 'uGASFor'): Extract quantile forecasts. For multistep ahead prediction ES is computed by simulation andReturnsDraws = TRUEshould have been selected. It accepts the additional argumentprobsrepresenting the vector of probabilities.ESsignature(object = 'uGASFor'): Extract Expected Shortfall forecasts. For multistep ahead prediction ES is computed by simulation andReturnsDraws = TRUEshould have been selected. It accepts the additional argumentprobsrepresenting the vector of probabilities.getMomentssignature(object = 'uGASFor'): Extract moments forecasts.LogScoresignature(object = 'uGASFor'): Extract Log Scores.
Author(s)
Leopoldo Catania
Class for the univariate GAS rolling object
Description
Class for the univariate GAS rolling object.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
Forecast:Object of class
list. Contains forecasts:PointForecast:matrixwith parameters forecasts.Moments:matrixwith centered moments forecasts.vLS:numericLog Score (Predictive Log Likelihood).vU:numericOut-of-sample Probability Integral Transformation (PIT).
Info:listwith forecast information.Data:listwith original data.Testing:Statistical tests results.
Methods
showsignature(object = 'uGASRoll'): Show summary.plotsignature(x = 'uGASRoll', y = 'missing'): Plot forecasted quantities.getForecastsignature(object = 'uGASRoll'): Extract parameters forecast.getObssignature(object = 'uGASRoll'): Extract original observations.pitsignature(object = 'uGASRoll'): Extract Probability Integral Transformation,only ifRoll = TRUEquantilesignature(object = 'uGASRoll'): Extract quantile forecasts.It accepts the addional argumentprobsrepresenting the vector of probabilities.ESsignature(object = 'uGASRoll'): Extract Expected Shortfall forecasts.It accepts the addional argumentprobsrepresenting the vector of probabilities.getMomentssignature(object = 'uGASRoll'): Extract moments forecasts.LogScoresignature(object = 'uGASRoll'): Extract Log Scores.residualssignature(object = 'uGASRoll'): Extract the forecast errors.Also accepts the additional logical argumentstandardize. Ifstandardize = TRUE,forecast errors are standardized by the forecast standard deviation. By defaultstandardize = FALSE.coefsignature(object = 'uGASFit'): Returns a matrix of estimated coefficients.Each row of the matrix corresponds to a refit of the model during the forecast period according to theRefitEveryargument provided in theUniGASRoll function.Also accepts the additional logical argumentdo.list. Ifdo.list = TRUE, estimated coefficientsare organized in a list of lists according according to theRefitEveryargument providedin theUniGASRoll function. Each list is populated by three arguments:vKappathe intercept vector,mAthe A system matrix,mBthe B system matrix.By default,do.list = FALSE.
Author(s)
Leopoldo Catania
Class for Univariate GAS Simulation
Description
Class for Univariate GAS model Simulation.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
ModelInfo:Object of class
list. Contains information about the univariate GAS specification:iTnumericTime length of simulated observations.iKnumericNumber of (possibly) time-varying parameters implied by the distributional assumption.vKappanumericVector of unconditional level for the reparametrised vector of parameters.mAmatrixOf coefficients of dimension iK x iK that premultiply the conditional score in the GAS updating recursion.mBmatrixOf autoregressive coefficients of dimension iK x iK.DistcharacterLabel of the conditional distribution, seeDistInfoScalingTypecharacterRepresenting the scaling mechanism for the conditional score, seeDistInfo.
GASDyn:Object of class
list. Contains: the series of simulated parameters (GASDyn$mTheta), the series of scaled scores (GASDyn$mInnovation), the series of unrestricted simulated parameters (GASDyn$mTheta_tilde), the series of log densities (GASDyn$vLLK), the log likelihood evaluated at its optimum value (GASDyn$dLLK).Data:Object of class
numeric. Vector of lengthiTof simulated data.
Methods
showsignature(object = 'uGASSim'): Show summary.plotsignature(x = 'uGASSim', y = 'missing'): Plot simulated data and parameters.getFilteredParameterssignature(object = 'uGASSim'): Extract simulated parameters.getObssignature(object = 'uGASSim'): Extract simulated observations.coefsignature(object = 'uGASSim'): Extract delivered coefficients.quantilesignature(object = 'uGASSim'): Compute quantiles of the filtered simulated density at each point in time. It accepts the additional argumentprobsrepresenting the vector of probabilities.ESsignature(object = 'uGASSim'): Compute the Expected Shortfall of the filtered simulated density at each point in time. It accepts the additional argumentprobsrepresenting the vector of probabilities.
Author(s)
Leopoldo Catania
Class for the univariate GAS model specification
Description
Class for the univariate GAS model specification.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
Spec:Object of class
list. Contains information about the univariate GAS specification:Dist:charactercontaining the conditional distribution assumption.ScalingType:characterindicating the scaling mechanism for the conditional score.iK:numericrepresenting the number of (possibly) time-varying parameters implied by the distributional assumption.GASParlistwith elements:location,scale,skewness,shape,shape2.
Methods
showsignature(object = 'uGASSpec'): Show summary.
Author(s)
Leopoldo Catania
US Monthly Civilian Unemployment Rate (UNRATE) from 1948-01-01 to 2016-05-01
Description
Fromhttps://fred.stlouisfed.org/series/UNRATE:The unemployment rate represents the number of unemployed as a percentage of the labor force. Labor force data are restricted to people 16 years of age and older, who currently reside in 1 of the 50 states or the District of Columbia, who do not reside in institutions (e.g., penal and mental facilities, homes for the aged), and who are not on active duty in the Armed Forces.
Usage
data("usunp")Format
A xts object containing 821 observations from 1948-01-01 to 2016-05-01.
References
US. Bureau of Labor Statistics, Civilian Unemployment Rate [UNRATE], retrieved from FRED, Federal Reserve Bank of St. Louis;https://fred.stlouisfed.org/series/UNRATE, July 2, 2016.