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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? maxseek

?? 計量經(jīng)濟(jì)模型,SWARCH模型(含體制變換的ARCH)原代碼
??
字號:
@ This GAUSS file reads in data, sets options, and calls numerical
   optimization routine for numerical estimation of SWARCH model @

        output file=junk.out reset;
        format /m1 /ros 16,8;
/* ======================================================================= */
@  Alter this section so as to read in your data and set parameters @

           @ Crisp data @
           capt = 1331;        @ capt is the sample size @
           load y[capt,1] = crisp.w;

@--------- Adjust any of the following to control specification desired --- @
           nk = 5;           @ nk is the first observation to be used in
                               estimation @
           ns = 3;           @ ns is the number of primitive states @
           pphi = 1;         @ pphi is the number of lags in autoregression
                                for y; @
           izz = 1;          @ izz = 1 means pij parameterized as
                                       th(ij)^2/sum(th(ij)^2)
                               izz = 2 means pij parameterized as pij @
           ipm =3;          @ ipm specifies order in which transition probs
                               are parameterized
                                  ipm = 1 implies p11 and p22 estimated
                                  ipm = 2 implies pij for i=1,..,n j=1,..,n-1
                                  ipm = 3 user input code @
           irs = 2;          @ irs denotes the number of probabilities that
                               are restricted @
           karch = 2;        @ karch is the order of the ARCH process @
           larch = 1;        @ larch = 0 means no leverage effect,
                               larch = 1 means leverage effect @
           barch = 2;        @ barch = 0 means estimate initial variance by MLE
                               barch = 2 means don't need initial variance @
           tarch = 1;        @ tarch = 0 means normal
                               tarch = 1 means t distribution @

@------ Input initial values for parameters ------------ @
/*   The order in which variables are represented is as follows
              constant term in regression
              autoregressive terms in regression
              initial variance parameter
              constant term in ARCH equation
              ARCH params in state 1
              next elements:   when izz =0 these are the transition probs
                               when izz =1 these are params v(i,j) such that
                                    p(i,j) = v(i,j)^2 / sum j v(i,j)^2
                               elements are ordered as p11, p22 when ns =2
                                    ordered as p(1,1),p(2,1),...,p(ns,1),
                                    p(1,2),...,p(ns-1,ns) when ns > 2
              next (ns - 1) elements: factor squared residuals are divided by
                                      to get non-switching ARCH
              leverage parameter
              degrees of freedom parameter for t distribution */

      proc startval; @procedure to set starting values @
      local th;
      let th[13,1] =
     0.35080500       0.25003200      -0.56817500
     0.027988000      -0.11706300
     11.4016   0.051132  10.765493  0.1208310
       4.3512660        13.146594       0.42415600       -5.2199370 ;

/*         let th[11,1] =
           0.34775  0.25589  0.55992  0.06036  0.16047  0.051751
           0.99195  0.99907  5.7857  0.44348  3.7547 ; */
      retp(th);
      endp;

/*==========================================================================*/
  @ In general no parts of this section should be changed @

ps = karch;  @ ps is the number of lagged states that matter @
n = ns^(ps+1);     @ n is the dimension of the state vector @
kc = 1;            @ kc = 2 to print out ergodic probs and likelihood value
                     with each call to likelihood @
ks = 1;            @ ks = 2 if smoothed probs are to be calculated @
captst = capt - nk +1; @ captst is the effective sample size @
resid = zeros(capt,1);  @ regression residuals (filled in by procedures)@
skif = zeros(captst,n); @ skif is the matrix of filtered probs @
skis = zeros(captst,n); @ skis is the matrix of smoothed probs @
varfor = zeros(capt,1); @varfor is the vector of forecast variances @
outprob = zeros(capt,1);  @outprob is the vector of outlier probabilities @
id = eye(ns);           @ used in certain calculations below @

proc pattern1; @ This proc returns a (ps+1)*ns x n matrix.  The ith
                column contains a one in row j if st = j, contains a
                one in row ns+j if st-1 = j, and so on @
     local i1,ix,iq,na;
     na = n/ns;
     ix = eye(ns).*.ones(1,na);
     i1 = 1;
     do until i1 > ps;
       na = na/ns;
       iq = ones(1,ns^i1).*.(eye(ns).*.ones(1,na));
       ix = iq|ix;
     i1 = i1+1;
     endo;
retp(ix);
endp;

/* ======================================================================= */
proc matpm(xth);  @This proc defines the user's conventions for reading
                 elements of Markov transition probabilities from
                 parameter vector @
   local pm,ixth;
   ixth = rows(xth);
   pm = zeros(ns,ns);
     if ipm == 1;  @ for ns =2 this option has parameters as p11 and p22 @
          if izz == 1;
             pm[1,1] = xth[1,1]^2/(1 +xth[1,1]^2);
             pm[2,2] = xth[2,1]^2/(1 + xth[2,1]^2);
          else;
             pm[1,1] = xth[1,1];
             pm[2,2] = xth[2,1];
          endif;
          pm[2,1] = 1 - pm[1,1];
          pm[1,2] = 1 - pm[2,2];
     elseif ipm == 2;  @ general case has parameters pij for i = 1,...,n and
                          j = 1,...,n-1 @
        pm[1:ns-1,.] = reshape(xth[1:ixth,1],ns-1,ns);
        if izz == 1;
           pm[ns,.] = ones(1,ns);
           pm = pm^2;
           pm = pm./(sumc(pm)');
        else;
           pm[ns,.] = (1 - sumc(pm))';
        endif;
     elseif ipm == 3;  @ This section can be rewritten by user to impose zeros
                          and ones where desired @
        if izz == 1;
             pm[1,1] = xth[1,1]^2/(1 + xth[1,1]^2);
             pm[1,3] = xth[2,1]^2/(1 + xth[2,1]^2 + xth[4,1]^2);
             pm[2,1] = 1/(1 + xth[1,1]^2);
             pm[2,2] = xth[3,1]^2/(1 + xth[3,1]^2);
             pm[2,3] = xth[4,1]^2/(1 + xth[2,1]^2 + xth[4,1]^2);
             pm[3,2] = 1/(1 + xth[3,1]^2);
             pm[3,3] = 1/(1 + xth[2,1]^2 + xth[4,1]^2);

        elseif izz == 2;
             pm[1,1] = xth[1,1];
             pm[1,3] = xth[2,1];
             pm[2,1] = 1 - xth[1,1];
             pm[2,2] = xth[3,1];
             pm[2,3] = xth[4,1];
             pm[3,2] = 1 - xth[3,1];
             pm[3,3] = 1 - xth[2,1] - xth[4,1];
        endif;
    endif;
retp(pm);
endp;

/* ======================================================================= */
   @ This section echos values of parameters @

    "Order of autoregression";;pphi;
    "Order of ARCH process";;karch;
    "Number of primitive states";;ns;
    "Number of lagged states that affect y";;ps;
    "First observation used for estimation is";;nk;
    if larch == 0; "no leverage effect";  else; "with leverage effect"; endif;
    if tarch == 0;"Distribution is Normal"; elseif tarch ==1;
           "distribution is t"; endif;

proc echoo(th); @ proc to echo starting values @;
  local spar,alpha0,phi,sig0,a0,a1,g1,pm,b1,l1,cm,nu,eps,rss;

  alpha0 = th[1,1];
  spar = 2;
  if pphi > 0;
     phi = th[2:2+pphi-1,1];
     spar = spar+1;
  else;
     phi = 0;
  endif;
  "Constant term in regression";;  alpha0;
  "Autoregressive coefficients in regression";; phi';
   if barch == 0;
       sig0 = abs(th[spar,1]);
      "Initial variance";;sig0;
      spar = spar + 1;
   else;
       "Initial variance not neeeded ";
   endif;
   a0 = abs(th[spar,1]);
   a1 = abs(th[spar+1:spar+karch,1]);
  "Constant term in ARCH process";;a0;
  "Coefficients on lagged epsilon squared in ARCH process";;a1';
  spar = spar+1+karch;
  pm = matpm(th[spar:spar+(ns*(ns-1))-1-irs,1]);
  "(Transposed) matrix of transition probabilities";;pm;"";
  "The state with no adjustment to ARCH process is state 1, with transition";
  "probability ";;pm[1,1];
  spar = spar+(ns*(ns-1))-irs;

  g1 = abs(th[spar:spar+ns-2,1]);
  "Vector of variance factors for states 2 through";;ns;;g1';
  spar = spar+ns-1;

  if larch == 1;
     l1 = abs(th[spar,1]);
     "Coefficient on negative lagged change for asymmetric effect";;l1;
     spar = spar+1;
  endif;
  if tarch == 1;
       nu = 2 + abs(th[spar,1]);
       "degree of freedom for t distribution is";; nu;
       spar = spar + 1;
  endif;

retp(a0);
endp;

/* ================================================================ */
  @ This section calls main programs @

hp = pattern1;
#include procs;
x = startval;

 @ The following lines are for convenience of analysis and should be removed
             for final calculations
   izz = 2;
   kc = 2;
   ks = 2; @

call echoo(x);
"";"Initial values:";; x';
"Initial value for negative log likelihood:";; ofn(x);

"";"Do you wish to continue (y or n)?";;
  zzs = cons;
  if zzs .$== "n";
      end;
  endif;

@  goto jump; @

/* ==================================================================== */
@ Set parameters to use Gauss numerical optimizer @

     library optmum;
     #include optmum.ext;
      __btol = 1.e-08; @ This controls convergence criterion for coefficients@
      __gtol = 1.e-08; @ This controls convergence criterion for gradient @
      __algr = 1;     @ This chooses BFGS optimization  @
      __miter = 80;  @ This controls the maximum number of iterations @
      __output = 1;   @ This causes extra output to be displayed @
      __covp = 0;     @ This speeds up return from OPTMUM @

@ Next call  the GAUSS numerical optimizer @
        {x,f,g,h} =optmum(&ofn,startval);
       
"";"";"======================================================";
"          FINAL ESTIMATES";
"";"Value of log likelihood:";;-f;
"";"Coefficients:";x';"";
call echoo(x);
"";"Gradient vector:";g';
    vg=hessp(&ofn,x);
    {va,ve} = eigrs2(vg);
    va = sortc(va~ve',1);
      if va[1,1] > 0;
        "Standard errors:";
         h=invpd(vg);
         hh=sqrt(diag(h));
         hh';
       else;
          "Hessian not positive definite; eigenvalues are";
           va[.,1]';
           "eigenvector associated with smallest eigenvalue is";
           va[1,.];
       endif;

/* ======================================================================= */
@ Print out complete analysis @
jump:

kc = 2;
ks = 2;
call ofn(x);
nxx = captst; @ Use nxx = captst for full output @
"Probabilities for primitive states";

"filtered probabilities";format /rd 1,0;
"Obs ";;"return  ";;
t = 0;
do until t > ps;
  i = 1;
    do until i == ns;
       "P(st-";;t;;"=";;i;;") ";;
     i = i+1;
     endo;
  t = t+1;
endo;"";
format /rd 6,4;
 skif = (skif*hp')*(eye(ps+1).*.id[.,1:ns-1]);
 skif =  seqa(nk,1,captst)~y[nk:capt,1]~skif;
 skif[1:nxx,.];

"";"smoothed probabilities";
format /rd 1,0;
"Obs ";;"return ";;
i = 1;
   do until i > ns;
      "P(st = ";;i;;") ";;
   i = i+1;
   endo;
format /rd 6,4;
 skis = skis*hp';
 skis = seqa(nk,1,captst)~y[nk:capt,1]~skis[.,1:ns];
 skis[1:nxx,.];
"";"   Obs   Residual  Variance  Prob of observing larger value";
outprob = 1 - outprob;
iitlow = 0;
iithigh = 0;
it = 1;
do until it >  nxx;
    nk+it-1;;"   ";;resid[nk+it-1,1];;"   ";;varfor[nk+it-1,1];;"   ";;
    if outprob[it+nk-1,1] > 0.975;
            outprob[it+nk-1,1];;"  *";
            iitlow = iitlow+1;
    elseif outprob[it+nk-1,1] < 0.025;
            outprob[it+nk-1,1];;"  *";
            iithigh = iithigh+1;
    else;
            outprob[it+nk-1,1];
    endif;
it = it+1;
endo;
"";"";"Number of observations below .025 level:";iitlow;
      "Number of observations above .975 level:";iithigh;
/* hh = sortc(skis[1:captst,1]~outprob[nk:capt,1],2);
"";"Observations with lowest p values";
"";"   Obs   P-value";
format /m1 /ros 16,8;
hh[1:25,.];
"";"Observations with highest p values";  */

format /m1 /ros 16,8;

hh = skis[1:captst,1]~outprob[nk:capt,1];
hh = sortc(hh,2);
hh;


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区三区乱码在线| 国产不卡免费视频| 欧美巨大另类极品videosbest| 亚洲一区二区三区视频在线| 欧洲一区二区av| 亚洲国产成人高清精品| 91精品视频网| 国产剧情一区在线| 亚洲特级片在线| 欧美二区在线观看| 国内精品国产三级国产a久久| 欧美激情一区不卡| 欧美制服丝袜第一页| 日韩电影在线一区二区| 久久精品免视看| 91福利小视频| 激情欧美日韩一区二区| 日韩一区日韩二区| 制服丝袜中文字幕一区| 国产精品亚洲午夜一区二区三区| 国产精品成人在线观看| 欧美男生操女生| 国产一区二区免费看| 亚洲欧美另类小说视频| 欧美一区二区成人| 高清国产一区二区| 日韩av一区二区三区四区| 国产亚洲精品bt天堂精选| 欧洲av在线精品| 国产一区二区三区在线看麻豆| 亚洲精品综合在线| 久久先锋资源网| 在线观看免费视频综合| 国产成人啪免费观看软件 | 精品国产1区2区3区| k8久久久一区二区三区| 秋霞成人午夜伦在线观看| 亚洲天堂精品在线观看| 精品99一区二区| 欧美日韩极品在线观看一区| 成人小视频在线| 久久99国产精品麻豆| 亚洲黄色片在线观看| 夜夜嗨av一区二区三区中文字幕| 精品国产99国产精品| 欧美日本精品一区二区三区| eeuss鲁一区二区三区| 蜜臀av性久久久久蜜臀aⅴ流畅 | 久久免费偷拍视频| 欧美日韩中文字幕精品| 91麻豆123| 成人午夜激情在线| 精品一区在线看| 日韩不卡免费视频| 亚洲va天堂va国产va久| 亚洲欧美日韩一区二区三区在线观看| 久久免费午夜影院| 精品国产91洋老外米糕| 日韩欧美一区在线| 欧美一区二区三区免费在线看| 色婷婷av一区二区三区软件| 成人黄色在线网站| 国产91对白在线观看九色| 久久综合综合久久综合| 日韩二区三区四区| 日产精品久久久久久久性色| 亚洲一区在线观看网站| 一区二区三区日韩精品视频| 亚洲天天做日日做天天谢日日欢 | 欧美精品色一区二区三区| 色综合久久天天| www.av亚洲| 一本色道久久综合亚洲精品按摩| 99久久精品免费看| 91麻豆文化传媒在线观看| 97se亚洲国产综合在线| 91美女福利视频| 欧美色精品天天在线观看视频| 在线观看日韩电影| 欧美精品成人一区二区三区四区| 欧美精三区欧美精三区| 91精品黄色片免费大全| 欧美成人女星排名| 精品久久久久久久久久久久包黑料| 精品国产伦一区二区三区观看体验| 精品久久久久久无| 久久精品一区八戒影视| 欧美国产激情一区二区三区蜜月 | 精品福利一区二区三区免费视频| 亚洲精品一区二区三区99| 国产午夜精品在线观看| 中文字幕在线不卡视频| 一区二区三区精品在线观看| 亚洲自拍与偷拍| 蜜桃91丨九色丨蝌蚪91桃色| 国内精品免费**视频| 成人午夜激情在线| 精品视频999| 精品久久久久久亚洲综合网| 日韩和的一区二区| 久久精品久久综合| 成人午夜私人影院| 欧美午夜电影一区| 欧美www视频| 自拍视频在线观看一区二区| 一二三四社区欧美黄| 免费观看一级特黄欧美大片| 国产精品77777| 欧美日韩在线综合| 久久综合视频网| 一区二区高清视频在线观看| 激情深爱一区二区| 色域天天综合网| 日韩免费性生活视频播放| 国产精品少妇自拍| 日本中文一区二区三区| 国产精品1区2区| 欧美亚洲综合一区| www久久精品| 亚洲一区精品在线| 粉嫩aⅴ一区二区三区四区 | 精品久久久久久久久久久久久久久久久 | 久久久精品国产免费观看同学| 亚洲精品精品亚洲| 国产伦精品一区二区三区免费迷 | 久久福利资源站| 99麻豆久久久国产精品免费优播| 欧美理论片在线| 国产精品欧美综合在线| 男女男精品视频| 一本久久a久久精品亚洲| 久久丝袜美腿综合| 日韩av一区二区三区四区| 91污在线观看| 久久久.com| 日本欧美加勒比视频| 色婷婷国产精品| 国产精品久久久久aaaa| 国产主播一区二区三区| 7777女厕盗摄久久久| 亚洲蜜臀av乱码久久精品| 国产激情视频一区二区三区欧美 | 激情亚洲综合在线| 在线不卡a资源高清| 一区二区三区四区五区视频在线观看 | 538prom精品视频线放| 亚洲黄色性网站| 91麻豆国产精品久久| 日本成人在线网站| 欧美三级乱人伦电影| 亚洲免费在线观看视频| 成人在线一区二区三区| 26uuu久久天堂性欧美| 日日噜噜夜夜狠狠视频欧美人| 在线这里只有精品| 成人欧美一区二区三区小说| 粉嫩蜜臀av国产精品网站| 日本一区二区三区在线观看| 激情综合亚洲精品| 精品久久人人做人人爽| 激情小说欧美图片| 26uuu精品一区二区三区四区在线| 久久av资源网| 精品国精品国产| 极品少妇一区二区| 精品国产乱码久久久久久免费 | 国产一区二区久久| 久久久久久久性| 国产69精品久久99不卡| 国产亚洲一区字幕| 成人黄色av电影| 亚洲欧洲日本在线| 色综合av在线| 天天av天天翘天天综合网色鬼国产| 欧美日韩中文一区| 奇米影视在线99精品| 精品国产亚洲一区二区三区在线观看| 久久国产日韩欧美精品| 久久午夜老司机| 99精品视频免费在线观看| 亚洲青青青在线视频| 欧美日韩美女一区二区| 蜜臀av亚洲一区中文字幕| 久久久亚洲综合| 99精品欧美一区二区三区小说 | 国产电影一区在线| 日本一区二区久久| 在线看不卡av| 青椒成人免费视频| 亚洲国产经典视频| 在线观看欧美精品| 精品一区二区在线观看| 亚洲国产精品传媒在线观看| 色天天综合久久久久综合片| 五月天激情综合| 国产午夜精品久久久久久免费视| 色老汉一区二区三区| 免播放器亚洲一区| 欧美韩国日本综合| 欧美日韩视频第一区|