0

我正在尝试找到一个发行版。通过使用 mledist 功能。但是每次我使用它时,我都会发现一条错误消息:

[1] "Error in optim(par = vstart, fn = fnobj, fix.arg = fix.arg, obs = data,  : \n  non-finite finite-difference value [2]\n"
attr(,"class")
[1] "try-error"
attr(,"condition")
<simpleError in optim(par = vstart, fn = fnobj, fix.arg = fix.arg, obs = data,     ddistnam = ddistname, hessian = TRUE, method = meth, lower = lower,     upper = upper, ...): non-finite finite-difference value [2]>

问题是我知道,“Alae”有一个帕累托分布,但我不明白我的错误在哪里。请帮助:) 这是我的代码

library(fitdistrplus)
library(CASdatasets)
data(lossalae)
pertes<-lossalae
Alae <- pertes$ALAE   
Alae_par <- mledist(Alae, 'pareto',start=c(shape=5,scale=2))

TNX

4

1 回答 1

0

鉴于 CASdatasets 的起源是一位加拿大保险作者,我猜测 -functiondpareto应该来自 pkg: actuar

> library(actuar)

Attaching package: ‘actuar’

The following object is masked from ‘package:grDevices’:

    cm

> library(fitdistrplus)
> library(CASdatasets)
> data(lossalae)
> pertes<-lossalae
> Alae <- pertes$ALAE   
> Alae_par <- mledist(Alae, 'pareto',start=c(shape=5,scale=2))
Warning messages:
1: In dpareto(c(3806L, 5658L, 321L, 305L, 758L, 8768L, 1805L, 78L,  :
  NaNs produced
snipped 6 other warnings

> Alae_par
$estimate
       shape        scale 
    2.221351 15106.971534 

$convergence
[1] 0

$loglik
[1] -15413.45

$hessian
             shape         scale
shape 303.98838362 -3.083551e-02
scale  -0.03083551  3.637979e-06

$optim.function
[1] "optim"

$fix.arg
NULL
于 2015-02-17T05:41:50.733 回答