jungsee的个人博客分享 http://blog.sciencenet.cn/u/jungsee

博文

GAUSS常见问题FAQ

已有 5287 次阅读 2015-1-19 20:38 |个人分类:GAUSS|系统分类:教学心得

官方网站:http://www.aptech.com/questions/


1.问题是这样的当你一条条 命令点击时候,有问题。 其实,只需要 命令 窗口 command window prompt


>>load path=D:Pro_gauss;

>>run demo_H_LP.gau  <enter>


就OK了!!!


另外一个例子:Click here directing to the author's webpage   Bruce E. Hansen  


jpm_92.zip


将以上文件 Unzip 到 d:Pro_gauss , 然后在 GAUSS 中 选定 工作路径(见下图),然后就可以了,

大家可以试着 练习一下,热身 GAUSS coding.








2. 程序 集成包 build-in packages 与 用户 自编包  user compiled modules 插入 的问题。

GAUSS自身带了不少的包或者叫函数,在 R 中叫包, MATLAB叫 函数, SAS 叫函数, STATA叫 ADO包。

这些 自带的包,安装了 就可以 运行了。


在科学计算中,我们常常 还可以 编 一些个性化或者 自己经常 要 用到 的函数 或者 程序,每种 软件都是 允许的,只是 运行 方式 有些差异;


在GAUSS中(VERSION 10.0),步骤是:


STEP 1:建立 SRC文件。打开 command editor 窗口, 把 函数 或者 程序 写进去,另存为src文件,e.g. mycode1.src 就可以了,GAUSS 通过 后缀 识别 文件类型。 保存 地址,你可以兴建 一些 文件夹,

e.g.>> C:gauss10mygauss ;>>  C:gauss10mygaussmyprocs ;>> C:gauss10mygausslib


STEP 2:C:gauss10lib >>下有个文件 user 的LCG文件,控制程序写入GAUSS,打开USER,修改。

E.G. typing the following:


c:gauss10mygaussmyprocsdemean.src

       demean  : proc : 2

c:gauss10mygaussmyprocsgenerate_data.src

       generate_data  :   proc

dstatmt.src

        dstatmt  : proc : 155


修改好了,再次打开 GAUSS,这些程序 就在 USER.LCG中了,可以自由 调用了。

因为 自编代码和 主程序系统SYSTEM 的关联 已经弄好了。


GAUSS 库 及搜索 路径:


>> library;

library path: c:gauss10gaussplotlib

             c:gauss10lib


Libraries:    c:gauss10libuser.lcg

             c:gauss10libgauss.lcg


>>






3.运行 #include statement


Syntax error trying to execute #include statement

Hi All,

I am new to GAUSS. I am getting syntax error while trying to include the following .src file.

#include C:gauss13srceigrs.src;

#include C:gauss13srccorr.src;
I am using Gauss 13.

I will be grateful to you if you can tell me where i am going wrong.

Thanks in advance

With regards,

Upananda

asked November 7, 2012



The #include statement can only be run as part of a program. If you try to run an #include statement from the command-line or using "run selected text" (using F4 or the context menu) from an editor window, it will return a syntax error.

However, the two files that you mention are part of the standard GAUSS library. So you should not have to #include them in your file. Try commenting out those statements and see if your code still runs.

In the case where you do want to execute the equivalent of an #include from the GAUSS command window, you can use the 'run' command instead:

run myfile.ext

instead of

#include myfile.ext

Hi Jason,

Thanks a lot for guiding me. It is a great experience for me as this is my first question in this forum.

With regards,

Upananda


DESCRIPTION

The routine twoside(.,.) implements the estimator for a panel data regressionmodel with double censoring proposed in Honore and Leth-Petersen. The weightsare 1/T(i). It is in
beh_slp.gau.The programdemo_H_LP.gau demonstratesits use.

The file
optmum.prc must be in thesame directory.


这个拷贝好 程序在  一个文件夹中,然后 >>run demo_H_LP.gau  <enter>

FORMAT

   {b,v,f}=twoside(dat,_met);

INPUT

   dat    (NxK)matrix. Each row represens an observation.
           The firstcolumn contains the dependent variable.
           The secondcolums contains the individual id.
           Column 3-Kcontain the time-varyind explanatory variables.

   _met   Optimization method. The allowable values are
           0      Amoeba
           -1     Powell's method
           -2     frpmin
           -3     dfpmin

OUTPUT

   b     Estimate

   v      Estimted Variance-matrix

   f      Function Value


4.Gauss文件后缀大讨论


本人最近在学习传说中的Gauss,发现真的有点难,比起当初用Eviews的时候, 简直是两个档次. 不过gauss虽然难,但是非常灵活,可以自己做很多事. 现在言归正传,我的问题是,我发现gauss里很多不同后缀名的文件,比如Lcg, src, 这两个我基本知道怎么回事了,但是还有什么.prg,.dec,.ext,.sdf,.e,这些个就不是非常清楚了,因为我在运行一个例子的时候,报错,d:programgauss8.0srcrandom.src(615) : error G0025 : '_SSM_parameters' : Undefined symbol ,然后我去找_SSM_parameters,居然在一个.dec的文件里,不知道怎么回事,希望高手解答,非常感谢.


Gauss真的奇怪,*.prg,是例子,*.e也是例子,没有后缀的也可以执行,*.ext好像不是例子吧,是在src文件夹里. 终于知道一点关于*.ext,和*.dec了,这两个是定义全局变量的,看来要好好看书啊.

gauss除较为特殊的,后缀名比较自由,关键是要设置好,如lcg文件中

根据我曾看过的说明,副档名.ext与.dec文件的内容分别如下:

.ext 为一由多个external指令构成的文件.在一个procedure中,一般是以local定义该procedure用到的变数,若其中有未以local指令定义之variables,则这些变数为global variables.此时若未使用external指令,则执行procedure时会出现undefined symbol,因为这些在该procedure中被使用的global variables对procedure而言是未定义的, external指令之功用便是定义在procedure中之global variables,当用到的global variables较多时,可用一副档名为.dec的文件纳入这些变数,再在procedure中用#include呼叫该文件.

.dec为一由多个declare指令构成之文件. declare指令为指定global variables之起始值.承上之说明,以external定义procedure中之global variables后,可以declare指令指定这些global variables之起始值,副档名.dec之文件为收集多个declare指令之文件.这些起始值在procedure执行时可能会变动,因此仅是暂时的值.

以上内容是我看过一些相关的介绍后的理解,若有错误,还请高手不吝指正.


下面是以前总结的,不一定完全准确,大家可以参考一下
.lcg:库
.ext:定义全局变量
.dec:全局变量赋初值
.src:程序文件
.sdf:结构定义文件
.out:结果输出文件
.gcg:被编译过的文件
.dll:动态链接库
.fst:Gauss string file
.fmt:Gauss matrix files
.dat:Gauss v96 data set files (PC and Unix) (import only)
.dht:Gauss v89 data set files (import only)
.e:自己编程例子
.gau:自己编程例子
.gss:自己编程例子
.g:自己编程例子
.prg:自己编写可以#include的

还有gsp后缀也是表示自编例子






https://blog.sciencenet.cn/blog-793574-860976.html

上一篇:极大似然法估计方法
下一篇:GAUSS资源集合
收藏 IP: 111.203.16.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-7-17 16:15

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部