| addPriorConditions {bayesGARCH} | R Documentation |
Add prior conditions on the model parameters.
addPriorConditions(psi)
psi |
model parameters regrouped within a 4x1 vector psi:=(alpha0 alpha1 beta nu)'. |
The function addPriorConditions allows to add prior conditions on the model
parameters psi:=(alpha0 alpha1 beta nu)'. The
function must return TRUE if the constraint holds and
FALSE otherwise.
By default, the function is:
addPriorConditions <- function(psi)
{
TRUE
}
and therefore does not add any other constraint than the positivity of
the parameters which are obtained through the prior distribution
for psi. See bayesGARCH for further details.
You simply need to modify AddPriorConditions in order to add
constraints on the model parameters psi. For instance, to impose the
covariance-stationary conditions to hold,
i.e. α_1 + β < 1, just redefine
the function addPriorConditions as follows:
addPriorConditions <- function(psi)
{
psi[2] + psi[3] < 1
}
Finally, note that adding prior constraints on the model parameters can diminish the acceptance rate and therefore lead to a very inefficient sampler. This would however indicate that the condition is not supported by the data.
Please cite the package in publications. Use citation("bayesGARCH").
David Ardia <david.ardia@unifr.ch>.
bayesGARCH for the Bayesian estimation of the GARCH(1,1)
model with Student-t innovations.
## DON'T FORGET TO UPDATE THE NAMESPACE FUNCTION TO RENDER
## THE MODIFICATION EFFECTIVE
## ==> assignInNamespace("addPriorConditions", addPriorConditions, "bayesGARCH")
## COVARIANCE STATIONARITY REQUIRED
addPriorConditions <- function(psi)
{
psi[2] + psi[3] < 1
}
## ALPHA1 > 0.3, BETA < 1, ALPHA1 + BETA < 0.8
addPriorConditions <- function(psi)
{
(psi[2] > 0.3) & (psi[3] < 1) & (psi[2] + psi[3] < 0.8)
}
## BETA < 0.1, 4 < NU < 15
addPriorConditions <- function(psi)
{
(psi[3] < 0.1) & (psi[4] < 15)
}
## AND THE CONSTRAINT 4 < NU IS INTEGRATED THROUGH THE PRIOR
## IN bayesGARCH(y, delta = 4)