【问题标题】:Error using fitdist in R - dllogis function must be defined在 R 中使用 fitdist 时出错 - 必须定义 dllogis 函数
【发布时间】:2021-01-21 20:08:40
【问题描述】:

通过运行此代码:

set.seed(12)
eta <- 10
nu <- 2
n <- 100
t <- eta*(((-1)*log(1-runif(n)))^(1/nu))# generates T_i
t
library("fitdistrplus")
fitll <- fitdist(t, "llogis")

在 R 中,我收到了这个错误:

Error in fitdist(t, "llogis") : The  dllogis  function must be defined

我之前已经安装了“fitdistrplus”包。有关如何解决此错误的任何想法?对于其他发行版,例如“gamma”,此代码可以正常工作。

【问题讨论】:

    标签: r function statistics runtime-error


    【解决方案1】:

    试试这个。看起来需要调用具有所需分发的包(flexsurv):

    set.seed(12)
    eta <- 10
    nu <- 2
    n <- 100
    t <- eta*(((-1)*log(1-runif(n)))^(1/nu))# generates T_i
    t
    library("fitdistrplus")
    library(flexsurv)
    fitll <- fitdist(t, "llogis")
    fitll
    

    输出:

    fitll
    Fitting of the distribution ' llogis ' by maximum likelihood 
    Parameters:
          estimate Std. Error
    shape 3.141862  0.2609741
    scale 7.659338  0.4246839
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-13
      • 2023-01-04
      • 1970-01-01
      • 1970-01-01
      • 2021-01-21
      • 2021-02-09
      • 2019-07-11
      • 1970-01-01
      相关资源
      最近更新 更多