Questions tagged [fitdistrplus]

R package: Help to Fit of a Parametric Distribution to Non-Censored or Censored Data

111 questions
0
votes
2 answers

FitDist ERROR: 'data must be a numeric vector of length greater than 1'

I am trying to fit a distribution using the following code: fit.gamma <- fitdist(x, distr = "gamma", method = "mle") I get the following error: Error in fitdist(x, distr = "gamma", method = "mle") : data must be a numeric vector of length…
Stata_user
  • 562
  • 3
  • 14
0
votes
1 answer

Modified Weibull Error - the function failed to estimate the parameters, with the error code 100

I'm trying to estimate the Almalki and Yuan's modified Weibull distribution (NMW) parameters, but I'm encountering the following error: The value of the AIC is giving negative ONLY VERY NEGATIVE. Something is wrong. I know that in the literature…
user55546
  • 37
  • 1
  • 15
0
votes
1 answer

How to use fitdist function (negative binomial)?

I have the following data set aa <- data.frame("set_up" = c(1,1,1,1,1,1,2,2,2,3,3,3), set = c(1,1,1,2,2,2,1,1,1,3,3,3), mass = c(45,12,34,7,1,433,56,12,54,6,7,8)) I want to find the parameter k of the negative binomial function grouped by set and…
user8435999
0
votes
0 answers

Create function to integrate 2 distributions in respect to x

I would like to create a function in order to integrate the product of 2 distributions (a PDF and CDF) with respect to x. This is in order to perform a probabilistic risk assessment and determine an 'expected total risk'. My code I have so far,…
0
votes
0 answers

R optim() L-BFGS-B needs finite values of 'fn'

I am using MLE and l-moments method for gamma distribution, exponential distribution and weibull distribution. I used fitdistr() in gamma distribution. I have an error messga saying that L-BFGS-B needs finite values of 'fn' And I wonder if I can…
JDDD
  • 61
  • 2
  • 2
  • 7
0
votes
1 answer

`fitdist` error message: the function mle failed to estimate the parameters, with the error code 1

I am trying to use the fitdist function from the fitdistrplus package to fit my data to Burr distribution. library(fitdistrplus) library(actuar) fit_bur <-…
Yang Yang
  • 858
  • 3
  • 26
  • 49
0
votes
1 answer

Quick way of finding a name of a variable with lowest component value

I have a function fitting a distribution and returning a vector consisting of distribution name, mean, sd, etc. I'm testing few distributions but I can't rely on gofstat() because it goes mad when there are too many zeros to consider. Therefore I…
ErrHuman
  • 335
  • 1
  • 13
0
votes
0 answers

GoFStat error - Replacement has length zero

I've got this problem using GoFStat under the fitdistrplus package in R. Here's my code: col = c(2,2,3,2,2,2,2,3,4,3,1,4) fw = fitdist(col, "weibull", lower = c(0,0)) fg = fitdist(col, "gamma", lower = c(0,0)) fln = fitdist(col, "lnorm") ddlist =…
Tim
  • 1
  • 2
0
votes
1 answer

plotting cumulative density plot using fitdistrplus object without a histogram

The R package fitdistrplus has a denscomp function that plots the fitted cumulative density curve along with a histogram of the data. As an R newbie, I appreciate all the plots available in this package. Is there a simple way to just plot the curve…
geog_newbie
  • 185
  • 4
  • 15
0
votes
1 answer

Fitdistrplus unsupported distribution error

I am trying to verify whether my data set fits exponential or negative binomial, the function works for exponential but I get the following error using "nbinom": > compare = fitdistr(A, densfun="nbinom") Error in fitdistr(A, densfun = "nbinom") :…
Aesler
  • 181
  • 10
0
votes
1 answer

fitdist in r shiny, error need finite 'xlim' values

I am creating my first Shiny App and I am struggling plotting the four goodness of fit test from the fitdistrplus package. (for references, I am trying to reproduce the plots from page 7 from the reference here:…
0
votes
0 answers

Error in fitdistr package for using fitdist in for loop

I am running the below code, i.e to save the AIC values for negative binomial distribution in a vector. max_nbinom_aic <-data.frame(NBINOM_AIC=numeric(0)) for(i in 1:336) { a <- max_samples[,i] d <- fitdist(a,distr ="nbinom") …
user7385381
0
votes
0 answers

Increase font size on plot with descdist()

is there a way to manipulate the font size on the plot produced by the command descdist() in the fitdistrplus library? I want to store the plot by using: dev.print(pdf, "output_file.pdf", onefile=TRUE, paper='A4r', width= 11, height =…
bdvd
  • 117
  • 1
  • 1
  • 11
0
votes
1 answer

legend missing of function ppcomp in package fitdistrplus in R

I have a big data with more than 20 millions values, due to privacy and making the codes reproducible, I use mydata to replace it. set.seed(1234) mydata <- rlnorm(28000000,3.14,1.3) I want to find which known distributions fit mydata best, so…
Ling Zhang
  • 281
  • 1
  • 3
  • 13
0
votes
1 answer

Get degrees of freedom for a Standardized T Distribution with MLE

First of all, I thank you all beforehand for reading this. I am trying to fit a Standardized T-Student Distribution (i.e. a T-Student with standard deviation = 1) on a series of data; that is: I want to estimate the degrees of freedom via Maximum…