PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_tsa_uni_garch_exp_estim (g13fg)
Purpose
nag_tsa_uni_garch_exp_estim (g13fg) estimates the parameters of a univariate regression-exponential
process (see
Engle and Ng (1993)).
Syntax
[
theta,
se,
sc,
covr,
hp,
et,
ht,
lgf,
ifail] = g13fg(
dist,
yt,
x,
ip,
iq,
nreg,
mn,
theta,
hp,
copts,
maxit,
tol, 'num',
num, 'npar',
npar)
[
theta,
se,
sc,
covr,
hp,
et,
ht,
lgf,
ifail] = nag_tsa_uni_garch_exp_estim(
dist,
yt,
x,
ip,
iq,
nreg,
mn,
theta,
hp,
copts,
maxit,
tol, 'num',
num, 'npar',
npar)
Note: the interface to this routine has changed since earlier releases of the toolbox:
At Mark 25: |
nreg was made optional |
Description
A univariate regression-exponential
process, with
coefficients
, for
,
coefficients
, for
,
coefficients,
, for
, and
linear regression coefficients
, for
, can be represented by:
where
,
denotes the expected value of
and
or
. Here
is a standardized Student's
-distribution with
degrees of freedom and variance
,
is the number of terms in the sequence,
denotes the endogenous variables,
the exogenous variables,
the regression mean,
the regression coefficients,
the residuals,
the conditional variance,
the number of degrees of freedom of the Student's
-distribution, and
the set of all information up to time
.
nag_tsa_uni_garch_exp_estim (g13fg) provides an estimate , for the vector where , when , and when .
mn,
nreg can be used to simplify the
expression in
(1) as follows:
No Regression and No Mean
- ,
- ,
- and
- is a vector when , and a vector, when .
No Regression
- ,
- ,
- and
- is a vector when and a vector, when .
Note: if the
, where
is known (not to be estimated by
nag_tsa_uni_garch_exp_estim (g13fg)) then
(1) can be written as
, where
. This corresponds to the case
No Regression and No Mean, with
replaced by
.
No Mean
- ,
- ,
- and
- is a vector when and a vector, when .
References
Bollerslev T (1986) Generalised autoregressive conditional heteroskedasticity Journal of Econometrics 31 307–327
Engle R (1982) Autoregressive conditional heteroskedasticity with estimates of the variance of United Kingdom inflation Econometrica 50 987–1008
Engle R and Ng V (1993) Measuring and testing the impact of news on volatility Journal of Finance 48 1749–1777
Glosten L, Jagannathan R and Runkle D (1993) Relationship between the expected value and the volatility of nominal excess return on stocks Journal of Finance 48 1779–1801
Hamilton J (1994) Time Series Analysis Princeton University Press
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
The type of distribution to use for
.
- A Normal distribution is used.
- A Student's -distribution is used.
Constraint:
or .
- 2:
– double array
-
The sequence of observations,
, for .
- 3:
– double array
-
The first dimension of the array
x must be at least
.
The second dimension of the array
x must be at least
.
Row
of
x must contain the time dependent exogenous vector
, where
, for
.
- 4:
– int64int32nag_int scalar
-
The number of coefficients,
, for .
Constraint:
(see also
npar).
- 5:
– int64int32nag_int scalar
-
The number of coefficients,
, for .
Constraint:
(see also
npar).
- 6:
– int64int32nag_int scalar
-
, the number of regression coefficients.
Constraint:
(see also
npar).
- 7:
– int64int32nag_int scalar
-
If , the mean term will be included in the model.
Constraint:
or .
- 8:
– double array
-
The initial parameter estimates for the vector
.
The first element must contain the coefficient
and the next
iq elements must contain the autoregressive coefficients
, for
.
The next
iq elements contain the coefficients
, for
.
The next
ip elements must contain the moving average coefficients
, for
.
If , the next element must contain an estimate for , the number of degrees of freedom of the Student's -distribution.
If , the next element must contain the mean term .
If
, the remaining
nreg elements are taken as initial estimates of the linear regression coefficients
, for
.
- 9:
– double scalar
-
If
then
hp is the value to be used for the pre-observed conditional variance, otherwise
hp is not referenced.
- 10:
– logical scalar
-
If , the function provides initial parameter estimates of the regression terms, otherwise these are provided by you.
- 11:
– int64int32nag_int scalar
-
The maximum number of iterations to be used by the optimization function when estimating the parameters.
Constraint:
.
- 12:
– double scalar
-
The tolerance to be used by the optimization function when estimating the parameters.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the dimension of the array
yt and the first dimension of the array
x. (An error is raised if these dimensions are not equal.)
, the number of terms in the sequence.
Constraints:
- ;
- .
- 2:
– int64int32nag_int scalar
-
Default:
the dimension of the array
theta.
The number of parameters to be included in the model. when and when .
Constraint:
.
Output Parameters
- 1:
– double array
-
The estimated values
for the vector
.
The first element contains the coefficient
and the next
iq elements contain the coefficients
, for
.
The next
iq elements contain the coefficients
, for
.
The next
ip elements are the moving average coefficients
, for
.
If , the next element contains an estimate for then the number of degrees of freedom of the Student's -distribution.
If , the next element contains an estimate for the mean term .
The final
nreg elements are the estimated linear regression coefficients
, for
.
- 2:
– double array
-
The standard errors for
.
The first element contains the standard error for
and the next
iq elements contain the standard errors for
, for
. The next
iq elements contain the standard errors for
, for
. The next
ip elements are the standard errors for
, for
.
If , the next element contains the standard error for , the number of degrees of freedom of the Student's -distribution.
If , the next element contains the standard error for .
The final
nreg elements are the standard errors for
, for
.
- 3:
– double array
-
The scores for
.
The first element contains the scores for
, the next
iq elements contain the scores for
, for
, the next
iq elements contain the scores for
, for
, the next
ip elements are the scores for
, for
.
If , the next element contains the scores for , the number of degrees of freedom of the Student's -distribution.
If , the next element contains the score for .
The final
nreg elements are the scores for
, for
.
- 4:
– double array
-
The covariance matrix of the parameter estimates , that is the inverse of the Fisher Information Matrix.
- 5:
– double scalar
-
If
then
hp is the estimated value of the pre-observed conditional variance.
- 6:
– double array
-
The estimated residuals,
, for .
- 7:
– double array
-
The estimated conditional variances,
, for .
- 8:
– double scalar
-
The value of the log-likelihood function at .
- 9:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Note: nag_tsa_uni_garch_exp_estim (g13fg) may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the function:
-
-
On entry, | , |
or | , |
or | , |
or | , |
or | , |
or | , |
or | npar has an invalid value, |
or | , |
or | , |
or | , |
or | , |
or | , |
or | , |
or | . |
-
-
On entry, | . |
-
-
The matrix is not full rank.
-
-
The information matrix is not positive definite.
-
-
The maximum number of iterations has been reached.
-
-
The log-likelihood cannot be optimized any further.
-
-
No feasible model parameters could be found.
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
Not applicable.
Further Comments
None.
Example
This example fits a model with Student's -distributed residuals to some simulated data.
The process parameter estimates,
, are obtained using
nag_tsa_uni_garch_exp_estim (g13fg), and a four step ahead volatility estimate is computed using
nag_tsa_uni_garch_exp_forecast (g13fh).
Open in the MATLAB editor:
g13fg_example
function g13fg_example
fprintf('g13fg example results\n\n');
num = 100;
mn = int64(1);
nreg = int64(2);
yt = [7.53; 6.64; 7.39; 7.15; 6.42; 6.32; 6.98; 7.09; 6.63; 6.93;
7.01; 5.30; 7.86; 6.73; 7.39; 5.61; 7.02; 6.04; 7.46; 4.33;
6.02; 6.37; 3.93; 7.24; 8.58; 5.70; 9.13; 7.99; 7.79; 6.13;
8.78; 6.52; 6.79; 7.77; 7.31; 7.58; 8.78; 7.39; 8.00; 7.07;
7.65; 9.15; 8.32; 7.32; 7.58; 9.78; 8.17; 9.26; 7.79; 7.03;
7.45; 7.09; 8.06; 7.06; 9.91; 7.01; 8.32; 6.41; 8.59; 8.55;
7.77; 8.04; 9.54; 8.28; 7.97; 8.42; 8.30; 7.98; 7.60; 8.77;
7.54; 7.40; 9.26; 7.30; 9.33; 9.54; 8.08; 6.93; 4.27; 2.65;
5.03; 0.91;12.63;10.87; 9.26; 8.30; 6.85; 7.48; 9.67; 9.54;
7.33; 8.84; 7.75; 8.12; 7.29; 8.58; 7.80; 3.07; 9.33;16.91];
x = [ 2.40, 0.12; 2.40, 0.12; 2.40, 0.13; 2.40, 0.14;
2.40, 0.14; 2.40, 0.15; 2.40, 0.16; 2.40, 0.16;
2.40, 0.17; 2.41, 0.18; 2.41, 0.19; 2.41, 0.19;
2.41, 0.20; 2.41, 0.21; 2.41, 0.21; 2.41, 0.22;
2.41, 0.23; 2.41, 0.23; 2.41, 0.24; 2.42, 0.25;
2.42, 0.25; 2.42, 0.26; 2.42, 0.26; 2.42, 0.27;
2.42, 0.28; 2.42, 0.28; 2.42, 0.29; 2.42, 0.30;
2.42, 0.30; 2.43, 0.31; 2.43, 0.32; 2.43, 0.32;
2.43, 0.33; 2.43, 0.33; 2.43, 0.34; 2.43, 0.35;
2.43, 0.35; 2.43, 0.36; 2.43, 0.37; 2.44, 0.37;
2.44, 0.38; 2.44, 0.38; 2.44, 0.39; 2.44, 0.39;
2.44, 0.40; 2.44, 0.41; 2.44, 0.41; 2.44, 0.42;
2.44, 0.42; 2.45, 0.43; 2.45, 0.43; 2.45, 0.44;
2.45, 0.45; 2.45, 0.45; 2.45, 0.46; 2.45, 0.46;
2.45, 0.47; 2.45, 0.47; 2.45, 0.48; 2.46, 0.48;
2.46, 0.49; 2.46, 0.49; 2.46, 0.50; 2.46, 0.50;
2.46, 0.51; 2.46, 0.51; 2.46, 0.52; 2.46, 0.52;
2.46, 0.53; 2.47, 0.53; 2.47, 0.54; 2.47, 0.54;
2.47, 0.54; 2.47, 0.55; 2.47, 0.55; 2.47, 0.56;
2.47, 0.56; 2.47, 0.57; 2.47, 0.57; 2.48, 0.57;
2.48, 0.58; 2.48, 0.58; 2.48, 0.59; 2.48, 0.59;
2.48, 0.59; 2.48, 0.60; 2.48, 0.60; 2.48, 0.61;
2.48, 0.61; 2.49, 0.61; 2.49, 0.62; 2.49, 0.62;
2.49, 0.62; 2.49, 0.63; 2.49, 0.63; 2.49, 0.63;
2.49, 0.64; 2.49, 0.64; 2.49, 0.64; 2.50, 0.64];
dist = 't';
ip = int64(1);
iq = int64(2);
copts = true;
maxit = int64(200);
tol = 0.00001;
theta = [0.05; -0.15; -0.05; 0.05; 0.15; 0.35; 3.25; 1.5; 0; 0];
nt = int64(4);
[theta, se, sc, covar, hp, et, ht, lgf, ifail] = ...
g13fg( ...
dist, yt, x, ip, iq, mn, theta, 0, ...
copts, maxit, tol, 'ifail', int64(-1));
[fht, ifail] = g13fh( ...
nt, ip, iq, theta, ht, et);
fprintf('\n Parameter Standard\n');
fprintf(' estimates errors\n');
fprintf('Alpha0 %16.2f%16.2f\n', theta(1), se(1));
l = 2;
for i = l:l+iq-1
fprintf('Alpha%d %16.2f%16.2f\n', i-1, theta(i), se(i));
end
l = l+iq;
for i = l:l+iq-1
fprintf(' Psi%d %16.2f%16.2f\n', i-l+1, theta(i), se(i));
end
l = l+iq;
fprintf('\n');
for i = l:l+ip-1
fprintf(' Beta%d %16.2f%16.2f\n', i-l+1, theta(i), se(i));
end
l = l+ip;
if (dist == 't')
fprintf('\n DF %16.2f%16.2f\n', theta(l), se(l));
l = l + 1;
end
if (mn == 1)
fprintf('\n B0 %16.2f%16.2f\n', theta(l), se(l));
l = l + 1;
end
for i = l:l+nreg-1
fprintf(' B%d %16.2f%16.2f\n', i-l+1, theta(i), se(i));
end
fprintf('\nVolatility forecast = %12.4f\n', fht(nt));
g13fg example results
Parameter Standard
estimates errors
Alpha0 0.17 0.19
Alpha1 -0.65 0.23
Alpha2 -0.44 0.24
Psi1 -0.06 0.22
Psi2 0.35 0.25
Beta1 0.42 0.17
DF 5.59 3.75
B0 128.75 42.09
B1 -51.74 17.78
B2 13.01 3.40
Volatility forecast = 1.3404
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015