【问题标题】:distribution fitting in RR中的分布拟合
【发布时间】:2019-06-06 05:48:49
【问题描述】:

我想拟合一个分布。 如果我有一个数据集,我可以很容易地做到这一点:

library("fitdistrplus")
data_raw <- c(1018259, 1191258, 1265953, 1278234, 1630327, 1780896, 1831466, 1850446, 1859801, 1928695, 2839345, 2918672, 3058274, 3303089, 3392047, 3581341, 4189346, 5966833, 11451508)
fitdist(data_raw, "lnorm")

这就是我要为我的数据集拟合对数正态分布的方法。
但是,如果我没有数据集,只有平均值、标准差和一些分位数怎么办。例如:

平均值:2965042
标准开发:2338555

分位数:
0.1:1251014
0.5:1928695
0.8:3467765
0.9:4544843
0.95:6515300
0.999: 11352784

您将如何继续对此类数据进行估算?

谢谢你和最好的问候
诺比

【问题讨论】:

  • 这是一个简单的优化问题。您有一个非线性函数(CDF)和一些可以拟合此函数的点(分位数)。

标签: r distribution data-fitting model-fitting


【解决方案1】:

nls拟合模型即可:

DF <- read.table(text = "0.1: 1251014
                 0.5: 1928695
                 0.8: 3467765
                 0.9: 4544843
                 0.95: 6515300
                 0.999: 11352784 ", sep = ":")
plot(V1 ~ V2, data = DF, 
     xlim = c(0, 1.2e7),ylim = c(0, 1))


fit <- nls(V1 ~ plnorm(V2, meanlog, sdlog), data = DF, 
           start = list(meanlog = 13, sdlog = 2), trace = TRUE, algorithm = "port",
           lower = c(0, 0))

summary(fit)

curve(plnorm(x, coef(fit)[[1]], coef(fit)[[2]]), add = TRUE, col = "blue")

【讨论】:

    猜你喜欢
    • 2013-07-29
    • 2017-02-19
    • 1970-01-01
    • 1970-01-01
    • 2016-11-01
    • 2018-06-04
    • 2017-11-02
    • 2020-10-08
    • 2014-02-27
    相关资源
    最近更新 更多