我一直在学习gauss软件,遇到很多问题,都是自己费了很大劲才解决。因此,希望大家如果能把问题贴上,让大家共同寻找解决方法,或许能少走弯路。
同意建个guass楼--aris_zzy
gauss软件占用资源没有matlab大,而且比eviews的计量经济功能要强,为什么要学傻瓜似的eviews呢?而且eviews里都是编好的页面,很多检验的结果不一定可靠,如果要深度分析还是要在eviews里编程。
为了供大家学习,以后我会把自己的gauss的计量经济学资料传上,供大家下载。
1、https://bbs.pinggu.org/thread-245644-1-1.html
Monte Carlo Program for OLS and GLS under Autocorrelation: AR(1)建议:会的话可以不下,有的话可以不下。来源:PREPARED BY S.C. AHN
2、https://bbs.pinggu.org/thread-245617-1-1.html
Bootstrap OLS,Data generation under Weak Ideal Conditions3、https://bbs.pinggu.org/thread-245606-1-1.html
pdf里介绍BOOTSTRAP的基本原理以及gauss code。两个程序:程序1:ASYMPTOTIC WALD TEST和BOOTSTRAP WALD TEST的比较。程序2:REJECTION RATE OF ASYMPTOTIC WALD TEST和BOOTSTRAP WALD TEST建议:会的话可以不下,有的话可以不下。来源:PREPARED BY S.C. AHN
4、https://bbs.pinggu.org/thread-245590-1-1.html
Monte Carlo simulation evidence of coverage rates of confidence intervals constructed using chi-square asymptotics, Efron's percentile, Hall's percentile, percentile-t (equal-tailed) and percentile-t (symmetric) bootstrap methods pdf里介绍OLS和GMM估计方法,置信区间等等。建议:如果有的话可以不下,会的话可以不下。来源:Econ 681, Fall 2005 Department of Economics, Concordia University
5、https://bbs.pinggu.org/thread-221720-1-1.html
同质面板单位根检验Peter C.B. Phillips and Donggyu Sul, Econometrics Journal 2003, Vol 6. pp 217?60程序1、Monte Carlo Study Gauss Code for Homogeneity Test "Dynamic Panel Estimation and Homogeneity Testing Under
Cross Section Dependence程序2、Procedure for panel unit root test for "Dynamic Panel Estimation and Homogeneity Testing Under Cross Section Dependence"。
6、https://bbs.pinggu.org/thread-221717-1-1.html
7、https://bbs.pinggu.org/thread-193505-1-1.html
Monte Carlo Simulations8、https://bbs.pinggu.org/thread-193310-1-1.html
1、notes on monte carlo, bootstrapping and estimation by simulation2、Monte Carlo Methods3、 Bootstrapping。
我这里还有其他的,会继续贴上
你这搞的太高深么
需要从基础的了解啊
如果大家连OLS这些也很难上手的。你上面提到的大家估计更难学习了,
所以就会放弃GAUSS
论坛上的软件,大部分是最基础的内容,然后才可能讨论高深的。
这个版上有,版主勿删
[此贴子已经被作者于2007-10-20 16:04:32编辑过]
大小:446.48 KB
[原创]强烈建议版主对gauss软件设置一个讨论帖,欢迎大家就学gauss软件遇到的问题帖出来,共同讨
本附件包括:
贴一个gauss程序,请大家研究一下:
@ Written/Modified by: Junsoo Lee Disclaimer: This code is provided gratis without any guarantees or warrantees. Proprietary modifications of this code are not permitted. @ /* Im and Lee, Panel LM Unit Root Test with Level Shifts, WP, 2001 program: Panel_SP.txt Panel LM test using SP test with no breaks. See also, SP1.txt, panel_tw.txt (two breaks), panel_LS.txt (one break) Note: This program determines the optimal lag. */ @ ================================================================ @ out2 = "panel_sp.out"; "SP t-stat with the data-dependent choice of # lags "; "Also, panel test "; load crit[27,19] = c:\work\gauss\panelcri.dat; @ ================================================================ @ /* Options */ maxk = 8; @ # maximum augmentation lags allowed for @ n = 100; @ # of observations @ y = cumsumc(rndn(n,1)); @ Or, Read the dat file here. -> load y[n,1] = data.txt; @ n = 94; @ # of observations @ npanel = 19; @ # of panels @ @ ignored @ T1_end = .1; T2_end = .9; @ End points (10% of both ends are not considered) @ crit_t = 1.645; @ critical value of the t-stat for lag determination @ output file = ^out2 reset; format /rd/m1 4,0; "Date : ";; tt=date; tt[1:3]'; ""; "max p : " maxk; "# panels : " npanel; format /rd/m1 4,1; @ set up @ panel_t = zeros(npanel,1); panel_k = zeros(npanel,1); panel_b = zeros(npanel,1); @ ==== DATA ====================================================== @ load data[45,20] = c:\work\hyster\unemp2.txt; "Data: Unemp2.txt"; let name = Year Australia Austria Belgium Canada Denmark Finland France Germany Ireland Italy Japan Netherlands Norway Newzealand Spain Sweden Switzerland UK USA; jjj = 2; do while jjj <= 20; y = data[.,jjj]; @ Due to missing observations @ if jjj == 16; y = y[2:rows(data)]; endif; if jjj == 20; y = y[2:rows(data)]; endif; if jjj == 11; y = y[1:rows(data)-1]; endif; if jjj == 14; y = y[1:rows(data)-1]; endif; if jjj == 18; y = y[1:rows(data)-1]; endif; if jjj == 19; y = y[2:rows(data)-1]; endif; format /m1/rd 20,0 ; ""; ""; "|========> ";; "Series (not logged) : " $name[jjj,1]; ""; n = rows(y); format /m1/rd 5,0; "# of obs = " n; @ ================================================================ @ if cols(data) == npanel; mmm = jjj; fstcol = 0; elseif cols(data) == npanel+1; mmm = jjj-1; fstcol = 1; else; "Error in # of panels !!!"; stop; endif; format /m1/rd 6,4; "Panel # = ";; mmm; ""; /* End of Options */ @ imodel 1 = Crash model (dummy on the intercepts) 2 = Breaking trend (dummy on the trend) @ imodel=1; do while imodel <=1; @ once for each model for the panel test @ T = n; T1 = round(T1_end * rows(y)); T2 = round(T2_end * rows(y)); lag = 0; if T1 < maxk+2; T1 = maxk + 3; endif; lmestd1 = zeros(T,1); lmtd1 = zeros(T,1); lmlm1 = zeros(T,1); lmtk1 = zeros(T,1); lmoptk1 = zeros(T,1); T1 = 1; T2 = 1; ii = T1; Do while ii <= T2; output off; "*";; Estconf = ii; Estconf = 0; @ no break @ lmtk = zeros(maxk+1,1); lmlm = zeros(maxk+1,1); lmestd = zeros(maxk+1,1); lmtd = zeros(maxk+1,1); kk = 0; @ lag @ do while kk <= maxk; Estconf = ii; Estconf = 0; @ no break @ If imodel == 1; {lmtstat, lmed, lmtd0, lmres, lmbeta, lmtval, lmsig} = nLMk(y, EstConf,kk,0); Endif; If imodel == 2; {lmtstat, lmed, lmtd0, lmres, lmbeta, lmtval, lmsig} = nLMCk(y, EstConf,kk,0); Endif; lmestd[kk+1] = lmed; lmtd[kk+1] = lmtd0; lmlm[kk+1] = lmtstat; if kk > 0; lmtk[kk] = lmtval[kk+1]; endif; @ t-stat of the coeff. of the last augmented term @ kk = kk + 1; endo; jj = maxk; isw = 0; do while isw ne 1; if (abs(lmtk[jj]) > crit_t) or (jj == 0); lmoptk1[ii] = jj; isw = 1; endif; jj = jj - 1; endo; tt = lmoptk1[ii]+1; lmlm1[ii] = lmlm[tt]; ii = ii + 1; Endo; output on; lmo4 = minindc1(lmlm1[T1:T2]) + T1 - 1; optb = lmo4; optk = lmoptk1[optb]; optb = 0; @ no break @ format /rd/m1 10,4; ""; "-----------------------------------------"; ""; "Model (1=A, 2=C) = " imodel; If imodel == 1; {lmtstat, lmed, lmtd0, lmres, lmbeta, lmtval, lmsig} = nLMk(y, optb, optk, 0); Endif; If imodel == 2; {lmtstat, lmed, lmtd0, lmres, lmbeta, lmtval, lmsig} = nLMCk(y, optb, optk, 0); Endif; panel_t[mmm] = lmtstat; panel_k[mmm] = optk; panel_b[mmm] = optb; ""; "LM test statistic = " lmtstat; "Estimated break point = " optb; "Selected lag = " optk; ""; "Estimated coeff. of dummy var. = " lmed; "Its t-stat = " lmtd0; "Standard error .. = " lmsig; "Standardized dummy coeff = " lmed/lmsig; if imodel == 1; ""; "Coeff and t-stat"; "Z(t) = [S(t-1), (lags..omitted), 1, B(t)] "; endif; if imodel == 2; ""; "Coeff and t-stat"; "Z(t) = [S(t-1), (lags..omitted), 1, B(t), D(t)] "; endif; tt1 = lmbeta[1] | lmbeta[2+optk:rows(lmbeta)]; tt2 = lmtval[1] | lmtval[2+optk:rows(lmtval)]; tt3 = tt1 ~ tt2; tt3; ""; imodel = imodel + 1; endo; jjj=jjj+1; endo; @ Reading critical values @ @ row location @ if T < 10; row_n = 1; endif; if T > 10 and T < 25; row_n = T-10+1; endif; if T > 24 and T < 28; row_n = 16; endif; if T > 27 and T < 33; row_n = 17; endif; if T > 32 and T < 38; row_n = 18; endif; if T > 37 and T < 43; row_n = 19; endif; if T > 42 and T < 48; row_n = 20; endif; if T > 47 and T < 53; row_n = 21; endif; if T > 54 and T < 65; row_n = 22; endif; if T > 64 and T < 75; row_n = 23; endif; if T > 74 and T < 85; row_n = 24; endif; if T > 84 and T < 95; row_n = 25; endif; if T > 94 and T < 150; row_n = 26; endif; if T > 149; row_n = 27; endif; @ Calculating the panel LM test statistic @ ""; ""; "--------------------------------"; " PANEL LM statistic and summary "; "--------------------------------"; output file = ^out2 on; format /rd/m1 7,3; "";""; LM_t = panel_t; meanLM = meanc(LM_t); meanp = 0; varp = 0; mmm = 1; do while mmm <= npanel; @ column location @ if panel_k[mmm] > 8; optk = 8; else; optk = panel_k[mmm]; endif; ct1 = crit[row_n,2+2*optk]; ct2 = crit[row_n,3+2*optk]; ct = ct1 ~ ct2 ; ct'; meanp = meanp + crit[row_n,2+2*optk]; varp = varp + crit[row_n,3+2*optk]; mmm = mmm + 1; endo; meanp = meanp / npanel; varp = varp / npanel; panel_LM = sqrt(npanel) * (meanLM - meanp) / sqrt(varp); "Panel LM test statistic = " panel_LM; ""; outt = seqa(1,1,npanel)~panel_t~panel_k~panel_b; "Individual (i) LM statistic (ii) opt p and (iii) opt break point"; outt; ""; t1 = seqa(1,1,19); t1'; $name[2:20]'; /* Format: {lmtstat, lmed, lmtd0, lmres, lmbeta, lmtval, lmsig} = nLMCk(y, EstConf,kk,0); Input: y = series Estconf = position of the structural break kk = # of augmentation lags q = # of truncation lags (ignore here) Output: lmtstat = ADF t-statistic lmd = estimated coefficients of break dummies lmtd0 = t-stat for coefficients of break dummies lmres = residuals lmbeta = all estimated coefficients lmtval = t-stat of estimated coefficients lmsig = standard error of regression */ proc (7) = nLMk(y, config, lag, q); local lr, res, lhat, alpha, za, zt, nobs, dy, rho; local sse, tau, ratios, i, n, z, dz, pos, st, du, s1, ind, tt, temp, sai; local RR, tdel, whvar, nwvar, temp2, dt, estd, td, ch, k, stat; nobs = rows(y); if (config == 0); RR = 0; z = seqa(1,1,nobs); dz = ones(nobs-1,1); endif; if (config ne 0); RR = rows(config); pos = config[1]; du = zeros(pos,1) | ones(nobs-pos,1); i=2; do while i <= RR; pos = config; temp = zeros(pos,1) | ones(nobs-pos,1); du = du ~ temp; i = i + 1; endo; z = seqa(1,1,nobs) ~ du; dz = diff(z,1); endif; dy = diff(y,1); tdel = dy / dz; sai = y[1] - z[1,.]*tdel; st = y - sai - z*tdel; s1 = st[1:rows(st)-1,1]; ind = s1; ch = diff(st,1); k = 0 ; If (lag > 0) ; do until k >= lag ; k = k + 1 ; ind = ind ~ lagn(ch,k) ; endo ; Endif ; dy = trimr(dy,k,0); ind = trimr(ind,k,0); dz = trimr(dz,k,0); ind = ind ~ dz; alpha = dy / ind; rho = nobs * alpha[1]; res = dy - ind*alpha; sse = res'res/(rows(res)); tt = sqrt(sse*inv(ind'ind)); tau = alpha[1] ./ tt[1,1]; @WhVar = WhiteEst(res,q); NWVar = NewWEST(res,q);@ @LEE@ stat = tau; if q > 0; lr = lrvar(res,q); ratios = sse / lr; Za = rho / ratios; Zt = tau / sqrt(ratios); stat = zt; endif; estd = alpha[rows(alpha)]; td = estd ./ tt[rows(alpha),rows(alpha)]; retp(stat, estd, td, res, alpha, alpha./diag(tt), sqrt(sse)); endp ; /* Model C */ proc (7) = nLMCk(y, config, lag, q); local lr, res, lhat, alpha, za, zt, nobs, dy, rho; local sse, tau, ratios, i, n, z, dz, pos, st, du, s1, ind, tt, temp, sai; local RR, tdel, whvar, nwvar, temp2, dt, estd, td, ch, k, stat; nobs = rows(y); if (config == 0); RR = 0; z = seqa(1,1,nobs); dz = ones(nobs-1,1); endif; if (config ne 0); RR = rows(config); pos = config[1]; du = zeros(pos,1) | ones(nobs-pos,1); dt = zeros(pos,1) | seqa(1,1,nobs-pos); i=2; do while i <= RR; pos = config; temp = zeros(pos,1) | ones(nobs-pos,1); temp2 = zeros(pos,1) | seqa(1,1,nobs-pos); du = du ~ temp; dt = dt ~ temp2; i = i + 1; endo; z = seqa(1,1,nobs) ~ du ~ dt; dz = diff(z,1); endif; dy = diff(y,1); tdel = dy / dz; sai = y[1] - z[1,.]*tdel; st = y - sai - z*tdel; s1 = st[1:rows(st)-1,1]; ind = s1; ch = diff(st,1); k = 0 ; If (lag > 0) ; do until k >= lag ; k = k + 1 ; ind = ind ~ lagn(ch,k) ; endo ; Endif ; dy = trimr(dy,k,0); ind = trimr(ind,k,0); dz = trimr(dz,k,0); ind = ind ~ dz; alpha = dy / ind; rho = nobs * alpha[1]; res = dy - ind*alpha; sse = res'res/(rows(res)); tt = sqrt(sse*inv(ind'ind)); tau = alpha[1] ./ tt[1,1]; @WhVar = WhiteEst(res,q); NWVar = NewWEST(res,q);@ @LEE@ stat = tau; if q > 0; lr = lrvar(res,q); ratios = sse / lr; Za = rho / ratios; Zt = tau / sqrt(ratios); stat = zt; endif; estd = alpha[rows(alpha)]; td = estd ./ tt[rows(alpha),rows(alpha)]; retp(stat, estd, td, res, alpha, alpha./diag(tt), sqrt(sse)); endp ; proc lagn(x,n); local y; y = shiftr(x', n, (miss(0, 0))'); retp(y'); endp; proc diff(x,k) ; if ( k == 0) ; retp(x) ; endif ; retp(trimr(x,k,0)-trimr(lagn(x,k),k,0)) ; endp ; proc ptrend(p,nobs) ; local data, t, u, m, timep, it, iit, xmat, invx, beta, resid ; u = ones(nobs,1) ; if p > 0 ; timep = zeros(nobs,p) ; t = seqa(1,1,nobs); m = 1 ; do while m <= p ; timep[.,m] = t^m ; m = m + 1 ; endo ; xmat = u~timep ; else ; xmat = u ; endif ; retp(xmat) ; endp ; proc (1) = minindc1(x); local d,m,i,minx; m = 1; d = x[1]; i=1; do while i <=rows(x); if x < d; d = x; endif; i=i+1; endo; i=2; do while i <= rows(x); if d == x; m = i; goto stops; endif; i = i + 1; endo; stops: retp(m); endp;
[此贴子已经被作者于2007-11-3 17:51:42编辑过]
If imodel == 1;
{lmtstat, lmed, lmtd0, lmres, lmbeta, lmtval, lmsig} =nLMk(y, optb, optk, 0);
Endif;
If imodel == 2;
{lmtstat, lmed, lmtd0, lmres, lmbeta, lmtval, lmsig} = nLMCk(y, optb, optk, 0);
Endif;
上面两个是lm估计
lm估计量应该是tau = alpha[1] ./ tt[1,1];
这个是调用的估计程序proc (7) = nLMk(y, config, lag, q);
[此贴子已经被作者于2007-11-5 19:36:59编辑过]
(1)** The regressors are now different across individual data sets.
** That is, regressors are stochastic.
** The errors are different across different data sets
** Errors are normal
(2)** ** The regressors are now different across individual data sets.
** That is, regressors are stochastic.
** The errors are different across different data sets
** Errors are not normal: chi-square(2) - 2
(3)** ** The regressors are lagged dependent variables.
** That is, regressors are stochastic.
** The errors are different across different data sets
** Errors are normal:
(4)** The regressors are lagged dependent variables.
** That is, regressors are stochastic.
** The errors are different across different data sets.
** Errors are non-normal: Chi-square(2)-2
[此贴子已经被作者于2007-11-5 19:37:23编辑过]