我在R中使用fitdistr来选择最适合我的数据的分布。
我尝试过柯西分布、威布尔分布、正态分布和伽马分布。
对数似然为:柯西-329.8492,伽马-277.4931,正常-327.7622,威布尔-279.0352。
哪一个是最好的?值最大的那个(即Gamma)还是具有最大abs的那个(即Cauchy)?
发布于 2014-03-16 14:26:06
投票结束,但一个简单的测试就能回答你的问题
set.seed(1)
# we know these data are normally distributed...
dat <- rnorm(500,10,1)
# let's compute some fits...
require(MASS)
fits <- list(
no = fitdistr(dat,"normal"),
lo = fitdistr(dat,"logistic"),
ca = fitdistr(dat,"cauchy"),
we = fitdistr(dat, "weibull")
)
# get the logliks for each model...
sapply(fits, function(i) i$loglik)
no lo ca we
-718.3558 -722.1342 -806.2398 -741.2754因此,loglik是最大的值,表示最佳拟合。我们输入正态分布的数据,正态拟合的loglik是最大的。
你可能也会发现这张图片很有用,来自http://people.stern.nyu.edu/adamodar/pdfiles/papers/probabilistic.pdf

https://stackoverflow.com/questions/22433256
复制相似问题