楼主: ywh19860616
24478 168

[问答] 程序运行问题 [推广有奖]

151
theawang 发表于 2012-5-28 23:51:48
epoh 发表于 2012-5-28 20:00
哈哈,通常比较大的矩阵
我都用matlab
呵呵,谢谢。我今天也决定用matlab来跑。只是1000万×100的矩阵好像matlab2010处理不了耶。epoh老师能给我些建议吗?多谢

152
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

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

154
ywh19860616 发表于 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

一份耕耘,一份收获。

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

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

Data_Demo.xls (81.5 KB)
一份耕耘,一份收获。

157
ywh19860616 发表于 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)


一份耕耘,一份收获。

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

159
epoh 发表于 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


已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 5 + 5 + 5 非常感谢epoh老师

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

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

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-2-18 01:15