<< filter_like Kalman filter estimation smoothing >>

Grocer >> Kalman filter estimation > kalman

kalman

Kalman filter estimation

CALLING SEQUENCE

[rkalman]=kalman(func,y,x,z,F,param,arg1,...,argn)

PARAMETERS

Input

* func = the function which transforms the parameters into the matrix of variances (Q and R)

* y = (nobs x 1) dependent variable vector

* x = (nobs x 1) explanatory variable matrix

* z = (nxl) data matrix of exogenous variables (or [] if there are no exogenous variables in the model) .TP

* F = the transfer matrix

* param = a vector of parameters (sqrt of variances)

* argi = optional arguments which can be:

  - 'priorb0=x' where x is (k x 1) vector with prior b0 values (default = zeros(k,1), diffuse)

  - 'priorv0=x' where x = (k x k) matrix with prior variance for Q (default = eye(k)*1e+5, a diffuse prior)

  -  'optfunc=optim' if the user wants to use the optim optimisation function (default: optimg)

  -  'opt_nelmead=crit,nitermax' with crit the value of the convergence criterion in the Nelder-Meade optimisation function and nitermax the maximum number of iterations (default = 'opt_nelmead=2*%eps,1000')

  -  'opt_optim=opts' where opts are options for optim that can be entered after the starting value of the parameters (default = 'opt_optim=,''ar'',1e6,1e6'')

  -  'opt_convg=val' where val is the threshold on gradient norm (default = 'opt_convg=1e-5')

 

Output

* rkalman = a results tlist with

  - rkalman('meth') = 'kalman'

  - rkalman('Q') = estimated Q

  - rkalman('R') = estimated R

  - rkalman('priorb0') = B(0/0)

  - rkalman('priorv0') = sigma(0/0)

  - rkalman('betat') = B(t/t)

  - rkalman('betaf') = B(t/t-1)

  - rkalman('betas') = B(t/T)

  - rkalman('sigmatt') = sigma(t/t)

  - rkalman('sigmatf') = sigma(t/t-1)

  - rkalman('sigmats') = sigma(t/T)

  - rkalman('param') = estimated parameters

  - rkalman('vcov') = variance-covariance matrix of estimated parameters

  - rkalman('tstat') = Student's t of estimated parameters

  - rkalman('y') = y

  - rkalman('x') = x

  - rkalman('yhat') = X(t)*B(t)

  - rkalman('resid') = y-X*B(t)

  - rkalman('like') = log-likelihood

  - rkalman('nobs') = # of observations

  - rkalman('nvar') = # of exogenous variables

DESCRIPTION

Maximum likelihood estimation of a kalman model:

y(t) = X(t)*B(t) + Z(t)*A + e(t), e(t) = N(0,R)

B(t) = Z(t) * B(t-1) + v(t), v(t) = N(0,Q)

EXAMPLE

rtvp=kalman(grocer_func,grocer_y,grocer_x,grocer_ik,grocer_param,'priorb0=grocer_priorb0','priorv0=grocer_priorv0','meth=grocer_optmeth',varargin(:))
// This example is taken from tvp. Here grocer_func is one of the 4 following cases:
// 1) '[Q,R]=tvp_param1(grocer_param)'
// 2) '[Q,R]=tvp_param1a(grocer_param)'
// 3) '[Q,R,grocer_priorb0]=tvp_param2(param)'
// 4) '[Q,R,grocer_priorb0]=tvp_param2a(param)';
// grocer_y is the vector of endogenous variables, grocer_x the matrix of exogenous variables;
// grocer_ik is the (k x k) identity matrix; grocer_param is a vector of starting values,
// either given b the user or calculated as the ols regression of y on x;
// grocer_priorb0, grocer_priorv0 and grocer_optmeth are either the values given by the user or the default values;
// lastly, varargin are the option for maxlik, if any, given by he user.

AUTHOR

Eric Dubois 2002

Report an issue
<< filter_like Kalman filter estimation smoothing >>