Package model structures you define into the theta model format.
Syntax
th = mf2th(model,cd,parval)
th = mf2th(model,cd,parval,aux,lambda,T)
Description
th is returned as a model structure in the theta format. model is the name of an M-file that defines how the state-space matrices depend on the parameters to be estimated. The format of this M-file is given below. The argument cd must be assigned either the value 'c' which designates that the underlying parameterization refers to a continuous-time model, or the value 'd', indicating that the model parameterization is inherently a discrete-time one.
The argument parval contains the nominal values of the parameters. This is a row vector of the same length as the number of free parameters in the model structure. The argument aux is a matrix of auxiliary variables that the M-file can use for various purposes.
T denotes the sampling interval of the data, for which the model is going to be estimated (and the sampling interval that is used when the model is used for simulation and prediction). Give T a positive value even if the underlying model is defined to be continuous time.
The model structure corresponds to the general linear state-space structure

The matrices in this time-discrete model can be parameterized in an arbitrary way by the vector
. Write the format for the M-file as follows:
[A,B,C,D,K,x0] = mymfile(pars,T,aux)
Here the row vector pars contains the parameters
, and the output arguments A, B, C, D, K, and x0 are the matrices in the discrete-time model description that correspond to this value of the parameters.
T is the sampling interval, and aux is any matrix of auxiliary variables with which you want to work. (In that way you can change certain constants and other aspects in the model structure without having to edit the M-file.) Note that the two arguments T and aux must be included in the function head of the M-file, even if they are not utilized within the M-file.
If the underlying parameterization is a continuous-time one, it is still the discrete-time model matrices, corresponding to the sampling interval T that should be delivered by the M-file. However. it is desirable that if the M-file myfile is called with a negative value of T, it outputs the matrices of the corresponding continuous-time state-space model. If such a feature is included in the M-file, use cd = 'c'. This allows for easy transformations between continuous and discrete time using the normal functions thc2thd and thd2thc.
"Defining Model Structures" on page 3-29 in the User's Guide contains several examples of typical M-files that define model structures.
Examples
Use the M-file 'mynoise' given in Section 6 to obtain a physical parametrization of the Kalman gain:
thn = mf2th('mynoise','d',[0.1,-2,1,3,0.2],1)
th = pem(z,thn)
[ Previous | Help Desk | Next ]