亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? garchfit.m

?? 灰色控制 灰色控制 matlab
?? M
?? 第 1 頁 / 共 3 頁
字號:
function [coefficients, errors, LLF, innovations, sigma, summary] = garchfit(spec , y , X)
%GARCHFIT Univariate GARCH process parameter estimation.
%   Given an observed univariate return series, estimate the parameters of a
%   conditional mean specification of ARMAX form and conditional variance 
%   specification of GARCH form. The estimation process infers the innovations 
%   from the return series and fits the model specification to the return 
%   series by maximum likelihood.
%
%   [Coeff,Errors,LLF,Innovations,Sigma,Summary] = garchfit(Series)
%
%   [Coeff,Errors,LLF,Innovations,Sigma,Summary] = garchfit(Spec, Series)
%   [Coeff,Errors,LLF,Innovations,Sigma,Summary] = garchfit(Spec, Series, X)
%
%   garchfit(...)
%
%   Optional Input: Spec, X
%
%   The first calling syntax is strictly a convenience form, modeling a return 
%   series as a constant plus GARCH(1,1) conditionally Gaussian innovations. 
%   For any models beyond this default (yet common) model, a specification 
%   structure, Spec, must be provided.
%
%   The second and third calling syntaxes allow the specification of much more 
%   elaborate models for the conditional mean and variance processes.
%
%   The last calling syntax (with no output arguments) will perform identical
%   estimation procedures as the first three, but will print the iterative 
%   optimization information to the MATLAB command window along with the final
%   parameter estimates and standard errors. It will also produce a tiered plot 
%   of the original return series as well as the innovations (i.e., residuals)
%   inferred, and the corresponding conditional standard deviations.
%
% Inputs:
%   Series - Vector of observations of the underlying univariate return series 
%     of interest. Series is the response variable representing the time series 
%     fit to conditional mean and variance specifications. The last element of 
%     Series holds the most recent observation.
%
% Optional Inputs:
%   Spec - Structure specification for the conditional mean and variance models,
%     and optimization parameters. Spec is a structure with fields created by 
%     calling the function GARCHSET. Type "help garchset" for details.
%
%   X - Time series regression matrix of explanatory variable(s). Typically, X 
%     is a regression matrix of asset returns (e.g., the return series of an 
%     equity index). Each column of X is an individual time series used as an 
%     explanatory variable in the regression component of the conditional mean. 
%     In each column of X, the first row contains the oldest observation and 
%     the last row the most recent. If X is specified, the most recent number 
%     of valid (non-NaN) observations in each column of X must equal or exceed 
%     the most recent number of valid observations in Series. When the number 
%     of valid observations in each column of X exceeds that of Series, only 
%     the most recent observations of X are used. If empty or missing, the 
%     conditional mean will have no regression component.
%
% Outputs:
%   Coeff - Structure containing the estimated coefficients. Coeff is of the 
%     same form as the Spec input structure, which allows other GARCH Toolbox 
%     functions (e.g., GARCHSET, GARCHGET, GARCHSIM, and GARCHPRED) to accept 
%     either Spec or Coeff seamlessly.
%
%   Errors - Structure containing the estimation errors (i.e., the standard 
%     errors) of the coefficients. The fields of Errors are a subset of those 
%     found in Coeff or Spec, and correspond to the coefficient fields only.
%
%   LLF - Optimized log-likelihood objective function value associated with the
%     parameter estimates found in Coeff. Optimization is performed by the 
%     FMINCON function of the MATLAB Optimization Toolbox.
%
%   Innovations - Innovations vector inferred from the input Series. The size
%     of Innovations is the same as the size of Series.
%
%   Sigma - Conditional standard deviation vector corresponding to Innovations.
%     The size of Sigma is the same as the size of Series.
%
%   Summary - Structure of summary information about the optimization process,
%     including convergence information, iterations, objective function calls,
%     active constraints, and the covariance matrix of coefficient estimates.
%
% See also GARCHSET, GARCHSIM, GARCHPRED, GARCHLLFN, FMINCON.

% Copyright 1999-2002 The MathWorks, Inc.   
% $Revision: 1.9 $   $Date: 2002/03/11 19:37:16 $

%
% References:
%   Bollerslev, T. (1986), "Generalized Autoregressive Conditional 
%     Heteroskedasticity", Journal of Econometrics, vol. 31, pp. 307-327.
%   Box, G.E.P., Jenkins, G.M., Reinsel, G.C., "Time Series Analysis: 
%     Forecasting and Control", 3rd edition, Prentice Hall, 1994.
%   Engle, Robert (1982), "Autoregressive Conditional Heteroskedasticity 
%     with Estimates of the Variance of United Kingdom Inflation", 
%     Econometrica, vol. 50, pp. 987-1007.
%   Hamilton, J.D., "Time Series Analysis", Princeton University Press, 1994.
%

%
% Check input arguments. The single input case must specify a 
% valid numeric vector of returns. For the multiple input case, 
% the first input must be a specification structure.
%

switch nargin
   case 1
     if isnumeric(spec)
        y    =  spec;
        spec =  garchset;       % Allow a convenience/default model form.
     else
        error(' Observed return series ''Series'' must be specified.');
     end

   case {2 , 3}
     if ~isstruct(spec)
        error(' ''Spec'' must be a structure.');
     end

   otherwise
     error(' Too many inputs specified.');
end

%
% Scrub the observed return series vector y(t).
%

rowY  =  logical(0);     

if prod(size(y)) == length(y)   % Check for a vector (single return series).
   rowY  =  size(y,1) == 1;     % Flag a row vector for outputs.
   y     =  y(:);               % Convert to a column vector.
else
   error(' Observed return series ''Series'' must be a vector.');
end

%
%  The following code segment assumes that missing observations are indicated
%  by the presence of NaN's. Any initial rows with NaN's are removed, and 
%  processing proceeds with the remaining block of contiguous non-NaN rows. 
%  Put another way, NaN's are allowed, but they MUST appear as a contiguous 
%  sequence in the initial rows of the y(t) vector.
%

i1  =  find(isnan(y));
i2  =  find(isnan(diff([y ; zeros(1,size(y,2))]) .* y));

if (length(i1) ~= length(i2)) | any(i1 - i2)
   error(' Only initial observations in ''Series'' may be missing (NaN''s).')
end

if any(sum(isnan(y)) == size(y,1))
   error(' A realization of ''Series'' is completely missing (all NaN''s).')
end

firstValidRow  =  max(sum(isnan(y))) + 1;
y              =  y(firstValidRow:end , :);

%
% Scrub the regression matrix and ensure the observed return series vector y(t) 
% and the regression matrix X(t) have the same number of valid (i.e., non-NaN)
% rows (i.e., impose time index compatibility). During estimation, the innovations
% process e(t) must be inferred from the conditional mean specification, which 
% may include a regression component if desired. In contrast to simulation, 
% estimation of the innovations process e(t) is NOT independent of X. 
%

if (nargin >= 3) & ~isempty(X)

   if prod(size(X)) == length(X)   % Check for a vector.
      X  =  X(:);                  % Convert to a column vector.
   end

%
%  Retain the last contiguous block of non-NaN (i.e, non-missing valued) observations only. 
%
   if any(isnan(X(:)))
      X  =  X((max(find(isnan(sum(X,2)))) + 1):end , :);
   end

   if size(X,1) < size(y,1)
      error(' Regression matrix ''X'' has insufficient number of observations.');
   else
      X  =  X(size(X,1) - (size(y,1) - 1):end , :);    % Retain only the most recent samples.
   end

%
%  Ensure number of regression coefficients (if specified) match number of regressors.
%
   regress  =  garchget(spec , 'Regress');             % Regression coefficients.

   if ~isempty(regress)
      if size(X,2) ~= length(garchget(spec , 'Regress'))
         error(' Number of ''Regress'' coefficients unequal to number of regressors in ''X''.');
      end
   end

else

   X        =  [];   % Ensure X exists.
   regress  =  [];

end

%
% Extract model orders & coefficients.
%

R      =  garchget(spec , 'R');       % Conditional mean AR order.
M      =  garchget(spec , 'M');       % Conditional mean MA order.
P      =  garchget(spec , 'P');       % Conditional variance order for lagged variances.
Q      =  garchget(spec , 'Q');       % Conditional variance order for lagged squared residuals.

C      =  garchget(spec , 'C');       % Conditional mean constant.
AR     =  garchget(spec , 'AR');      % Conditional mean AR coefficients.
MA     =  garchget(spec , 'MA');      % Conditional mean MA coefficients.

K      =  garchget(spec , 'K');       % Conditional variance constant.
GARCH  =  garchget(spec , 'GARCH');   % Conditional variance coefficients for lagged variances.
ARCH   =  garchget(spec , 'ARCH');    % Conditional variance coefficients for lagged squared residuals.

%
% Set a 'Display' flag to determine if any warnings or 
% messages should be printed to the screen to alert users.
%

D            =  garchget(spec , 'Display');
DisplayFlag  =  strcmp(D(~isspace(D)) , 'on');

%
% Generate initial parameter estimates if necessary. Note that the code below
% adopts an 'all or nothing' approach for model specifications. That is, if a
% user wants to provide parameter values (either as (1) Initial guesses for 
% refinement during the optimization process, or as (2) Equality constraints
% in which some of the parameters are held fixed and some are refined), the 
% user MUST provide a complete specification. The only flexibility regarding
% model specification is that the conditional mean and variance models are 
% treated separately. For example, a user may provide initial values for the 
% conditional mean parameters, and let the code provide initial values for
% conditional variance parameters.
%

%
% Initialize conditional mean parameter estimates if necessary. If an
% incomplete conditional mean specification is found (i.e., the user has
% NOT explicitly set ALL required coefficients for a given conditional mean 
% model), then compute initial estimates and over-write any pre-existing 
% parameters in the incomplete specification. This is an 'all or nothing' 
% approach for model specification.
%

Flag1                  =  logical(1);  % Initialize to a complete mean specification.
unconditionalVariance  =  [];          % Make sure it exists.

if isempty(X)

   if isempty(C) | (isempty(AR) & (R > 0)) | (isempty(MA) & (M > 0))
%
%     General ARMA conditional mean with no regression component.
%
      [AR , MA , C , unconditionalVariance]  =  arma0(y , R , M);

      Flag1  =  logical(0);   % Indicate an INCOMPLETE mean specification.

   end

else

   if M == 0        % Check for MA terms.

      if isempty(C) | (isempty(AR) & (R > 0)) | isempty(regress)
%
%        General ARX conditional mean model with no MA terms. Initial
%        estimates can be generated by a simple OLS regression.
%
         yLag               =  lagmatrix(y , [1:R]);
         yLag(isnan(yLag))  =  mean(y);

         [QQ , RR]  =  qr([ones(size(X,1),1)  yLag  X] , 0);
         b          =  RR \ (QQ'*y);
         residuals  =  y - [ones(size(X,1),1)  yLag  X]*b;

         C       =  b(1);
         AR      =  b(2:R+1);
         MA      =  [];
         regress =  b(R+2:end);

         unconditionalVariance  =  var(residuals,1);
%
%        Ensure stationarity of AR process.
%
         if any(abs(roots([1 ; -AR(:)])) >= 1)
            AR(:)  =  0;
         end

         Flag1  =  logical(0);            % Indicate an INCOMPLETE mean specification.

      end

   else

      if isempty(C) | (isempty(AR) & (R > 0)) | isempty(MA) | isempty(regress)
%
%        General ARMAX conditional mean model. 
%
         C       =  0; 
         AR      =  zeros(R,1);
         MA      =  zeros(M,1); 
         regress =  zeros(size(X,2),1);

         unconditionalVariance  =  1e-4;  % Default assumption for daily returns.

         Flag1  =  logical(0);            % Indicate an INCOMPLETE mean specification.

      end

   end

end

%
% Create initial conditional variance parameter estimates if necessary.
% As for the conditional mean above, this is an 'all or nothing' approach
% for specification of the conditional variance.
%

Flag2  =  logical(1);           % Initialize flag to indicate a complete variance specification.

if isempty(K) | (isempty(GARCH) & (P > 0)) | (isempty(ARCH) & (Q > 0))

   [K , GARCH , ARCH] = garch0(P , Q , unconditionalVariance);

   Flag2  =  logical(0);        % Indicate an INCOMPLETE variance specification.

end

%
% Extract equality constraint information for coefficients.
%

Fix  =  zeros(1 + R + M + size(X,2) + 1 + P + Q , 1);

if Flag1
%
%  A complete conditional mean specification was provided.
%
   FixC       =  garchget(spec , 'FixC');
   FixAR      =  garchget(spec , 'FixAR');
   FixMA      =  garchget(spec , 'FixMA');
   FixRegress =  garchget(spec , 'FixRegress');

   if isempty(FixC)       , FixC       = 0;                  end
   if isempty(FixAR)      , FixAR      = zeros(R,1);         end
   if isempty(FixMA)      , FixMA      = zeros(M,1);         end
   if isempty(FixRegress) , FixRegress = zeros(size(X,2),1); end

   Fix(1:(1 + R + M + size(X,2))) = [FixC ; FixAR(:) ; FixMA(:) ; FixRegress(:)];

end

if Flag2
%
%  A complete conditional variance specification was provided.
%
   FixK      =  garchget(spec , 'FixK');
   FixGARCH  =  garchget(spec , 'FixGARCH');
   FixARCH   =  garchget(spec , 'FixARCH');

   if isempty(FixK)       , FixK      = 0;                  end
   if isempty(FixGARCH)   , FixGARCH  = zeros(P,1);         end
   if isempty(FixARCH)    , FixARCH   = zeros(Q,1);         end

   Fix((2 + R + M + size(X,2)):end) = [FixK ; FixGARCH(:) ; FixARCH(:)];

end

%
% NOTES:
% Let y(t) = return series of interest (assumed stationary)
%     e(t) = innovations of the model noise process (assumed invertible)
%     h(t) = conditional variance of the innovations process e(t)
%
% The initial parameter guess vector 'x0' input to FMINCON and the estimated 
% parameter vector 'coefficient' output from FMINCON are formatted exactly as
% the parameters would be read from the recursive difference equations when 
% solving for the current values of the y(t) and h(t) time series.
%
% For example, consider the following equations for the conditional mean 
% and variance of an ARMAX(R=2,M=2,nX=1)/GARCH(P=2,Q=2) composite model:
%
%   y(t) =  1.3 + 0.5y(t-1) - 0.8y(t-2) + e(t) - 0.6e(t-1) + 0.08e(t-2) + 1.2X(t)
%   h(t) =  0.5 + 0.2h(t-1) + 0.1h(t-2) + 0.3e(t-1)^2  +  0.4e(t-2)^2

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
天堂蜜桃91精品| 精品在线亚洲视频| 免费看欧美美女黄的网站| 国产高清成人在线| 欧美性一二三区| 国产亚洲欧美一区在线观看| 一区二区理论电影在线观看| 国产乱码精品一区二区三区五月婷 | 欧美国产97人人爽人人喊| 亚洲午夜精品网| proumb性欧美在线观看| 欧美成人精品高清在线播放| 亚洲精品视频一区二区| 国产精品123| 精品久久久久久综合日本欧美| 一区二区三区中文字幕精品精品| 国产成人综合自拍| 欧美v亚洲v综合ⅴ国产v| 亚洲一级电影视频| 日本高清不卡一区| 国产精品国产三级国产三级人妇 | 日韩一区二区三区精品视频| 亚洲精品乱码久久久久久久久 | 欧美日韩一区小说| 洋洋成人永久网站入口| 成人a级免费电影| 日本一区二区三级电影在线观看| 久国产精品韩国三级视频| 欧美猛男超大videosgay| 亚洲一区二区四区蜜桃| 色婷婷狠狠综合| 亚洲激情成人在线| 91色九色蝌蚪| 亚洲一区二区精品视频| 在线观看亚洲一区| 午夜精品久久久久久久| 欧美日韩一区高清| 免费人成精品欧美精品| 日韩一区二区三区电影在线观看| 日韩福利电影在线观看| 欧美一级理论性理论a| 麻豆一区二区三| 久久久久久久久久久久久久久99| 国产一区二区三区高清播放| 久久这里只精品最新地址| 国产一区二区不卡老阿姨| 国产日韩欧美亚洲| 97精品超碰一区二区三区| 亚洲久本草在线中文字幕| 在线视频国内一区二区| 免费高清在线视频一区·| 精品美女在线播放| 成av人片一区二区| 亚洲一二三四在线| 欧美一个色资源| 懂色av一区二区三区蜜臀| 亚洲特黄一级片| 欧美精品国产精品| 国产乱子轮精品视频| 国产精品免费网站在线观看| 91麻豆国产福利精品| 亚洲国产另类av| 久久精品这里都是精品| 91免费小视频| 久久99国产精品久久| 中文字幕av一区二区三区高 | 亚洲国产毛片aaaaa无费看 | 亚洲人成在线观看一区二区| 欧美剧情片在线观看| 国产精品资源在线看| 亚洲欧美日韩国产成人精品影院 | 色婷婷av一区| 精品制服美女久久| 亚洲精品国产高清久久伦理二区| 欧美一区二区三区在线视频| 国产iv一区二区三区| 五月激情综合色| 中文字幕不卡在线观看| 欧美巨大另类极品videosbest| 国产米奇在线777精品观看| 一区二区三区**美女毛片| 欧美mv和日韩mv的网站| 色综合天天天天做夜夜夜夜做| 美腿丝袜亚洲综合| 自拍偷拍欧美激情| 欧美精品一区二区蜜臀亚洲| 日本精品免费观看高清观看| 国产一区二区网址| 日韩黄色片在线观看| 亚洲日本中文字幕区| 欧美不卡在线视频| 欧美视频中文字幕| 99久久综合99久久综合网站| 日本中文字幕一区| 一区二区三区中文字幕| 国产午夜久久久久| 日韩欧美一卡二卡| 精品视频一区二区三区免费| 成人短视频下载| 国产高清不卡二三区| 黑人精品欧美一区二区蜜桃| 午夜精品久久久久久久| 一区二区三区日韩欧美| 中文字幕在线不卡国产视频| 精品第一国产综合精品aⅴ| 欧美裸体bbwbbwbbw| 在线观看日韩av先锋影音电影院| 国产成a人亚洲| 国产成人精品一区二| 久久国产三级精品| 久久99国产精品久久99果冻传媒| 偷窥少妇高潮呻吟av久久免费| 亚洲精品日韩综合观看成人91| 亚洲欧洲日产国码二区| 国产精品乱码一区二三区小蝌蚪| 久久久亚洲国产美女国产盗摄 | 亚洲人精品一区| 亚洲欧美另类图片小说| 国产精品久久久久婷婷| 国产精品视频线看| 国产精品灌醉下药二区| 中文字幕一区二区三区在线播放| 国产精品久久久久aaaa樱花 | 色爱区综合激月婷婷| 91久久久免费一区二区| 欧美特级限制片免费在线观看| 在线观看网站黄不卡| 7777精品伊人久久久大香线蕉经典版下载 | 1000部国产精品成人观看| 亚洲天堂网中文字| 午夜精品久久久久久久久久久| 奇米精品一区二区三区在线观看 | 石原莉奈在线亚洲三区| 人人超碰91尤物精品国产| 久久精品国产99久久6| 久久99热这里只有精品| 国产精品一二三区在线| 99久久精品情趣| 欧美日韩国产乱码电影| 日韩午夜激情av| 中文乱码免费一区二区| 亚洲视频免费在线观看| 日日夜夜精品视频天天综合网| 免费在线一区观看| 成人免费视频一区二区| 欧美色中文字幕| 久久久久久久久久久久久女国产乱 | 亚洲国产精品天堂| 久久er99精品| 色狠狠一区二区| 日韩欧美区一区二| 日韩一区在线看| 免费高清在线一区| 92国产精品观看| 日韩视频123| 中文字幕一区二区三区在线不卡 | 中文字幕欧美三区| 亚洲成人av电影在线| 国产一区三区三区| 欧美在线观看视频一区二区| 欧美va在线播放| 亚洲国产欧美日韩另类综合| 国产乱淫av一区二区三区| 欧美嫩在线观看| 国产精品―色哟哟| 久久99精品久久久| 色妞www精品视频| 国产人成亚洲第一网站在线播放| 一区二区三区国产豹纹内裤在线| 黄色资源网久久资源365| 欧洲中文字幕精品| 欧美国产日韩亚洲一区| 久久精品国产77777蜜臀| 91色在线porny| 国产精品热久久久久夜色精品三区 | 精品欧美久久久| 日韩国产一区二| 色哟哟精品一区| 欧美国产在线观看| 国产一区二区三区四区五区入口| 91精品国产综合久久精品| 亚洲日本乱码在线观看| 丁香桃色午夜亚洲一区二区三区| 91精品在线麻豆| 香蕉影视欧美成人| 91麻豆国产香蕉久久精品| 国产精品国产自产拍高清av王其| 国内精品伊人久久久久av影院| 7777精品伊人久久久大香线蕉最新版| 亚洲另类春色校园小说| a级高清视频欧美日韩| 中文字幕第一区| 成人福利视频网站| 国产精品麻豆欧美日韩ww| 成人国产精品视频| 国产精品乱人伦中文| av亚洲精华国产精华精华| 欧美韩国一区二区| 91在线播放网址| 亚洲精品日日夜夜|