**R – datawookie**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)

Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t.

Setting the values of one or more parameters for a GARCH model or applying constraints to the range of permissible values can be useful.

The art of the econometrician consists in finding the set of assumptions which are both sufficiently specific and sufficiently realistic to allow him to take the best possible advantage of the data available to him. Edmond Malinvaud, “Statistical Methods of Econometrics”

If you have insight into the values or ranges for specific parameters then you can use the `setfixed()`

and `setbounds()`

functions to set these before fitting the model.

## Reference Model

Let’s start by creating a reference model using a Standard GARCH model with Skewed Student-t Distribution fore residuals and an AR(1) model for the mean.

specification <- ugarchspec( mean.model = list(armaOrder = c(1, 0)), variance.model = list(model = "sGARCH"), distribution.model = "sstd" ) specification *---------------------------------* * GARCH Model Spec * *---------------------------------* Conditional Variance Dynamics ------------------------------------ GARCH Model : sGARCH(1,1) Variance Targeting : FALSE Conditional Mean Dynamics ------------------------------------ Mean Model : ARFIMA(1,0,0) Include Mean : TRUE GARCH-in-Mean : FALSE Conditional Distribution ------------------------------------ Distribution : sstd Includes Skew : TRUE Includes Shape : TRUE Includes Lambda : FALSE

Fit that to the data and check the coefficients.

fit <- ugarchfit(data = TATASTEEL, spec = specification) Estimate Std. Error t value Pr(>|t|) mu 0.001 0.001 2.500 0.012 ar1 -0.031 0.025 -1.242 0.214 omega 0.000 0.000 1.471 0.141 alpha1 0.038 0.005 7.270 0.000 beta1 0.951 0.007 134.613 0.000 skew 1.045 0.036 28.858 0.000 shape 5.072 0.657 7.721 0.000

Neither of the values for `ar1`

or `omega`

appear to be significantly different to zero.

## Restricted GARCH: Specified Parameter Values

Let’s test the `setfixed()`

function. Restrict the model by imposing fixed values for `ar1`

and `omega`

.

restricted <- specification setfixed(restricted) <- list(ar1 = 0, omega = 0) restricted *---------------------------------* * GARCH Model Spec * *---------------------------------* Conditional Variance Dynamics ------------------------------------ GARCH Model : sGARCH(1,1) Variance Targeting : FALSE Conditional Mean Dynamics ------------------------------------ Mean Model : ARFIMA(1,0,0) Include Mean : TRUE GARCH-in-Mean : FALSE Conditional Distribution ------------------------------------ Distribution : sstd Includes Skew : TRUE Includes Shape : TRUE Includes Lambda : FALSE

Fit the restricted model.

fit <- ugarchfit(data = TATASTEEL, spec = restricted) Estimate Std. Error t value Pr(>|t|) mu 0.001 0.001 2.242 0.025 ar1 0.000 NA NA NA omega 0.000 NA NA NA alpha1 0.030 0.004 7.257 0.000 beta1 0.969 0.004 237.205 0.000 skew 1.041 0.034 30.432 0.000 shape 5.723 0.717 7.978 0.000

Note that the values for `ar1`

and `omega`

are those prescribed but that the remaining parameters have been fit to the data. Since these parameters are not being fit to the data we get neither a `(t)`

nor `(p)`

-value.

## Restricted GARCH: Specified Parameter Ranges

Suppose that, rather than specific values, you want to constrain a parameter to values in a particular range.

ranges <- specification setbounds(ranges) <- list(shape = c(10, 100))

That range encompasses the value obtained for `shape`

in the reference model.

Estimate the bound constrained model.

fit <- ugarchfit(data = TATASTEEL, spec = ranges) coef(fit) NULL

Hmmmm. There are no coefficients? What has gone wrong here?

This is a somewhat subtle problem. The values assigned to the model parameters are obtained by numerical optimisation. The optimisation procedure assumes initial values for the model parameters and then iteratively refines those values until it converges on an optimal solution. Where do those initial values come from? They are chosen empirically as “good” (but also random) values. What has happened here is that the initial value for `shape`

lies outside the range specified by `setbounds()`

, so the optimisation algorithm finds that the initial set of parameter values doesn’t satisfy the constraints. And because the initial parameters are invalid it cannot proceed. The default initial values are generally very good but they can fail when constraints are imposed!

We can fix this by using `setstart()`

to set an initial value for the `shape`

parameter that lies within the permitted range.

setstart(ranges) <- list(shape = 50)

This can be done for multiple parameters. Now fit the model and check the coefficients.

fit <- ugarchfit(data = TATASTEEL, spec = ranges) coef(fit) mu ar1 omega alpha1 beta1 1.475421e-03 -2.510039e-02 7.619083e-06 3.601476e-02 9.483590e-01 skew shape 1.039648e+00 1.000000e+01

Aha! Valid parameters. And the value obtained for `shape`

lies within the specified range.

**leave a comment**for the author, please follow the link and comment on their blog:

**R – datawookie**.

R-bloggers.com offers **daily e-mail updates** about R news and tutorials about learning R and many other topics. Click here if you’re looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t.

**Continue reading**: Parameter Constraints & Significance

## Understanding Parameter Constraints and Significance

**R-bloggers** recently published an article on R that explored the topic of parameter constraints and significance. It specifically focused on the GARCH (Generalised Autoregressive Conditional Heteroskedasticity) model within econometrics.

“The art of the econometrician consists in finding the set of assumptions which are both sufficiently specific and sufficiently realistic to allow him to take the best possible advantage of the data available to him.” Edmond Malinvaud, “Statistical Methods of Econometrics”

### Key Takeaways from the Article and Long-term Implications

- The manipulation of parameter values within the GARCH model and the application of parameter constraints, can offer greater flexibility and preciseness to your data analysis.
- The use of the functions ‘setfixed()’ and ‘setbounds()’ can be valuable for setting specific parameters and substituting constraints to values within predefined ranges prior to model fitting.
- Essentially, setting appropriate parameter constraints and initial values addresses the problem of algorithmic optimization. Thus, gaining a sound understanding of how to apply these principles during model optimization ensures the system can quickly reach a solution that best fits the data.

### Anticipated Future Developments

- The future will bring ameliorated algorithms that are more perceptible to initial parameter configurations, and can enact optimised parameter constraints more accurately and quickly.
- As we accumulate more data, and retaining computational efficiency becomes more critical, the need to master techniques such as parameter buffering and condensing will become more essential in econometrics.
- A deeper understanding of this area will lead to data insights of greater accuracy, predictability, and robustness.

### Actionable Insights: Effective Model Optimisation

- Ensure you have a high-level understanding of the properties and data requirements your model is designed to use. Comprehend the behaviour of your data, including the underlying assumptions, as this knowledge will guide you when setting parameters and constraints.
- Remember that granulating constraints and setting parameter increments can demonstrate considerable results in limiting model computation time and improving the precision of the models.
- Keep abreast of developments in econometrics and machine learning, as improvements in algorithms and processing capabilities are likely to provide new strategies for model optimization.

This article is a powerful reminder that well-considered parameter constraints, applied with a solid comprehension of the data at hand, can significantly bolster the accuracy and speed of your econometric models.