www.gusucode.com > econ 案例源码程序 matlab代码 > econ/ARModelwithNoConstantTermExample.m

    %% AR Model with No Constant Term  
% This example shows how to specify an AR(_p_) model with constant term
% equal to zero. Use name-value syntax to specify a model that differs from
% the default model.   

% Copyright 2015 The MathWorks, Inc.


%% 
% Specify an AR(2) model with no constant term,
%
% $${y_t} = {\phi _1}{y_{t - 1}} + {\phi _2}{y_{t - 2}} + {\varepsilon _t},$$
%
% where the innovation distribution is Gaussian with constant variance. 
model = arima('ARLags',1:2,'Constant',0) 

%%
% The |ARLags| name-value argument specifies the lags corresponding to
% nonzero AR coefficients. The property |Constant| in the created model
% object is equal to |0|, as specified. The model object has default values
% for all other properties, including |NaN| values as placeholders for the
% unknown parameters: the AR coefficients and scalar variance.

%%
% You can modify the created model object using dot notation, or input it
% (along with data) to |estimate|.