首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >帕累托分布的mledist

帕累托分布的mledist
EN

Stack Overflow用户
提问于 2015-02-17 08:02:52
回答 1查看 520关注 0票数 0

我在试着找一个发行商。通过使用mledist函数。但每次我使用它时,我都会发现一条错误消息:

代码语言:javascript
复制
[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“有一个帕累托分布,但我不能理解我的错误在哪里。请帮助:)这是我的代码

代码语言:javascript
复制
library(fitdistrplus)
library(CASdatasets)
data(lossalae)
pertes<-lossalae
Alae <- pertes$ALAE   
Alae_par <- mledist(Alae, 'pareto',start=c(shape=5,scale=2))

TNX

EN

回答 1

Stack Overflow用户

发布于 2015-02-17 13:41:51

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

代码语言:javascript
复制
> 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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28552497

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档