fitdistrplus

Error in fitdist with gamma distribution

会有一股神秘感。 提交于 2021-02-07 18:47:53
问题 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, 6, 1, 5, 4, 8, 0, 1, 1, 5, 15, 14, 8, 1, 3, 2, 9, 4, 4, 1, 2, 18, 0, 0, 10, 5, 0, 5, 0, 1, 2, 0, 5, 1, 1, 2, 3, 7) o <- fitdist(s, "gamma", method = "mle") summary(o) plot(o) and the error says: Error in fitdist(s, "gamma", method = "mle") : the

How to fit a t-distribution with scale and location parameters in fitdistrplus

我怕爱的太早我们不能终老 提交于 2020-04-30 07:37:23
问题 How can I use fitdistrplus to estimate the location a scale parameters of a t-distribution? I know that I need to provide initial values (in MASS it works very well) but in this package only the df is allowed. Do you have some solution? Many thanks. 回答1: The fitdist function in the fitdistrplus package uses the distribution functions based on the distr parameter. So given this code: data = 1.5*rt(10000,df=5) + 0.5 fit1 <- fitdist(data,"t",start=list(df=3)) fitdist is using the R functions rt

Trouble with 'fitdistrplus' package, t-distribution

半城伤御伤魂 提交于 2020-02-24 11:01:06
问题 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 so that all data is >0, but I still have the same problem (9 fewer warnings though...). Same problem with sstdFit(), produces NaNs. So instead I try with fitdist which I've seen on stackoverflow and CrossValidated: fitdist(myData, "t") I then get

Fitting a normal distribution in R

社会主义新天地 提交于 2020-01-11 04:42:08
问题 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, sep=",") claims<-tazur$b a<-log(claims) plot(hist(a)) After plotting the histogram, it seems a normal distribution should fit well. f1n <- fitdistr(claims,"normal") summary(f1n) #Length Class Mode #estimate 2 -none- numeric #sd 2 -none- numeric #vcov 4 -none- numeric #n

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

纵饮孤独 提交于 2019-12-21 18:27:35
问题 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, 1.290000, 1.150000, 1.240000, 1.150000, 1.120000, 1.260000, 1.120000, 1.460000, 1.310000, 1.270000, 1.260000, 1.270000, 1.180000, 1.290000, 1.120000, 1.310000, 1.120000, 1.220000, 1.160000, 1.460000, 1.410000, 1.250000, 1.200000, 1.180000, 1.830000, 1

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

允我心安 提交于 2019-12-21 18:27:11
问题 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, 1.290000, 1.150000, 1.240000, 1.150000, 1.120000, 1.260000, 1.120000, 1.460000, 1.310000, 1.270000, 1.260000, 1.270000, 1.180000, 1.290000, 1.120000, 1.310000, 1.120000, 1.220000, 1.160000, 1.460000, 1.410000, 1.250000, 1.200000, 1.180000, 1.830000, 1

R - fitting a mixture distribution with fitdistrplus

心不动则不痛 提交于 2019-12-11 18:36:01
问题 I have defined a mixture of a LogNormal and a Generalised Pareto (actuar) as follows: dlnormgenpar<-function(x, w_lnorm, meanlog=0, sdlog=1, par_shape1=1, par_shape2=1, par_scale=1) { w_par=1-w_lnorm dln=dlnorm(x,meanlog = meanlog,sdlog = sdlog) dpar=dgenpareto(x,shape1=par_shape1,shape2=par_shape2,scale=par_scale) return(w_lnorm*dln+w_par*dpar) } I am trying to fit it to some data using fistdistrplus: dist<-fitdist(data,"lnormgenpar") However I receive the error: Unknown starting values for

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

两盒软妹~` 提交于 2019-12-11 15:43:25
问题 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 the AIC may be negative, but I believe that some error in the estimation or the functions is happening. Can the bug be in the estimation, fitdist or something like that? Somebody help me? ARTICLE https://www.sciencedirect.com/science/article/pii