全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Gauss专版
2012-5-28 23:51:48
epoh 发表于 2012-5-28 20:00
哈哈,通常比较大的矩阵
我都用matlab
呵呵,谢谢。我今天也决定用matlab来跑。只是1000万×100的矩阵好像matlab2010处理不了耶。epoh老师能给我些建议吗?多谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-5-29 11:06:59
theawang 发表于 2012-5-28 23:51
呵呵,谢谢。我今天也决定用matlab来跑。只是1000万×100的矩阵好像matlab2010处理不了耶。epoh老师能给我 ...
呵呵你的数据确实大
光是1000万×100的矩阵 就有8G
以个人电脑而言
光是一次读入就有问题,更别谈处理,请参考底下网页说明

http://www.mathworks.com/help/techdoc/matlab_prog/brh72ex-49.html
Operating System                                                  Process Limit
64-bit Windows or Linux running 32-bit MATLAB        =< 4 GB
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-5-29 19:32:12
epoh 发表于 2012-5-29 11:06
呵呵你的数据确实大
光是1000万×100的矩阵 就有8G
以个人电脑而言
谢谢epoh老师。唉,我可以考虑换成mac pro了,555
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-12 20:12:18
epoh老师,您可以参见那篇文章进行阅读。
script.zip
大小:(58.03 KB)

 马上下载

本附件包括:

  • Launch_PSTR.m
  • centered.m
  • grid_search.m
  • NLS.m
  • STAR_Panel.m
  • Data_Demo_PSTR.xls


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-12 22:21:23
ywh19860616 发表于 2012-6-12 20:12
epoh老师,您可以参见那篇文章进行阅读。
老兄,数据Data_Demo_PSTR.xls
怎会是乱码?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-12 23:08:54
epoh 发表于 2012-6-12 22:21
老兄,数据Data_Demo_PSTR.xls
怎会是乱码?
epoh老师,可能是文件版本问题,在这我也打不开。
我在网上重新下载保存了一份,已上传在附件中。

Data_Demo.xls
大小:(81.5 KB)

 马上下载


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-13 09:05:40
epoh 发表于 2012-6-12 22:21
老兄,数据Data_Demo_PSTR.xls
怎会是乱码?
epoh老师,您好,
  麻烦您给运行下附件程序JASA1.PRG,我运行出错。因为内部程序已经定义了数据,所以我选择2,然后提示:
\jasa\JASA1.PRG(474) : error G0014 : 'sub_op.fmt' : File not found



jasa.rar
大小:(147.17 KB)

 马上下载




二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-13 18:40:14
ywh19860616 发表于 2012-6-13 09:05
epoh老师,您好,
  麻烦您给运行下附件程序JASA1.PRG,我运行出错。因为内部程序已经定义了数据,所以我 ...
这个程序,我的电脑执行亦会出错
有空再看看
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-13 18:40:57
ywh19860616 发表于 2012-6-12 20:12
epoh老师,您可以参见那篇文章进行阅读。
Matlab & Winrats两者结果接近.
in Matlab:
>Launch_PSTR

Initial Conditions : Assumed Number of Thresholds r = 1   Number of Regressions = 270
Initial Conditions on (c,gamma)
    5.0000   -0.4222
**************************************
*** FINAL ESTIMATION OF PSTR MODEL ***
**************************************

   Final Estimation of the Model with r = 1 and m = 1 by NLS ***

   Initial Conditions on (gamma,c) :
  1.0e+003 *

    5.5412   -0.0003


WARNING FINAL ESTIMATION: At least one estimated Location Parameter is outside the trimming for a PTR model

The location Parameter must range from  -1.5713  to  -0.3003 for a PTR model

  RSS = 7.093      Convergence = 1   

  AIC = -4.644      BIC = -4.607   

Estimated slope parameter of the transition function (one for for each transition function)
  5.5802e+003

Estimated location parameters (per column for each transition function)
   -0.2537

Estimated slope parameters (per column for each transition function)
    0.0295   -0.0450
    0.1180   -0.1903

Standard Errors of estimated slope parameters corrected fo heteroskedasticity (per column for each transition function)
    0.0067    0.0119
    0.0143    0.0482

t-statistics based on corrected standard errors (per column for each transition function)
    4.4036   -3.7712
    8.2272   -3.9479


%%%%%%%%%%%%%%
in Winrats:

cal(panelobs=36) 1960
open data Data_Demo_PSTR.xls
data(format=xls,org=columns) 1//1960:1 21//1995:1 y q x1 x2

source gtvd.src
@gtvd(m=||1||) y
# x1 x2
# q


ESTIMATION DU MODELE A 1 VARIABLE(s) DE TRANSITION :
    Q

valeurs initiales sur c
-1.287990 -1.191639 -1.095289 -0.998938 -0.902588
-0.806237 -0.709887 -0.613536 -0.517186 -0.420835
PREMIERE ETAPE : RECHERCHE DES VALEURS INITIALES DANS LES GRILLES
selection des valeurs initiales optimales dans les grilles :
gamma=
5.000000
c=
-0.420835
objectif initial associ?=       7.28501
nombre de r嶲ressions effectu嶪s : 100

SECONDE ETAPE : OPTIMISATION BFGS A PARTIR DES VALEURS INITIALES PRECEDENTES

FIND Optimization - Estimation by BFGS
Convergence in    40 Iterations. Final criterion was  0.0000000 <=  0.0000100
Function Value                         7.0932

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  GAMMA(1)                        2049.1320  234127.3310      0.00875  0.99301683
2.  C(1,1)                            -0.2549       0.0412     -6.19236  0.00000000



Linear Regression - Estimation by Least Squares
Dependent Variable DEPVARC
Panel(36) of Annual Data From      1//1960:01 To     21//1995:01
Usable Observations                       748
Degrees of Freedom                        744
Skipped/Missing (from 756)                  8
Centered R^2                        0.1532929
R-Bar^2                             0.1498788
Uncentered R^2                      0.1532929
Mean of Dependent Variable       0.0000000000
Std Error of Dependent Variable  0.1058994912
Standard Error of Estimate       0.0976414686
Sum of Squared Residuals         7.0931891570
Regression F(3,744)                   44.8994
Significance Level of F             0.0000000
Log Likelihood                       680.8262
Durbin-Watson Statistic                0.3119

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  EXPLIC_C(1)                   0.029500024  0.004501028      6.55406  0.00000000
2.  EXPLIC_C(2)                   0.118042817  0.013961525      8.45487  0.00000000
3.  EXPLICTRANSF(1)              -0.044999529  0.006625826     -6.79153  0.00000000
4.  EXPLICTRANSF(2)              -0.190267216  0.040569272     -4.68993  0.00000325

Rappels : signification des intitul廥 des variables :
variable expliqu嶪 : Y
variables explicatives :
    EXPLIC_C(1) = X1
    EXPLIC_C(2) = X2
    EXPLICTRANSF(1) = X1 x fonction de transition num.1
    EXPLICTRANSF(2) = X2 x fonction de transition num.1

crit鋨es de s幨ection dans ce mod鋩e ?6 param鋈res
AIC =      -4.64223
BIC =      -4.60519


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-13 18:45:24
epoh 发表于 2012-6-13 18:40
Matlab & Winrats两者结果接近.
in Matlab:
>Launch_PSTR
非常感谢epoh老师
在Matlab和Winrats中,数据的排列是一样的吗?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-13 18:47:05
epoh 发表于 2012-6-13 18:40
这个程序,我的电脑执行亦会出错
有空再看看
是的,我是从作者主页下载的,在stata中其实有相对应的命令xtpmg,
只是这个命令不能运行大的数据,gauss codes是原作者编写的,可以
执行大的数据。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-13 20:38:26
ywh19860616 发表于 2012-6-13 18:45
非常感谢epoh老师
在Matlab和Winrats中,数据的排列是一样的吗?
winrats 数据格式:
      y              q                       x1             x2
-0.5243        -1.1478        2.7246        -1.1473
-0.4997        -1.1475        2.7027        -1.1489
-0.4867        -1.1365        2.6682        -1.1528
-0.4721        -1.114          2.6573        -1.1478
...........
...........
0.0426                              2.7964        -0.6239
0.0402                             2.7569        -0.6552
0.0411                             2.7255        -0.6852
0.0447                             2.6656        -0.7198
0.0394                        
0.0247                        
0.0089                        
-0.0395                        
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-13 21:02:21
epoh 发表于 2012-6-13 20:38
winrats 数据格式:
      y              q                       x1             x2
-0.5243       ...
恩,那就是和Matlab要求的格式一样的
谢谢您。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-13 22:06:43
epoh 发表于 2012-6-13 20:38
winrats 数据格式:
      y              q                       x1             x2
-0.5243       ...
epoh老师,这个帖子https://bbs.pinggu.org/thread-1011663-1-1.html
好像看回帖都能运行正常,是不是可能数据文件摆放有问题?
程序里面提到:
*   The program assumes that this program and all the
*  subroutines are placed in the same directory, and that the GAUSS
*  configuration file (gauss.cfg) has been modified so that the
*  src_path specification includes the directory in which you
*  have placed the main program and the program files.
*  If you do not want to modify the GAUSS configuration file, you
*  will need to modify the path statements following the INCLUDE
*  commands to indicate in which directory you have placed the
*  subroutines.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-14 13:13:55
ywh19860616 发表于 2012-6-13 22:06
epoh老师,这个帖子https://bbs.pinggu.org/thread-1011663-1-1.html
好像看回帖都能运行正常,是不是可能 ...
老兄你可以试winrats
C:\...\WinRATS Pro 8.0\WinRATS 8\PaperReplicationExamples\Pesaran Shin Smith JASA 1999
Pooled Mean Group Estimation of Dynamic Heterogeneous Panels.
   程序 : oecd.rpf
   数据 : oecddata.xls
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-14 13:20:36
epoh 发表于 2012-6-14 13:13
老兄你可以试winrats
C:\...\WinRATS Pro 8.0\WinRATS 8\PaperReplicationExamples\Pesaran Shin Smith  ...
谢谢epoh老师提供的信息
恩,这个也基本能实现,只是有许多
检验统计量未给出。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-14 21:17:33
ywh19860616 发表于 2012-6-14 13:20
谢谢epoh老师提供的信息
恩,这个也基本能实现,只是有许多
检验统计量未给出。
我先跑1,
跑完之后再跑2,就OK了.
跑2之后的结果如下供你参考:
  
PMG_result.txt
大小:(49.82 KB)

 马上下载



PAGE  28

                     OLS VERSION

      Group-Specific Estimates of the Long-run Coefficients
       Based on ARDL Specifications With Pre-Specified Lags

********   **************************  **************************
Group             Estimates             Diagnostic Statistics
********   **************************  **************************
Dependent variable:    Y

             Phi   lndi     dp  SIGMA  Ch-SC  CH-FF  CH-NO  CH-HE RBARSQ     LL

Australi  -0.175  1.032 -0.725  0.007   0.57   1.00   0.10   0.97   0.71 116.77
          (0.059)(0.053)(0.225)
Austria  -0.356  0.924 -0.321  0.012   2.35   1.98   6.23   0.02   0.59  99.76
          (0.127)(0.024)(0.443)
Belgium  -0.240  0.988 -0.777  0.010   3.48   0.02   0.92   2.84   0.72 103.39
          (0.055)(0.031)(0.327)
  Canada  -0.333  0.987 -1.247  0.008   0.77   2.71   0.60   1.82   0.89 112.33
          (0.072)(0.021)(0.186)
Denmark  -0.143  0.865  0.423  0.015   0.53   0.19   2.30   0.95   0.73  93.23
          (0.114)(0.128)(0.971)
Finland  -0.397  0.901 -0.437  0.010   0.06   0.25   1.13   0.53   0.91 104.79
          (0.062)(0.017)(0.131)
  France  -0.070  0.871  0.383  0.005   0.20   0.53   0.50   0.00   0.87 125.45
          (0.046)(0.166)(0.651)
Germany  -0.163  0.998  1.458  0.012   3.35  12.47   0.44   2.34   0.92  99.36
          (0.117)(0.072)(1.530)
  Greece  -0.201  0.931 -0.545  0.011   2.80   0.01   1.66   0.48   0.71 101.50
          (0.064)(0.051)(0.455)
Iceland  -0.291  1.004 -0.017  0.024   0.27   0.09   1.23   0.33   0.88  77.81
          (0.112)(0.054)(0.137)
Ireland  -0.593  0.864 -0.254  0.020   0.62   0.00   0.09   1.50   0.61  83.69
          (0.162)(0.026)(0.133)
   Italy  -0.433  1.072 -0.006  0.011   0.19   0.08   0.36   0.00   0.81 103.44
          (0.128)(0.018)(0.092)
   Japan  -0.209  0.855 -0.892  0.007   0.06   0.00   0.74   0.00   0.93 114.98
          (0.053)(0.039)(0.228)
Luxembou  -0.177  0.645 -0.694  0.014   1.87   0.01   0.20   1.96   0.20  95.18
          (0.084)(0.041)(0.710)
Netherla  -0.401  0.961 -0.683  0.011  12.09   0.01   2.84   0.07   0.80 100.87
          (0.095)(0.034)(0.198)
NewZeala  -0.478  0.913 -0.584  0.014   3.55   1.99   1.48   1.54   0.74  93.42
          (0.101)(0.070)(0.148)
  Norway  -0.542  0.864 -0.513  0.020   6.00   0.01   5.59   0.01   0.48  83.03
          (0.108)(0.031)(0.307)
Portugal  -0.413  0.949 -0.341  0.031   0.14   9.03   4.15  12.33   0.68  69.38
          (0.106)(0.050)(0.343)
   Spain  -0.339  0.892 -0.040  0.009   0.64   0.00   1.23   1.60   0.90 106.94
          (0.098)(0.022)(0.147)
  Sweden  -0.340  0.917 -0.835  0.011   0.15   0.05   0.66   1.53   0.74 101.45
          (0.107)(0.051)(0.283)
Switzerl  -0.093  0.617 -0.496  0.008   1.13   0.10   2.63   0.00   0.78 113.74
          (0.057)(0.181)(0.880)
  Turkey  -0.544  0.682  0.137  0.033   0.06   0.06   0.00   0.28   0.60  66.69
          (0.171)(0.104)(0.131)
    U.S.  -0.247  1.116 -0.398  0.010   1.42   9.62   2.49   0.64   0.82 104.58
          (0.091)(0.045)(0.189)
    U.K.  -0.174  1.186 -1.068  0.007   1.45   0.04   6.87   1.75   0.85 118.35
          (0.070)(0.047)(0.398)

Figures in brackets are the standard errors.



PAGE  29

                     PMLE VERSION

      Group-Specific Estimates of the Long-run Coefficients
       Based on ARDL Specifications With Pre-Specified Lags

********   **************************  **************************
Group             Estimates             Diagnostic Statistics
********   **************************  **************************
Dependent variable:    Y

             Phi   lndi     dp  SIGMA  Ch-SC  CH-FF  CH-NO  CH-HE RBARSQ     LL

Australi  -0.101  0.904 -0.466  0.007   0.91   0.76   0.07   1.56   0.68 115.27
          (0.033)(0.009)(0.057)
Austria  -0.332  0.904 -0.466  0.012   2.21   1.98   5.53   0.01   0.58  99.29
          (0.086)(0.009)(0.057)
Belgium  -0.173  0.904 -0.466  0.011   0.95   0.38   0.18   3.04   0.66 100.07
          (0.048)(0.009)(0.057)
  Canada  -0.164  0.904 -0.466  0.010   3.81   1.33   1.62   3.72   0.84 106.20
          (0.053)(0.009)(0.057)
Denmark  -0.108  0.904 -0.466  0.015   1.48   0.05   0.66   0.13   0.71  91.99
          (0.098)(0.009)(0.057)
Finland  -0.399  0.904 -0.466  0.010   0.07   0.15   0.94   0.54   0.91 104.74
          (0.054)(0.009)(0.057)
  France  -0.080  0.904 -0.466  0.006   0.01   0.52   0.91   0.06   0.85 123.15
          (0.025)(0.009)(0.057)
Germany  -0.089  0.904 -0.466  0.013   1.37  17.75   4.75   3.47   0.90  96.40
          (0.056)(0.009)(0.057)
  Greece  -0.190  0.904 -0.466  0.011   2.48   0.11   1.18   0.82   0.70 101.34
          (0.054)(0.009)(0.057)
Iceland  -0.036  0.904 -0.466  0.027   0.29   0.19   1.40   1.85   0.85  73.62
          (0.059)(0.009)(0.057)
Ireland  -0.420  0.904 -0.466  0.021   0.02   0.51   1.15   5.99   0.56  81.79
          (0.123)(0.009)(0.057)
   Italy  -0.072  0.904 -0.466  0.012   1.01   1.70   1.40   0.95   0.75  98.90
          (0.031)(0.009)(0.057)
   Japan  -0.222  0.904 -0.466  0.008   1.64   0.20   1.08   0.20   0.91 112.27
          (0.035)(0.009)(0.057)
Luxembou   0.008  0.904 -0.466  0.016   4.22   0.15   2.87   0.19  -0.08  90.29
          (0.029)(0.009)(0.057)
Netherla  -0.298  0.904 -0.466  0.012   9.36   0.05   2.79   0.63   0.78  99.27
          (0.067)(0.009)(0.057)
NewZeala  -0.498  0.904 -0.466  0.015   5.05   1.25   1.88   2.80   0.73  92.88
          (0.089)(0.009)(0.057)
  Norway  -0.517  0.904 -0.466  0.021   7.58   0.29   2.61   0.00   0.43  81.66
          (0.099)(0.009)(0.057)
Portugal  -0.378  0.904 -0.466  0.032   0.07   8.48   1.17  12.41   0.65  68.19
          (0.067)(0.009)(0.057)
   Spain  -0.195  0.904 -0.466  0.010   0.74   0.03   2.58   0.61   0.88 104.21
          (0.067)(0.009)(0.057)
  Sweden  -0.309  0.904 -0.466  0.012   0.41   0.27   0.84   2.33   0.72 100.31
          (0.097)(0.009)(0.057)
Switzerl  -0.052  0.904 -0.466  0.009   3.08   0.16   0.64   0.31   0.71 108.78
          (0.058)(0.009)(0.057)
  Turkey  -0.122  0.904 -0.466  0.038   1.43   0.33   0.41   0.00   0.48  62.46
          (0.084)(0.009)(0.057)
    U.S.  -0.013  0.904 -0.466  0.012   2.96   7.24   0.97   1.71   0.73  98.79
          (0.055)(0.009)(0.057)
    U.K.  -0.038  0.904 -0.466  0.007   0.53   0.54   3.29   1.27   0.82 115.21
          (0.024)(0.009)(0.057)

Figures in brackets are the standard errors.



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-14 23:22:45
epoh 发表于 2012-6-14 21:17
我先跑1,
跑完之后再跑2,就OK了.
跑2之后的结果如下供你参考:
epoh老师,谢谢您了,又让您花时间了。
按照您的方法可以运行出结果,哈哈
gauss codes给的结果比较全面些,稍后我再用比较大的数据量试试。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-7-3 19:25:40
epoh老师和ywh19860616老师,非常感谢两位老师一问一答,本人受益匪浅,有一事不明,tsp program  data、ntrial1000_lag2_result、ywhtsp_lag2等 文件夹需要密码才能打开。请问您能告诉我打开密码吗?我很佩服二位学习精神。我也想学习学习。请不吝赐教
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群