楼主: cjblovebj
2207 4

蒙特卡洛模拟 [推广有奖]

  • 6关注
  • 6粉丝

博士生

38%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
1.0008
学术水平
5 点
热心指数
4 点
信用等级
0 点
经验
16613 点
帖子
289
精华
0
在线时间
227 小时
注册时间
2009-8-24
最后登录
2022-6-28

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
请问各位有谁知道蒙特卡洛模拟方法在SPSS和SAS中的操作啊?有资料或程序的分享一下!谢谢!!
二维码

扫码加我 拉你入群

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

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

关键词:蒙特卡洛模拟 蒙特卡洛 蒙特卡 分享一下 SPSS 蒙特卡洛 程序 资料

尽最大努力,做最坏打算!
沙发
misslost 发表于 2011-9-18 04:13:56 |只看作者 |坛友微信交流群
options formdlim='-' pageno=min nodate;
DATA normal1; drop obs I;
* randomly sample 2,500,000 scores from a normal population which has a mean of 100 and a standard deviation of 15;
* arrange these in a matrix with 25 columns and 100,000 rows;
do obs=1 to 100000;
array Ys[25] Y1-Y25;
do I = 1 to 25;
Ys[I]=100+15*NORMAL(0);
end; output; end;
proc univariate plot normal; var Y1;
title 'One Sample of 100,000 scores from Normal Distribution'; run;
run;
*************************************************************************;
data normal2; set normal1;
*  compute sample mean, standard deviation, variance, z, and t on 100,000 samples with N = 9 and 100,000 samples with N = 25 ;
*  the z and the t  test the null hypothesis that the population mean is 100 ;
mean9 = mean(of Y1-Y9);     mean25 = mean(of Y1-Y25);
std9 = std(of Y1-Y9);      std25=std(of Y1-Y25);
var9 = std9*std9;      var25 = std25*std25;
Z9 = (mean9 - 100)/5;      Z25 = (mean25 - 100)/3;
T9 = (mean9 - 100)/(std9/3);     T25 = (mean25 - 100)/(std25/5);
Type1_N9 = 'No ';
If ABS(T9)GE 2.306 then Type1_N9 = 'Yes';
Type1_N25 = 'No ';
If ABS(T25)GE 2.064 then Type1_N25 = 'Yes';

proc freq; tables Type1_N9 Type1_N25;
title 'Frequency of Type I Errors';

proc univariate noprint;
*  to look at the distribution of one sample of 100,000 of these scores ;
output out=normal3
mean=mean_mean9 mean_var9 mean_std9 mean_Z9 mean_T9
mean=mean_mean25 mean_var25 mean_std25 mean_Z25 mean_T25
median=med_mean9 med_var9 med_std9 med_Z9 med_T9
median=med_mean25 med_var25 med_std25 med_Z25 med_T25
std=std_mean9 std_var9 std_std9 std_Z9 std_T9
std=std_mean25 std_var25 std_std25 std_Z25 std_T25
skewness=g1_mean9 g1_var9 g1_std9 g1_Z9 g1_T9
skewness=g1_mean25 g1_var25 g1_std25 g1_Z25 g1_T25
kurtosis=g2_mean9 g2_var9 g2_std9 g2_Z9 g2_T9
kurtosis=g2_mean25 g2_var25 g2_std25 g2_Z25 g2_T25
min=min_mean9 min_var9 min_std9 min_Z9 min_T9
min=min_mean25 min_var25 min_std25 min_Z25 min_T25
max=max_mean9 max_var9 max_std9 max_Z9 max_T9
max=max_mean25 max_var25 max_std25 max_Z25 max_T25;
var mean9 var9 std9 Z9 T9 mean25 var25 std25 Z25 T25; run;
*************************************************************************;
data normal4; set normal3;
proc print; var mean_mean9 med_mean9 std_mean9 g1_mean9 g2_mean9 min_mean9 max_mean9;
title 'Normal Population, Distribution of Sample Means, N = 9';
proc print; var mean_mean25 med_mean25 std_mean25 g1_mean25 g2_mean25 min_mean25 max_mean25;
title 'Normal Population, Distribution of Sample Means, N = 25';
**;
proc print; var mean_var9 med_var9 std_var9 g1_var9 g2_var9 min_var9 max_var9;
title 'Normal Population, Distribution of Sample Variances, N = 9';
proc print; var mean_var25 med_var25 std_var25 g1_var25 g2_var25 min_var25 max_var25;
title 'Normal Population, Distribution of Sample Variances, N = 25';
**;
proc print; var mean_std9 med_std9 std_std9 g1_std9 g2_std9 min_std9 max_std9;
title 'Normal Population, Distribution of Sample Standard Deviations, N = 9';
proc print; var mean_std25 med_std25 std_std25 g1_std25 g2_std25 min_std25 max_std25;
title 'Normal Population, Distribution of Sample Standard Deviations, N = 25';
**;
proc print; var mean_Z9 med_Z9 std_Z9 g1_Z9 g2_Z9 min_Z9 max_Z9;
title 'Normal Population, Distribution of Z Test Statistic, N = 9';
proc print; var mean_Z25 med_Z25 std_Z25 g1_Z25 g2_Z25 min_Z25 max_Z25;
title 'Normal Population, Distribution of Z Test Statistic, N = 25';
**;
proc print; var mean_T9 med_T9 std_T9 g1_T9 g2_T9 min_T9 max_T9;
title 'Normal Population, Distribution of T Test Statistic, N = 9';
proc print; var mean_T25 med_T25 std_T25 g1_T25 g2_T25 min_T25 max_T25;
title 'Normal Population, Distribution of T Test Statistic, N = 25';

使用道具

藤椅
leedx 发表于 2011-9-18 08:51:37 |只看作者 |坛友微信交流群
学习了,谢谢~~~

使用道具

板凳
leedx 发表于 2011-9-18 08:51:47 |只看作者 |坛友微信交流群
学习了,谢谢~~~

使用道具

报纸
cjblovebj 发表于 2011-9-21 10:25:11 |只看作者 |坛友微信交流群
misslost 发表于 2011-9-18 04:13
options formdlim='-' pageno=min nodate;
DATA normal1; drop obs I;
* randomly sample 2,500,000 scor ...
Thank u  very much!
尽最大努力,做最坏打算!

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-1 16:41