楼主: liujie040303128
6220 10

[程序分享] 如何用SAS实现 Monte-carlo simulation ? [推广有奖]

  • 6关注
  • 2粉丝

已卖:491份资源

博士生

45%

还不是VIP/贵宾

-

威望
0
论坛币
1405 个
通用积分
3.6000
学术水平
0 点
热心指数
2 点
信用等级
0 点
经验
7400 点
帖子
151
精华
0
在线时间
414 小时
注册时间
2009-5-6
最后登录
2024-11-17

楼主
liujie040303128 发表于 2009-7-22 14:29:57 |AI写论文
6论坛币
我用的数据是32个省自治区(划分为8个大的区域),1980-2004年的panel data, 自变量是“x1,x2,x3,x4”,因变量是“各省市GDP”。我想用 Monte-carlo simulation techniques,分析自变量x1,x2,x3,x4 对8个大的区域GDP的敏感性,然后用“Output变量——GDP的标准差大小”进行排序。
       请问大侠,Monte-carlo simulation techniques 用SAS怎么实现?能否给出SAS语句的例子?
       如果能有sas应用的事例,将感激不尽

      谢谢

关键词:Monte-carlo Simulation ulation Carlo ATION

沙发
zolo538 在职认证  发表于 2009-7-22 15:49:53
我现在正在sas实习,关于您这个问题,现在在sas9.2中已经可以解决,在SAS/STAT模块中有新开发有一个procedure是MCMC,这是关于MCMC的官方说明
The MCMC procedure is a general purpose Markov chain Monte Carlo (MCMC) simulation procedure that is designed to fit Bayesian models. Bayesian statistics is different from traditional statistical methods such as frequentist or classical methods. For a short introduction to Bayesian analysis and related basic concepts, see Chapter 7, Introduction to Bayesian Analysis Procedures. Also see the section A Bayesian Reading List for a guide to Bayesian textbooks of varying degrees of difficulty.
In essence, Bayesian statistics treats parameters as unknown random variables, and it makes inferences based on the posterior distributions of the parameters. There are several advantages associated with this approach to statistical inference. Some of the advantages include its ability to use prior information and to directly answer specific scientific questions that can be easily understood. For further discussions of the relative advantages and disadvantages of Bayesian analysis, see the section Bayesian Analysis: Advantages and Disadvantages.
It follows from Bayes’ theorem that a posterior distribution is the product of the likelihood function and the prior distribution of the parameter. In all but the simplest cases, it is very difficult to obtain the posterior distribution directly and analytically. Often, Bayesian methods rely on simulations to generate sample from the desired posterior distribution and use the simulated draws to approximate the distribution and to make all of the inferences.
PROC MCMC is a flexible simulation-based procedure that is suitable for fitting a wide range of Bayesian models. To use the procedure, you need to specify a likelihood function for the data and a prior distribution for the parameters. You might also need to specify hyperprior distributions if you are fitting hierarchical models. PROC MCMC then obtains samples from the corresponding posterior distributions, produces summary and diagnostic statistics, and saves the posterior samples in an output data set that can be used for further analysis. You can analyze data that have any likelihood, prior, or hyperprior with PROC MCMC, as long as these functions are programmable using the SAS DATA step functions. The parameters can enter the model linearly or in any nonlinear functional form. The default algorithm that PROC MCMC uses is an adaptive blocked random walk Metropolis algorithm that uses a normal proposal distribution.
具体的操作可以见http://support.sas.com/documentation/cdl/en/statug/59654/HTML/default/mcmc_toc.htm
这个MCMC程序还在实验过程中 具体操作 可以见SAS GLOBE Forum09的论文(附件就是)
不过SAS9.2还没有破解版,虽然偶现在用的是sas9.2 不过还得遵守公司保密协议
you may say I\'m a dreamer, but I\'m not the only one

藤椅
lihuistat 发表于 2009-7-23 01:49:28
救命稻草,最近也在搞这个,材料下载了,谢谢上一楼楼主了

板凳
lihuistat 发表于 2009-7-23 02:25:51
不知道这个对楼主有没有用,介绍相关内容好像是从12页开始 bayesian.pdf (1.28 MB)
1# liujie040303128


and 这个是个online book 叫做 "
SAS® for Monte Carlo studies "  , 里面有些例子,就看你用不用的上了,链接在以下

http://books.google.ca/books?id=Hvcz6R-KWdgC&dq=Monte-carlo+simulation+in+sas&printsec=frontcover&source=bn&hl=en&ei=qFpnSv_TLISAswPwmIntDg&sa=X&oi=book_result&ct=result&resnum=4
good luck!

报纸
liujie040303128 发表于 2009-7-24 09:08:30
谢谢版主的帮助,有这样热心助人的版主,论坛一定会越来越火

地板
liujie040303128 发表于 2009-7-24 09:10:04
谢谢你的帮忙,呵呵,我好好看一下
4# lihuistat

7
爱萌 发表于 2009-7-25 01:07:54
如果是一般数据好处理,可是这是具有时间性的数据上面的方法有什么用那?
得到错误的结果
最恨对我说谎或欺骗我的人

8
tangxuan182 发表于 2011-1-26 21:31:00
谢谢 分享~~ 正发愁 怎么弄呢

9
tangxuan182 发表于 2011-1-26 21:38:20
谢谢 分享~~ 正发愁 怎么弄呢

10
axie1999 发表于 2011-5-12 22:10:14
谢谢楼主分享

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-26 16:57