use*_*969 -1 statistics r gamma-distribution weibull
我已经使用fitdistrin中的Weibull,lognormal和Gamma分布拟合了我的索赔金额数据.我想选择哪一个最适合我的样本数据使用AICR中的哪一个.如何进行?
你可以使用这个AIC功能:
set.seed(1)
x <- rlnorm(100) # random values from a log-normal distribution
# fit distributions
library(MASS)
weibull <- fitdistr(x, "weibull")
lognormal <- fitdistr(x, "lognormal")
gamma <- fitdistr(x, "gamma")
# compare AICs
AIC(weibull)
# [1] 300.9519
AIC(lognormal)
# [1] 287.0875
AIC(gamma)
# [1] 297.1818
Run Code Online (Sandbox Code Playgroud)
毫不奇怪,对数正态拟合具有最低的 AIC.这是最合适的.