Questions tagged [fitdistrplus]

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

89 questions
12
votes
2 answers

Fitting a normal distribution in R

I'm using the following code to fit the normal distribution. The link for the dataset for "b" (too large to post directly) is : link for b setwd("xxxxxx") library(fitdistrplus) require(MASS) tazur <-read.csv("b", header= TRUE,…
zkhan
  • 147
  • 1
  • 1
  • 9
9
votes
1 answer

Making fitdist plots with ggplot2

I fitted the normal distribution with fitdist function from fitdistrplus package. Using denscomp, qqcomp, cdfcomp and ppcomp we can plot histogram against fitted density functions, theoretical quantiles against empirical ones, the empirical…
MYaseen208
  • 19,213
  • 32
  • 133
  • 260
6
votes
2 answers

Error in fitdist with gamma distribution

Below are my codes: library(fitdistrplus) s <- c(11, 4, 2, 9, 3, 1, 2, 2, 3, 2, 2, 5, 8,3, 15, 3, 9, 22, 0, 4, 10, 1, 9, 10, 11, 2, 8, 2, 6, 0, 15, 0 , 2, 11, 0, 6, 3, 5, 0, 7, 6, 0, 7, 1, 0, 6, 4, 1, 3, 5, 2, 6, 0, 10, 6, 4, 1, 17, 0, 1, 0, 6,…
Chuan
  • 61
  • 1
  • 2
4
votes
2 answers

How do I obtain values from a graphic?

I did a distribution fit and was taking a look at the Q-Q-Plot and was wondering if there is an easy way to get the corresponding values from the graphic. library("fitdistrplus") data <- c(1050000, 1100000, 1230000, 1300000, 1450000, 1459785,…
Norbi
  • 57
  • 3
4
votes
1 answer

Error when fitting a beta distribution: the function mle failed to estimate the parameters with error code 100

I'm trying to use fitdist () function from the fitdistrplus package to fit my data to different distributions. Let's say that my data looks like: x = c (1.300000, 1.220000, 1.160000, 1.300000, 1.380000, 1.240000, 1.150000, 1.180000, 1.350000,…
elcortegano
  • 1,711
  • 10
  • 27
  • 43
3
votes
0 answers

Golang equivalent of fitdistrplus in R?

I'm trying to reproduce fitting a beta distribution in Go, given an input of floating-point rates: rates = [0.20, 0.15, 0.002, 0.017, 0.181, 0.004, ...] You can do this in R quite easily using fitdistrplus, which chooses reasonable starting values…
Tallboy
  • 11,480
  • 11
  • 67
  • 151
3
votes
1 answer

Why aren't any points showing up in the qqcomp function when using plotstyle="ggplot"?

I want to compare the fit of different distributions to my data in a single plot. The qqcomp function from the fitdistrplus package pretty much does exactly what I want to do. The only problem I have however, is that it's mostly written using base R…
Denzo
  • 105
  • 6
3
votes
1 answer

mle failed to estimate the parameters with the error code 7

I'm trying to estimate the Weibull-Gamma Distribution parameters, but I'm encountering the following error: "the function mle failed to estimate the parameters, with the error code 7" What do I do? The Weibull-Gamma Distribution Density Function…
Breno S.
  • 271
  • 1
  • 8
3
votes
1 answer

How to make the axes start from zero in package fitdistrplus in R

I use function fitdist in package fitdistrplus to get the best distribution fitted to my data and draw the ppcomp figure , I use the example codes of ?fitdistrplus to replace my data and codes. data(groundbeef) serving <- groundbeef$serving fitW <-…
Ling Zhang
  • 271
  • 1
  • 2
  • 11
3
votes
1 answer

Power law fitted by `fitdistr()` function in package `fitdistrplus`

I generate some random variables using rplcon() function in package poweRlaw data <- rplcon(1000,10,2) Now, I want to know which known distributions fit the data best. Lognorm? exp? gamma? power law? power law with exponential cutoff? So I use…
Ling Zhang
  • 271
  • 1
  • 2
  • 11
3
votes
2 answers

Trouble with 'fitdistrplus' package, t-distribution

I am trying to fit t-distributions to my data but am unable to do so. My first try was fitdistr(myData, "t") There are 41 warnings, all saying that NaNs are produced. I don't know how, logarithms seem to be involved. So I adjusted my data somewhat…
Erik Vesterlund
  • 440
  • 5
  • 16
2
votes
2 answers

How to return objects created in a function and ignore the ones with error/NA?

I have edited my question Goal I want to keep only those objects that were successfully created and ignore those that threw errors. Example Please note that this is just a reproducible example. My original dataset is different. The following…
umair durrani
  • 4,615
  • 3
  • 32
  • 73
2
votes
1 answer

Fitting of Pearson Type III in R using fitdist

I have fitted many distributions to my data but I am facing difficulty in fitting Pearson type III distribution to the data. I also used plotdist function to find starting or initial values in order to fit the distribution using iterative method.The…
Kazim Khan
  • 21
  • 2
2
votes
2 answers

Fitting truncnorm distribution with distrplus causes fatal error (R crashes)

Here's the code that crashes R for me without any useful error messages. Any ideas? I'm going crazy over here. Thanks, library(fitdistrplus) library(truncnorm) set.seed(0) x = rtruncnorm(n=30, a=0, b=Inf, mean=1, sd=0.45) my_fit = fitdist(x,…
Mike S.
  • 41
  • 4
2
votes
2 answers

How to select the distribution parameter through fitdistrplus package?

library(fitdistrplus) data(groundbeef) serving <- groundbeef$serving fitg <- fitdist(serving, "gamma") res<-bootdist(fitg)#further accuracy estimate #which parameter should be selected? > summary(res) Parametric bootstrap medians and 95% percentile…
kittygirl
  • 1,831
  • 1
  • 12
  • 28
1
2 3 4 5 6