| Top |
| kalman * | kalman_new () |
| kalman * | kalman_new_minimal () |
| void | kalman_free () |
| int | kalman_forecast () |
| double | kalman_get_loglik () |
| double | kalman_get_arma_variance () |
| gretl_matrix * | kalman_arma_smooth () |
| gretl_matrix * | kalman_smooth () |
| int | kalman_set_initial_state_vector () |
| int | kalman_set_initial_MSE_matrix () |
| void | kalman_set_nonshift () |
| void | kalman_set_options () |
| int | kalman_get_options () |
| void | kalman_attach_data () |
| void * | kalman_get_data () |
| void | kalman_attach_printer () |
| PRN * | kalman_get_printer () |
kalman * kalman_new (gretl_matrix *S,gretl_matrix *P,gretl_matrix *F,gretl_matrix *A,gretl_matrix *H,gretl_matrix *Q,gretl_matrix *R,gretl_matrix *y,gretl_matrix *x,gretl_matrix *m,gretl_matrix *E,int *err);
Allocates and initializes a Kalman struct, which can subsequently
be used for forecasting with kalman_forecast(). The nomenclature
for the various required matrices is that in Hamilton's Time
Series Analysis (1994, chapter 13), except that "S" is used in
place of Hamilton's \xi for the state vector.
S |
r x 1 initial state vector. |
|
P |
r x r initial precision matrix. |
|
F |
r x r state transition matrix. |
|
A |
n x k matrix of coefficients on exogenous variables in the observation equation. |
|
H |
n x r matrix of coefficients on the state variables in the observation equation. |
|
Q |
r x r contemporaneous covariance matrix for the errors in the state equation. |
|
R |
n x n contemporaneous covariance matrix for the errors in the observation equation (or NULL if this is not applicable). |
|
y |
T x n matrix of dependent variable(s). |
|
x |
T x k matrix of exogenous variable(s). May be NULL if there are no exogenous variables, or if there's only a constant. |
|
m |
r x 1 vector of constants in the state transition, or NULL. |
|
E |
T x n matrix in which to record forecast errors (or NULL if this is not required). |
|
err |
location to receive error code. |
kalman * kalman_new_minimal (gretl_matrix *M[],int copy[],int nmat,int *err);
int kalman_forecast (kalman *K,PRN *prn);
Generates a series of one-step ahead forecasts for y, based on
information entered initially using kalman_new(), and possibly
modified using kalman_set_initial_state_vector() and/or
kalman_set_initial_MSE_matrix(). The log-likelihood is
calculated for the sequence of forecast errors on the assumption
of normality: this can be accessed using kalman_get_loglik().
double
kalman_get_loglik (const kalman *K);
Retrieves the log-likelhood calculated via a run of
kalman_forecast().
double
kalman_get_arma_variance (const kalman *K);
Retrieves the estimated variance for an ARMA model estimated using the Kalman filter.
gretl_matrix * kalman_arma_smooth (kalman *K,int *err);
Runs a filtering pass followed by a smoothing pass.
gretl_matrix * kalman_smooth (kalman *K,gretl_matrix **pP,gretl_matrix **pU,int *err);
Runs a filtering pass followed by a backward, smoothing pass.
At present the pU
argument is experimental and a bodge: it will
not actually do anything unless pP
is left NULL.
int kalman_set_initial_state_vector (kalman *K,const gretl_matrix *S);
Resets the initial value of the state vector in a Kalman
struct, using the values from S
. See also kalman_new().
int kalman_set_initial_MSE_matrix (kalman *K,const gretl_matrix *P);
Resets the initial value of the MSE matrix in a Kalman
struct, using the values from P
. See also kalman_new().