想replicate两篇RFS的结果,这两篇paper都涉及monte carlo
1.在ACG2010中,lognormal distribution 是这样生成的(原文是): we exponentiate normal distributions and standardize the resulting variables to have unit variances and zero means.
不明白是怎么做到的?
2.在EW2012中,innovations are with zero-mean, unit-variance gamma distributions
gamma分布怎么可能mean是0,不是都是正数吗?
* 准备工作,安装两个用户程序
capture which zscore
if _rc ssc install zscore, replace all
capture which rnd
if _rc ssc install rnd, replace all
* 回答第一个问题
* 清理内存
clear
* 1000个个案
set obs 1000
* 确定随机种子,让结果可以重复
set seed 10000
* 生成标准正态分布变量x, x 服从 N(0,1)
gen x = rnormal()
* 检查结果
summ x
* 指数运算,生成x_exp,服从对数正态分布
gen double x_ ...
1.在ACG2010中,lognormal distribution 是这样生成的(原文是): we exponentiate normal distributions and standardize the resulting variables to have unit variances and zero means.