Time varying parameters estimation
[rtvp]=tvp(namey,arg1,...,argn)
* namey = a time series, a real (nx1) vector or a string equal to the name of a time series or a (nx1) real vector between quotes
* argi = arguments which can be:
- a - time series
- a real (nx1) vector
- a string equal to the name of a time series or a (nx1) real vector between quotes
- the string 'noprint' if the user doesn't want to print the results of the regression
- 'priorb0=x' where x is (k x 1) vector with prior b0 values (default = ols(y,x))
- 'priorv0=x' where x = (k x k) matrix with prior variance for Q (default = eye(k)*1e+5, a diffuse prior)
- 'tvpmeth=x' where:
. x = 1 (Q is diagonal and only Q and R are estimated)
. or x=1a (no constraint on Q and only Q and R are estimated),
. or x=2 (prirov0=0, Q is diagonal and priorb0, Q and R are estimated)
. - or x=2a (priorv0=0, no constraint on Q, and priorb0, Q and R are estimated) (default = 1)
- 'Q=x' where x is a (kxk) initial value for Q
- 'R=x' where x is an initial value for R
- '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')
* rtvp = a results tlist with
- rtvp('meth') = 'tvp'
- rtvp('Q') = estimated Q
- rtvp('R') = estimated R
- rtvp('betat') = B(t/t)
- rtvp('betaf') = B(t/t-1)
- rtvp('betas') = B(t/T)
- rtvp('sigmatt') = sigma(t/t)
- rtvp('sigmatf') = sigma(t/t-1)
- rtvp('sigmats') = sigma(t/T)
- rtvp('param') = estimated parameters
- rtvp('vcov') = variance-covariance matrix of estimated paramters
- rtvp('tstat') = Student's t of estimated parameters
- rtvp('y') = y
- rtvp('x') = x
- rtvp('yhat') = X(t)*B(t)
- rtvp('resid') = y-X*B(t)
- rtvp('like') = log-likelihood
- rtvp('nobs') = # of observations
- rtvp('nvar') = # of exogenous variables
- rtvp('tR') = t-stat of estimated R variance
- rtvp('tQ') = t-stat of estimated Q variance
- rtvp('tpriorb0') = t-stat of estimated priorb0 (if method 1a or 2a are used)
- rtvp('param') = estimated parameters in a vector form
- rtvp('tstat') = their t-stat
- rtvp('tvpmeth') = method used in tvp
- rtvp('namey') = name of the endogenous variable
- rtvp('namex') = name of the exogenous variable
- rtvp('prests') = boolean indicating the presence or absence of a time series in the regression
- rtvp('bounds') = if there is a timeseries in the regression, the bounds of the regression
y(t) = X(t)*B(t) + e(t), e(t) = N(0,R)
B(t) = B(t-1) + v(t), v(t) = N(0,Q)
: the methods '1a' and '2a' are not very robust; so I recommend to use them with much caution!