www.gusucode.com > econ 案例源码程序 matlab代码 > econ/ImplicitlyCreateTimeInvariantStateSpaceModelExample.m
%% Implicitly Create Time-Invariant State-Space Model % This example shows how to create a time-invariant state-space model by % passing a parameter-mapping function describing the model to |ssm| (that % is, _implicitly_ create a state-space model). The state model is AR(1) % model. The states are observed with bias, but without random error. Set % the initial state mean and variance, and specify that the state is % stationary. %% % Write a function that specifies how the parameters in |params| map to the % state-space model matrices, the initial state values, and the type of % state. % % <include>timeInvariantParamMap.m</include> % %% % Save this code as a file named |timeInvariantParamMap| to a folder on % your MATLAB(R) path. %% % Create the state-space model by passing the function % |timeInvariantParamMap| as a function handle to |ssm|. % Copyright 2015 The MathWorks, Inc. Mdl = ssm(@timeInvariantParamMap); %% % The software implicitly defines the state-space model. Usually, you % cannot verify state-space models that you implicitly define. %% % |Mdl| is an |ssm| model object containing unknown parameters. You can % estimate the unknown parameters by passing |Mdl| and response data to % |estimate|.