使用fitdistrplus拟合Gumbel分布

时间:2016-03-18 14:41:38

标签: r model-fitting fitdistrplus

我试图从this answer重现代码,但是我在这方面遇到了问题。我使用了包VGAMfitdistrplus中的gumbel分布。 这样做的问题出现在:

fit   = fitdist(data1, 'gumbel', start = list(location = 0, scale = 1))
Error in mledist(data, distname, start, fix.arg, ...) : 
  'start' must specify names which are arguments to 'distr'.

好像locationscale不是* gumbel的参数。

dgumbel正确提供了

pgumbelrgumbelqgumbelVGAM。 但是,该包还提供了一个名为gumbel的函数,具有不同的语法。这可能导致问题吗?

编辑:是的,它确实导致了问题:使用包FAdist代替完美无缺。

3 个答案:

答案 0 :(得分:3)

供参考,来自注释中链接的package vignette

export class HomeComponent implements OnDestroy {
  beers:{};
  sub: Subscription;

  constructor(private beerSearchService: BeerSearchService) {
    this.sub = this.beerSearchService.beers$.subscribe(beers => {
     this.beers = beers;
    });
  }

  ngOnDestroy() {
    this.sub.unsubscribe();
  }
}

或使用library(fitdistrplus) data(groundbeef) serving <- groundbeef$serving dgumbel <- function(x, a, b) 1/b*exp((a-x)/b)*exp(-exp((a-x)/b)) pgumbel <- function(q, a, b) exp(-exp((a-q)/b)) qgumbel <- function(p, a, b) a-b*log(-log(p)) fitgumbel <- fitdist(serving, "gumbel", start=list(a=10, b=10)) 中的功能:

VGAM

答案 1 :(得分:-2)

开始=列表(亩= R,S = R) R =你的参数

答案 2 :(得分:-2)

这是因为fitdistr包不支持gumbel分发。

相关问题