search for: fitdist

Displaying 20 results from an estimated 37 matches for "fitdist".

Did you mean: fitdistr
2011 Jul 26
2
Beta distribution- help needed
Hi, Well, i need some help, practical and theoretical. I am wondering why the fitdistplus (mle function) is returning an error for this code: [code] x1 <- c(100,200,140,98,97,56,42,10,2,2,1,4,3,2,12,3,1,1,1,1,0,0); plotdist(x1); descdist(x1, boot =1000); y<- sum(x1); d= as.vector(length(x1)); for(i in 1:length(x1)){ d[i] = x1[i]/y; } fitdist(d, "beta") [/code]...
2012 Mar 21
2
Error in fitdist- mle failed to estimate parameters
Hi, I am trying fit certain data into Beta distribution. I get the error saying "Error in fitdist(discrete_random_variable_c, "beta", start = NULL, fix.arg = NULL) : the function mle failed to estimate the parameters, with the error code 100" Below is the sorted data that I am trying to fit. Where am I going wrong. Thanks a lot for any help. Vinod 2.05495e-05,3.68772e-05,...
2013 Apr 09
5
Error when using fitdist function in R
Hello everyone, I was trying to do some distribution fitting with a numerical field called Tolls. The sample size = 999 rows. Basically I assigned the Toll data to a new variable K by doing: k<-dtest$Toll After that, tried to fit a gamma distribution by doing: fitG<-fitdist(k, "gamma") Then the following messages showed (oh and I checked for empty rows before doing this): Warning in dgamma(c(363328L, 376216L, 367032L, 314826L, 311892L, 313340L, : NaNs produced Warning in dgamma(c(363328L, 376216L, 367032L, 314826L, 311892L, 313340L, : NaNs produced W...
2010 Jul 12
2
exercise in frustration: applying a function to subsamples
...script to analyze all my data (I have reduced it to a couple hundred thousand records with about half a dozen records. I get the same result from ddply and split/lapply: > ddply(moreinfo,c("m_id","sale_year","sale_week"), > + function(df) data.frame(res = fitdist(df$elapsed_time,"exp"),est = > res$estimate,sd = res$sd)) > Error in fitdist(df$elapsed_time, "exp") : > data must be a numeric vector of length greater than 1 > and > > lapply(split(moreinfo,list(moreinfo$m_id,moreinfo$sale_year,moreinfo$sale_week)), >...
2020 Oct 21
1
Fitting Mixed Distributions in the fitdistrplus package
Dear Sirs, The below listed code fits a gamma and a pareto distribution to a data set danishuni. However the distributions are not appropriate to fit both tails of the data set hence a mixed distribution is required which has ben defined as "mixgampar" as shown below. library(fitdistrplus) x<- danishuni$Loss fgam<- fitdist(x,"gamma",lower=0) fpar<- fitdist(x,"pareto",start = list(shape=2,scale=2),lower=0) fmixgampar<- fitdist(x,"mixgampar",start = list(prob=1/2,nu=1,lambda=1,alpha=1,theta=1),lower=0) Error in fitdist(x, "mixgampa...
2012 Jan 20
0
fit Johnson Sb with fitdist(method="mme")
Dear R-helpers, I am trying to fit my data to a 4-parameter lognormal distribution (aka Johnson Sb dist) with fitdist function from the library(fitdistrplus). So far, I have learnt that with "mle" method it's not always possible to estimate the gamma and delta parameters even if the bounding estimates are "known"/"guessed". Therefore, I tried to fit it with the "mme" me...
2018 Jan 29
2
Result show the values of fitting gamma parameter
Hi, Let say I have data by two columns A and B, and I have fit each column using the gamma distribution by 'fitdist' . I just want the result show only the shape and rate only. Eg: library(fitdistrplus) A <-c(1,2,3,4,5) B<-c(6,7,8,9,10) C <-cbind(A,B) apply(C, 2, fitdist, "gamma") Output show like this: $A Fitting of the distribution ' gamma ' by maximum likelihood Parameters...
2020 Oct 24
0
Fitting Mixed Distributions in the fitdistrplus package
Dear Charles, Please, when you have questions about fitdistrplus, contact directly the authors of the package and not R-help. When fitting non ? standard ? distributions with fitdistrplus, you should define by yourself the density and the cumulative distribution functions, or load a package which define them. See FAQ for a general example : https://cran.r...
2011 May 20
1
outout clarification of fitdist {fitdistrplus} output
Hello, I like to fit data against a negative binominal distribution x2<-c(rep(10,14),rep(9,8),rep(8,13),rep(7,11),rep(6,6),rep(5,18),rep(4,7),re p(3,21),rep(2,33),rep(1,55),rep(0,225)) f2<-fitdist(x2,"nbinom",method="mle") plot(f2) summary(f2) gofstat(f2) I receive the following result: Fitting of the distribution ' nbinom ' by maximum likelihood Parameters : estimate Std. Error size 0.3397148 0.03775577 mu 1.7787630 0.16429774 Loglikelih...
2012 Feb 15
1
Parameter estimation of gamma distribution
Hi, I am trying to estiamte parameters for gamma distribution using mle for below data using fitdist & fitdistr functions which are from "fitdistrplus" & "MASS"packages . I am getting errors for both functions. Can someone please let me know how to overcome this issue?? data y1<- c(256656, 76376, 6467673, 46446, 3400, 3100, 5760, 4562, 8000, 512, 4545, 4562, 4645, 4...
2018 Jan 29
0
Result show the values of fitting gamma parameter
Capture the results of the apply command into an object and then work with that. Here is one way to do it: > res <- apply(C, 2, fitdist, "gamma") > out <- c( res$A$estimate["shape"], res$B$estimate["shape"], res$A$estimate["rate"], res$B$estimate["rate"]) > names(out) <- c("A shape","B shape","A rate","B Rate") > print(out) #...
2009 Sep 19
1
generic methods - in particular the summary function
Hi all, I'm currently working on the fitdistrplus package (that basically fit distributions). There is something I do not understand about the generic function summary. In the current version on CRAN, there is no NAMESPACE saying S3method(summary, fitdist) . However if we use summary on an object send by fitdist function it works fin...
2010 Oct 03
1
Johnson Distribution Fit
Hi, I am trying to fit a Johnson SB distribution using fitdist function in fitdistrplus Library. I have defined the Johnson SB distribution from ( http://www.ntrand.com/johnson-sb-distribution/) . But it gives me the follwing errors. Any help would be appreciated #xi = xi #lambda =l #delta =d #gamma = g djohn = function(x,xi,l,d,g) (d/(l*sqrt(2*pi)*((x-xi)/l...
2011 Aug 01
3
Beta fit returns NaNs
Hi, sorry for repeating the question but this is kind of important to me and i don't know whom should i ask. So as noted before when I do a parameter fit to the beta distr i get: fitdist(vectNorm,"beta"); Fitting of the distribution ' beta ' by maximum likelihood Parameters: estimate Std. Error shape1 2.148779 0.1458042 shape2 810.067515 61.8608126 Warning messages: 1: In dbeta(x, shape1, shape2, log) : NaNs produced 2: In dbeta(x, shape1, shape2, log...
2010 Jul 15
1
How do I combine lists of data.frames into a single data frame?
The data.frame is constructed by one of the following functions: funweek <- function(df) if (length(df$elapsed_time) > 5) { rv = fitdist(df$elapsed_time,"exp") rv$year = df$sale_year[1] rv$sample = df$sale_week[1] rv$granularity = "week" rv } funmonth <- function(df) if (length(df$elapsed_time) > 5) { rv = fitdist(df$elapsed_time,"exp") rv$year = df$sale_year[1] rv$...
2010 Jul 16
1
I need help making a data.fame comprised of selected columns of an original data frame.
...TEDIFF(return_date,sale_date) AS elapsed_time FROM `merchants2`.`risk_input` WHERE DATEDIFF(return_date,sale_date) IS NOT NULL") moreinfo <- dbGetQuery(con, x) I then made the data frame I want to use as follows: fun_m_id <- function(df) if (length(df$elapsed_time) > 5) { rv = fitdist(df$elapsed_time,"exp") rv$mid = df$m_id[1] rv } aaa <- lapply(split(moreinfo,list(moreinfo$m_id),drop = TRUE), fun_m_id) m_id_default_res <- do.call(rbind, aaa) At this point, each row in m_id_default_res corresponds to one data.frame produced by fitdist. When I print it...
2011 Oct 06
1
apply and functions with many arguments
Dear all, I would like to use the following function fitdist(data, distr, method=c("mle", "mme", "qme", "mge"), start=NULL, fix.arg=NULL, ...) for many different distr values like distr=c("norm","lnorm","pois") (just a small example) and take back into a list the parameter name which is...
2005 May 18
1
'fitdistr' and two views of the same data?
Hello, I have detailed (with pictures and whatnot) my question on my weblog at http://www.cs-ed.org/blogs/mjadud/archives/2005/05/a_question_abou.html The short version of the question is this: When I ask 'fitdistr' to try and fit my distribution as a "weibull" distribution, it comes up with some rather wacky parameters. If I take the same distribution, and do something like newdist <- mapply(function(x) ((x %/% 20) + 1), origdist) which effectively forces the data into a histogram, '...
2012 Sep 11
1
Strange result from GAMLSS
Hi Folks! Just started using the gamlss package and I tried a simple code example (see below). Why the negative sigma? John > y <- rt(100, df=1)> m1<-fitDist(y, type="realline")Warning messages:1: In MLE(ll3, start = list(eta.mu = eta.mu, eta.sigma = eta.sigma, : possible convergence problem: optim gave code=1 false convergence (8)2: In MLE(ll4, start = list(eta.mu = eta.mu, eta.sigma = eta.sigma, : possible convergence problem: optim ga...
2011 Mar 15
3
fitting a distribution to a ecdf plot
Dear all, I need to plot an cumulative distribution plot of a variable and then to fit a distribution to that, probably a weibull or lognormal. I have plotted the ecdf as > plot(ecdf(x)) but I haven't managed to fit the distribution. I have as well attached the data. I would appreciate if you could help me on that. Thank you. Kind regards Maria -------------- next part --------------