我正在尝试在Stata或R中做点什么。
我有工资分布的百分位数(百分位数10,25,50,75,90),我想估计一个对数正态分布以适应它们。在Stata中有一个命令lognfit
,它适合单位记录数据的对数正态,但不符合百分位数。
是否值得使用Stata的gmm
命令,使用我的五个数据点来估计lognormal的两个参数作为一个过度识别的系统?
答案 0 :(得分:1)
这是Stata解决方案。
我向其他人留下了IAPHelper.sharedIntance.createPaymentRequestForProduct()
的吸引力。您还可以在标准正态分布的相应分位数上回归记录的分位数。以下是嵌入实验中的代码,以了解该方法的工作原理。我们从对数正态产生1000个样本,每个样本大小为1000,这是一个法线1和SD 2取幂的法线。这里是gmm
执行所有回归,每个样本一个。
rangestat
答案 1 :(得分:1)
谢谢大家的回复。
我正在尝试这两个程序。例如,在R中,我使用了包library(rriskDistributions)
,特别是
## example with only two quantiles
q <- stats::qlnorm(p = c(0.025, 0.975), meanlog = 4, sdlog = 0.8)
old.par <- graphics::par(mfrow = c(2, 3))
get.lnorm.par(p = c(0.025, 0.975), q = q)
get.lnorm.par(p = c(0.025, 0.975), q = q, fit.weights = c(100, 1),
scaleX = c(0.1, 0.001))
get.lnorm.par(p = c(0.025, 0.975), q = q, fit.weights = c(1, 100),
scaleX = c(0.1, 0.001))
get.lnorm.par(p = c(0.025, 0.975), q = q, fit.weights = c(10, 1))
get.lnorm.par(p = c(0.025, 0.975), q = q, fit.weights = c(1, 10))
graphics::par(old.par)
在Stata中,我正在尝试使用基于https://blog.stata.com/2015/12/03/understanding-the-generalized-method-of-moments-gmm-a-simple-example/
的GMM matrix I = I(1)
mat lis I
gmm ((y - exp({xb: percentile_10 percentile_20 percentile_25
percentile_30 percentile_50 percentile_60 percentile_75
percentile_90})) / exp({xb:})), instruments(percentile_10
percentile_20 percentile_25 percentile_30 percentile_50 percentile_60
percentile_75 percentile_90) twostep
这是第一次尝试使用GMM,当然我错过了一些东西。
尼克考克斯的回答很棒。我会尝试用这种方法来拟合我的数据。