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

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

?? garchfit.m

?? 灰色控制 灰色控制 matlab
?? M
?? 第 1 頁 / 共 3 頁
字號:
%
% The above equations are examples of the following general 
% ARMAX(R,M,nX)/GARCH(P,Q) form:
%
%   y(t) =  C + AR(1)y(t-1) + ... + AR(R)y(t-R) + e(t) 
%             + MA(1)e(t-1) + ... + MA(M)e(t-M) + B(1)X(t,1) + ... + B(nX)X(t,nX)
%
%   h(t) =  K + GARCH(1)h(t-1)   + ... + GARCH(P)h(t-P) 
%             +  ARCH(1)e(t-1)^2 + ... +  ARCH(Q)e(t-Q)^2
%
% For the example listed above, the coefficient vector would be formatted as
%
%   Coefficient = [ C     AR(1:R)     MA(1:M)  B(1:nX)  K   GARCH(1:P)   ARCH(1:Q)]'
%               = [1.3   0.5 -0.8   -0.6 0.08    1.2   0.5    0.2 0.1     0.3 0.4 ]'
%
% Notice that the coefficient of e(t) in the conditional mean equation is
% defined to be 1, and is NOT included in the vector because it is not estimated.
%

%
% Get the probability distribution of the innovations process e(t) 
% and call the appropriate log-likelihood objective function.
%

distribution  =  garchget(spec , 'Distribution');
distribution  =  distribution(~isspace(distribution));

switch upper(distribution)

   case 'GAUSSIAN'

      x0  =  [C ; AR(:) ; MA(:) ; regress(:) ; K ; GARCH(:) ; ARCH(:)];   % Initial guess.
%
%     Set lower bounds constraints. 
%
%     The parameters of the conditional mean, in theory, have no lower bounds. 
%     However, for robustness, set the mean constant (C) and the ARMA(R,M) 
%     parameters to -100 (i.e., an unrealistically large, yet totally finite 
%     number). The coefficients of the regression component of the mean are 
%     set to -infinity to reflect the fact that the origin and generating 
%     mechanism of a regression is completely unknown. This is consistent 
%     with the 'hands-off' approach regarding regression.
%
%     The conditional variance constant (K) must be positive, so it's set to 
%     a very small (yet positive) value; the conditional variance coefficients 
%     (GARCH(i), ARCH(i)) are constrained to be non-negative, so they're set 
%     to zero.
%
      infinity     =  inf;
      hundred      =  100;
      lowerBounds  =  [-hundred(ones(1+R+M,1)) ; -infinity(ones(size(X,2),1)) ; 1e-10 ; zeros(P+Q,1)];
      upperBounds  =  [];

%
%     Set linear inequality of the covariance-stationarity constraint of 
%     the conditional variance, Ax <= b. Since the conditional variance 
%     (GARCH(i), ARCH(i)) parameters are constrained to be non-negative, 
%     the covariance-stationarity constraint is just a summation constraint.
%     Also, adjust the summation constraint, b, to reflect a tolerance 
%     offset from a fully integrated conditional variance condition (i.e.,
%     an IGARCH process).
%

      if ((P + Q) > 0)
         A  =  [zeros(1,1+R+M+size(X,2)+1)  ones(1,P)  ones(1,Q)];
         b  =  1  -  2*optimget(spec.Optimization , 'TolCon', 1e-6);
      else
         A  =  [];
         b  =  [];
      end
%
%     Set any linear equality constraints.
%
      if any(Fix)
         i    =  find(Fix); 
         Aeq  =  [zeros(length(i) , 1 + R + M + size(X,2) + 1 + P + Q)];

         for j = 1:length(i)
             Aeq(j,i(j))  =  1;
         end

         beq  =  x0(logical(Fix));

      else
         Aeq  =  [];
         beq  =  [];
      end
%
%     Perform constrained non-linear optimization. 
%

      [coefficients , LLF    , ...
       exitFlag     , output , lambda] =  fmincon('garchllfn'  , x0 , A  , b       , Aeq , beq , ...
                                                   lowerBounds , upperBounds       , ...
                                                  'garchnlc'   , spec.Optimization , ...
                                                   y , R , M , P , Q , X);
%
%     Negate objective function value to compensate for FMINCON.
%
      LLF  =  -LLF;
%
%     Over-write all GARCH constraint-violating parameters that are less than 
%     zero. This will, occasionally, occur because FMINCON may violate constraints 
%     ever so slightly. Also, the constant term (K) of the conditional variance 
%     equation must be positive, so enforce this if necessary.
%
      varianceCoefficients =  coefficients((2 + R + M + size(X,2)):end);

      varianceCoefficients(varianceCoefficients <  0) =  0;              % All variance-related coefficients.
      varianceCoefficients(1) = max(varianceCoefficients(1) , realmin);  % Constant term 'K'.

      coefficients  =  [coefficients(1:(1 + R + M + size(X,2))) ; varianceCoefficients(:)];

      MLEparameters =  coefficients(:);  % Save MLE parameter values in vector form.
%
%     Extract the parameter estimates & equality constraints.
%
      C          =  coefficients(1);
      AR         =  coefficients(2:R+1);
      MA         =  coefficients(R+2:R+M+1);
      regress    =  coefficients(R+M+2:R+M+size(X,2)+1);

      K          =  coefficients(R+M+size(X,2)+2:R+M+size(X,2)+2);
      GARCH      =  coefficients(R+M+size(X,2)+3:R+M+size(X,2)+2+P);
      ARCH       =  coefficients(R+M+size(X,2)+3+P:R+M+size(X,2)+2+P+Q);

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

      FixK       =  Fix(R+M+size(X,2)+2:R+M+size(X,2)+2);
      FixGARCH   =  Fix(R+M+size(X,2)+3:R+M+size(X,2)+2+P);
      FixARCH    =  Fix(R+M+size(X,2)+3+P:R+M+size(X,2)+2+P+Q);

%
%     Test for stationarity & invertibility of the ARMA model (if any).
%
      summary.warning = 'No Warnings';

      if any(abs(roots([1 ; -AR(:)])) >= 1)
         summary.warning = 'ARMA Model is Not Stationary/Invertible';
         if DisplayFlag
            warning('Auto-Regressive Polynomial is Non-Stationary.')
         end
      end

      if any(abs(roots([1 ; MA(:)])) >= 1)
         summary.warning = 'ARMA Model is Not Stationary/Invertible';
         if DisplayFlag
            warning('Moving-Average Polynomial is Non-Invertible.')
         end
      end
%
%     Now pack the data into the output COEFFICIENTS structure. Note that 
%     the COEFFICIENTS output structure is of the same form as the SPEC 
%     input structure. This allows GARCHSET, GARCHGET, GARCHSIM, and 
%     GARCHPRED to accept either SPEC or COEFFICIENTS seamlessly. 
%
%     Strictly speaking, GARCHSET should be used to make the following
%     assignment, but will error-out if the stationarity/invertibility
%     constraints are violated. Simple assignment allows for graceful 
%     termination with a warning.
%
      coefficients            =  spec;
      coefficients.C          =  C;
      coefficients.AR         =  AR(:)';
      coefficients.MA         =  MA(:)';
      coefficients.Regress    =  regress(:)';
      coefficients.K          =  K;
      coefficients.GARCH      =  GARCH(:)';
      coefficients.ARCH       =  ARCH(:)';

      coefficients.FixC       =  FixC;
      coefficients.FixAR      =  FixAR(:)';
      coefficients.FixMA      =  FixMA(:)';
      coefficients.FixRegress =  FixRegress(:)';
      coefficients.FixK       =  FixK;
      coefficients.FixGARCH   =  FixGARCH(:)';
      coefficients.FixARCH    =  FixARCH(:)';
%
%     Update the 'comment' field to reflect a regression component (only if auto-generated).
%
      comment =  garchget(coefficients , 'comment');

      if length(findstr(comment, char(0))) == 2
         pOpen  =  findstr(comment, '(');
         pClose =  findstr(comment, ')');
         if ~isempty(pOpen) & ~isempty(pClose) 
            commas  =  findstr(comment(pOpen(1):pClose(1)) , ',');
            if length(commas) == 1
               coefficients.Comment =  [comment(1:pClose(1)-1) ',' num2str(size(X,2)) comment(pClose(1):end)];
            elseif length(commas) == 2
               coefficients.Comment =  [comment(1:(pOpen(1) + commas(2)-1)) num2str(size(X,2)) comment(pClose(1):end)];
            end
        end
      end

      if length(coefficients.AR)      == 0 , coefficients.AR          =  []; end   % Just for aesthetics.
      if length(coefficients.MA)      == 0 , coefficients.MA          =  []; end
      if length(coefficients.Regress) == 0 , coefficients.Regress     =  []; end
      if length(coefficients.GARCH)   == 0 , coefficients.GARCH       =  []; end
      if length(coefficients.ARCH)    == 0 , coefficients.ARCH        =  []; end

      if sum(coefficients.FixC)       == 0 , coefficients.FixC        =  []; end   % Just for aesthetics.
      if sum(coefficients.FixAR)      == 0 , coefficients.FixAR       =  []; end
      if sum(coefficients.FixMA)      == 0 , coefficients.FixMA       =  []; end
      if sum(coefficients.FixRegress) == 0 , coefficients.FixRegress  =  []; end
      if sum(coefficients.FixK)       == 0 , coefficients.FixK        =  []; end
      if sum(coefficients.FixGARCH)   == 0 , coefficients.FixGARCH    =  []; end
      if sum(coefficients.FixARCH)    == 0 , coefficients.FixARCH     =  []; end

%
%     Compute the variance-covariance matrix of the parameter 
%     estimates and extract the standard errors of the estimation.
%
      if (nargout >= 2) | (nargout == 0)

         covarianceMatrix =  varcov(MLEparameters , y , R , M , P , Q , X , Fix);
         standardErrors   =  sqrt(diag(covarianceMatrix))';

         errors.C         =  standardErrors(1);
         errors.AR        =  standardErrors(2:R+1);
         errors.MA        =  standardErrors(R+2:R+M+1);
         errors.Regress   =  standardErrors(R+M+2:R+M+size(X,2)+1);

         errors.K         =  standardErrors(R+M+size(X,2)+2:R+M+size(X,2)+2);
         errors.GARCH     =  standardErrors(R+M+size(X,2)+3:R+M+size(X,2)+2+P);
         errors.ARCH      =  standardErrors(R+M+size(X,2)+3+P:R+M+size(X,2)+2+P+Q);

         if length(errors.AR)      == 0 , errors.AR       =  []; end   % Just for aesthetics.
         if length(errors.MA)      == 0 , errors.MA       =  []; end
         if length(errors.Regress) == 0 , errors.Regress  =  []; end
         if length(errors.GARCH)   == 0 , errors.GARCH    =  []; end
         if length(errors.ARCH)    == 0 , errors.ARCH     =  []; end

      end
%
%     Return the innovations and conditional standard deviation vectors if requested.
%
      if (nargout >= 4) | (nargout == 0)
         [innovations , sigma]  =  garchinfer(coefficients , y , X);
      end
%
%     Return summary information if requested.
%
      if (nargout >= 6) | (nargout == 0)

         if exitFlag == 0
            summary.converge  =  'Maximum Function Evaluations or Iterations Reached';
         elseif exitFlag < 0
            summary.converge  =  'Function Did NOT Converge';
         elseif exitFlag > 0
            summary.converge  =  'Function Converged to a Solution';
         end
 
         summary.covMatrix      =  covarianceMatrix;
         summary.iterations     =  output.iterations;
         summary.functionCalls  =  output.funcCount;
%
%        Flag any boundary constraints enforced EXCEPT LINEAR EQUALITY CONSTRAINTS
%        specifically requested by the user. Whenever any constraints (excluding
%        linear equalities) are imposed, the log-likelihood function will probably NOT
%        be approximately quadratic at the solution. In this case, the standard errors
%        of the parameter estimates are unlikely to be accurate. However, if the ONLY
%        constraints are the linear equalities imposed by the user, then the resulting
%        log-likelihood value LLF may still be useful for post-fit assessment and
%        inference tests, such as likelihood ratio tests (LRT's).
%

         TolCon = optimget(spec.Optimization , 'TolCon', 1e-6);

         if (norm([lambda.lower(:) ; lambda.upper(:) ; lambda.ineqlin(:) ; lambda.ineqnonlin(:)] , 1) > TolCon)
            summary.constraints  =  'Boundary Constraints Active; Errors may be Inaccurate';
            if DisplayFlag
               warning('Boundary Constraints Active; Standard Errors may be Inaccurate.')
            end
         else
            summary.constraints  =  'No Boundary Constraints';
         end

      end

   otherwise

      error(' Distribution of innovations must be ''Gaussian''.')

end

%
% Re-format outputs for compatibility with the SERIES input. When 
% SERIES is input as a single row vector, then pass the outputs 
% as a row vectors. 
%

if rowY & (nargout >= 4)
   innovations  =  innovations(:).';
   sigma        =  sigma(:).';
end

%
% Perform the default no-output action: 
%
%  (1) Print the parameter estimates to the screen, and 
%  (2) Display the estimated residuals, conditional standard
%      deviations, and input raw return series.
%

if nargout == 0

   garchdisp(coefficients , errors);
   garchplot(innovations  , sigma , y);

   disp(' ')
   fprintf('  Log Likelihood Value: %f\n\n' , LLF)

   clear coefficients     % Suppress unexpected printing to the command window.

end

%
%   * * * * *  Helper function for initial GARCH guesses.  * * * * *
%

function [K , GARCH , ARCH] = garch0(P , Q , unconditionalVariance)
%GARCH0 Initial GARCH process parameter estimates.
%   Given the orders of a GARCH(P,Q) model and an estimate of the unconditional 
%   variance of the innovations process, compute initial estimates for the 
%   (1 + P + Q) parameters of a GARCH(P,Q) conditional variance model. These
%   estimates serve as initial guesses for further refinement via maximum 
%   likelihood.
%
%   [K , GARCH , ARCH] = garch0(P , Q , Variance)
%
% Inputs:
%   P - Non-negative, scalar integer representing the number of lags of the
%     conditional variance included in the GARCH process.
%
%   Q - Non-negative, scalar integer representing the number of lags of the 
%     squared innovations included in the GARCH process.
%
%   Variance - Estimate of the unconditional variance of the innovations noise
%     process. Equivalently, it may also be viewed as the variance estimate of
%     the white noise innovations under the assumption of homoskedasticity.
%
% Outputs:
%   K - Conditional variance constant (scalar).
%
%   GARCH - P-element column vector of coefficients of lagged conditional 
%     variances.
%
%   ARCH - Q-element column vector of coefficients of lagged squared 
%     innovations.
%
% Note: 
%   This is an internal helper function for GARCHFIT. No error checking is 
%   performed.
%

%
% The following initial guesses are based on empirical observation of GARCH
% model parameters. This approach is rather ad hoc, but is very typical of
% GARCH models in financial time series. The most common (and very useful!) 
% GARCH model is the simple GARCH(1,1) model in which the coefficient of the
% lagged conditional variance (i.e., the 'GARCH' coefficient) is about 0.8 
% to 0.9, and the coefficient of lagged squared innovation (i.e., the 'ARCH' 
% coefficient) is about 0.05. Thus, a reasonable GARCH(1,1) assumption is:
%
%            h(t) = K + 0.85h(t-1) + 0.05e^2(t-1)
%
% In a GARCH(1,1) model, the unconditional variance of the innovations 
% process, V, is
%
%            V = K / (1 - (0.85 + 0.05))
% or,
%
%            K = V*(1 - (0.85 + 0.05))
%
% For higher-order GARCH(P,Q) models, this approach assumes the sum of the
% lagged conditional variance coefficient = 0.85, and the sum of the coefficients
% of lagged squared innovations = 0.05.
%

GARCH =  0.85;
GARCH =  GARCH(ones(P,1)) / max(P,1);
GARCH =  GARCH(:);

ARCH  =  0.05;
ARCH  =  ARCH(ones(Q,1)) / max(Q,1);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99综合电影在线视频| 亚洲天堂a在线| 9191成人精品久久| 欧美三级乱人伦电影| 91国产免费观看| 欧美四级电影在线观看| 欧美日韩三级视频| 日韩亚洲欧美中文三级| 久久人人97超碰com| 国产三级精品三级在线专区| 国产欧美精品在线观看| 国产精品九色蝌蚪自拍| 亚洲欧美视频一区| 亚洲五月六月丁香激情| 另类综合日韩欧美亚洲| 国产不卡视频在线播放| 91丨九色丨尤物| 91麻豆精品91久久久久久清纯| 亚洲综合区在线| 天天综合网 天天综合色| 久久99国内精品| 成人黄色软件下载| 67194成人在线观看| 久久久欧美精品sm网站| 日韩美女精品在线| 免费不卡在线观看| 粉嫩久久99精品久久久久久夜| 日本乱码高清不卡字幕| 日韩午夜中文字幕| 亚洲免费观看高清完整版在线观看熊| 亚洲国产精品影院| 国产成人综合在线| 欧美喷潮久久久xxxxx| 久久久久久一级片| 亚洲sss视频在线视频| 精品在线播放午夜| 欧美在线视频不卡| 欧美国产一区视频在线观看| 亚洲福利国产精品| gogo大胆日本视频一区| 日韩欧美国产电影| 亚洲一区二区四区蜜桃| 成人福利视频网站| 精品蜜桃在线看| 午夜精品一区二区三区电影天堂 | 另类欧美日韩国产在线| 色综合久久88色综合天天免费| 欧美一区日韩一区| 亚洲一线二线三线久久久| 国产麻豆精品在线观看| 91精品国产综合久久蜜臀| 亚洲视频在线观看一区| 国产精品1区二区.| 亚洲精品在线观| 亚洲电影一区二区三区| av不卡一区二区三区| 国产人久久人人人人爽| 精品一区二区三区在线观看 | 久久女同精品一区二区| 亚洲va欧美va天堂v国产综合| 国产aⅴ综合色| 精品成人一区二区三区四区| 日日夜夜免费精品| 欧美日韩五月天| 香港成人在线视频| 欧美中文字幕一区二区三区亚洲| 国产精品久久久久久久蜜臀| 久久99日本精品| 欧美成人综合网站| 久久国产精品一区二区| 日韩精品一区二区三区视频| 日韩成人午夜电影| 91麻豆精品国产91久久久久久久久 | 亚洲日本乱码在线观看| 波多野结衣亚洲| 亚洲欧洲日韩一区二区三区| 成人深夜福利app| 欧美韩国日本不卡| 91天堂素人约啪| 亚洲电影激情视频网站| 欧美欧美欧美欧美首页| 免费成人在线观看视频| 精品国产乱码久久久久久1区2区 | 国产区在线观看成人精品 | 男人的天堂亚洲一区| 欧美一级在线免费| 国产呦萝稀缺另类资源| 国产丝袜欧美中文另类| 成人一道本在线| 亚洲卡通动漫在线| 欧美一二三四在线| 国产精品一级在线| 亚洲女同女同女同女同女同69| 色妞www精品视频| 日韩精品电影在线观看| 久久久久久黄色| www.欧美亚洲| 无吗不卡中文字幕| 日本一区二区视频在线| 在线免费观看不卡av| 另类小说图片综合网| 中文字幕的久久| 欧美亚洲综合色| 久久99精品国产.久久久久久 | 精品在线一区二区三区| 国产视频一区在线观看| 色乱码一区二区三区88| 另类调教123区 | 日韩一区二区三区视频在线观看| 国产一区二区精品久久| 一区二区三区精品久久久| 欧美成人官网二区| 色综合 综合色| 精品亚洲国内自在自线福利| 亚洲色欲色欲www在线观看| 91麻豆精品国产91久久久 | 成人手机在线视频| 日本欧美加勒比视频| 亚洲色图第一区| 久久综合久色欧美综合狠狠| 97se亚洲国产综合自在线| 日韩av一级片| 亚洲另类在线视频| 国产亚洲美州欧州综合国| 欧美日本不卡视频| 99久久久精品免费观看国产蜜| 蜜臀av性久久久久蜜臀aⅴ| 国产精品久久久久久一区二区三区| 欧美精选一区二区| 色婷婷精品久久二区二区蜜臀av| 国产乱淫av一区二区三区| 日韩黄色免费电影| 亚洲一区二区三区影院| 亚洲人吸女人奶水| 中文字幕在线一区二区三区| 久久久综合视频| 精品国产乱码久久久久久久 | 欧美极品少妇xxxxⅹ高跟鞋| 欧美一区二区三区免费大片| 欧美三级视频在线播放| 色婷婷综合久久久久中文一区二区| 国产一区二区免费视频| 久久精品二区亚洲w码| 日本麻豆一区二区三区视频| 亚洲一区二区三区美女| 亚洲一区在线观看网站| 亚洲美女精品一区| 亚洲欧美一区二区三区孕妇| 中文字幕亚洲一区二区va在线| 中文字幕国产一区二区| 国产精品亲子乱子伦xxxx裸| 国产精品沙发午睡系列990531| 国产欧美精品区一区二区三区| www国产成人免费观看视频 深夜成人网| 欧美二区三区91| 日韩天堂在线观看| 久久综合久久综合亚洲| 国产亚洲视频系列| 国产精品国产三级国产a| 亚洲婷婷综合久久一本伊一区| 中文字幕在线观看不卡| 樱花草国产18久久久久| 亚洲成人激情av| 日韩主播视频在线| 九九精品一区二区| 国产成人午夜视频| 色综合久久久久久久久| 精品视频一区三区九区| 91精品国产aⅴ一区二区| 日韩欧美一级二级三级久久久| 精品久久久久久综合日本欧美| 久久婷婷国产综合国色天香 | 日韩欧美另类在线| 国产欧美日韩精品在线| 亚洲激情成人在线| 蜜桃视频第一区免费观看| 国产成人午夜片在线观看高清观看| 成人不卡免费av| 在线不卡一区二区| 国产欧美一区二区精品性 | 欧美疯狂性受xxxxx喷水图片| 精品国产精品一区二区夜夜嗨| 日本一区二区不卡视频| 一区二区三区高清| 精品一区二区三区免费观看| 97久久精品人人爽人人爽蜜臀| 在线成人小视频| 国产精品沙发午睡系列990531| 亚洲成a人v欧美综合天堂| 国产老肥熟一区二区三区| 在线视频综合导航| 欧美国产欧美综合| 日韩一区欧美二区| 色域天天综合网| 亚洲国产精品高清| 蜜桃传媒麻豆第一区在线观看| 色婷婷精品大在线视频| 久久久久97国产精华液好用吗| 亚洲一本大道在线| 菠萝蜜视频在线观看一区|