AR(1) version of State-Space Model (SSM) framework

Hi guys,
I am using the SSM framework to estimate the yield curve model of Diebold-Li, similar as in https://nl.mathworks.com/help/econ/examples/using-the-kalman-filter-to-estimate-and-forecast-the-diebold-li-model.html
However, the link above uses a VAR(1) model for the transition matrix A, whereas I want to restrict A to be diagonal (three individual AR(1) processes).
Is there a clever way to incorporate this restriction in the provided code:
%% State-Space Estimation of the DNS-model with Kalman filter
Mdl = ssm(@(params)Example_DieboldLi(params,yields,maturities));
% Initialisation
A0 = EstMdlVAR.AR{1}; % Get the VAR(1) matrix (stored as a cell array)
A0 = A0(:); % Stack it columnwise
options = optimoptions('fminunc','MaxFunEvals',25000,'algorithm','quasi-newton', ...
'TolFun' ,1e-8,'TolX',1e-8,'MaxIter',1000,'Display','off');
[EstMdlSSM,params] = estimate(Mdl,yields,param0,'Display','off', ...
'options',options,'Univariate',true);
I suspect I have to change the optimization procedure from 'fminunc' to 'fmincon', but I dont know how to add the constraints given the way the code is written.
I have tried to initialise the off-diagonal elements of A to 0, and kept the optimization procedure to 'fminunc', but I ended up with a full VAR(1) matrix.
A0 = zeros(3); % AR(1) version
A0(1,1) = EstMdlAR_beta1.AR{1,1};
A0(2,2) = EstMdlAR_beta2.AR{1,1};
A0(3,3) = EstMdlAR_beta3.AR{1,1};
A0_column = A0(:); % Stack it columnwise
Thanks in advance.

Réponses (0)

Catégories

En savoir plus sur Econometrics Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by