similar to: dgamma error condition?

Displaying 20 results from an estimated 10000 matches similar to: "dgamma error condition?"

2007 Apr 23
2
Problem with dgamma ?
Hi All, Here 's what I got using dgamma function : > nu<-.2 > nu*log(nu)-log(gamma(nu))+(nu-1)*log(1)-nu*(1) [1] -2.045951 > dgamma(1,nu,nu,1) [1] 0.0801333 > dgamma(1,nu,nu,0) [1] NaN Warning message: NaNs produced in: dgamma(x, shape, scale, log) Could anyone tell me what is wrong here ? I am using R-2.4.1 on windows XP. Thanks a lot.
2003 Sep 30
3
fitdistr, mle's and gamma distribution
Dear R Users, I am trying to obtain a best-fit analytic distribution for a dataset with 11535459 entries. The data range in value from 1 to 300000000. I use: fitdistr(data, "gamma") to obtain mle's for the parameters. I get the following error: Error in optim(start, mylogfn, x = x, hessian = TRUE, ...) : non-finite finite-difference value [1] And the following warnings:
2011 Sep 10
1
dgamma in jags within r
I define priors in jags within r using a gamma distribution. I would like to control the shape but I have problems. Any help will be usefull. From help of dgamma ___________________ The Gamma distribution with parameters shape = a and scale = s has density f(x)= 1/(s^a Gamma(a)) x^(a-1) e^-(x/s) and rate=1/scale From jags user manual ____________________ dgamma(r, mu) has a density of
2005 Aug 27
1
bug in L-BFGS-B? (PR#8099)
--WWm7B+u2U4 Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit G'day all, I believe that this is related to PR#1717 (filed under not-reproducible) which was reported for a version of R that is a quite a bit older than the ones used in for this report. But I noticed this behaviour under R 2.1.1 and R 2.2.0 on my linux box and
2001 Sep 06
1
RFC: d/p/q/rgamma
dgamma and friends in S are documented as dgamma(x, shape, rate=1) pgamma(q, shape, rate=1) qgamma(p, shape, rate=1) rgamma(n, shape, rate=1) whereas R has dgamma(x, shape, scale=1, log = FALSE) pgamma(q, shape, scale=1, lower.tail = TRUE, log.p = FALSE) qgamma(p, shape, scale=1, lower.tail = TRUE, log.p = FALSE) rgamma(n, shape, scale=1) Note the use of rate vs scale. Indeed, as both S and
2016 Nov 13
1
dgamma density values in extreme point
Dear R-Devel group, My name is Alexey, a data scientist from Moscow, currently working for Align Technology Inc. We have recently had a discussion of the results that the dgamma function (stats) returns for an extreme point (x == 0). <dgamma(0,1,1,log = FALSE) [1] 1 and <dgamma(0,0.5,1,log = FALSE) [1] Inf Density appears to be defined in point zero for the distribution with the
2008 Jun 25
1
dgamma in WinBUGS and JAGS (rjags)
Hello, In WinBUGS 1.4 manual (http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/manual14.pdf), the gamma density is presented as dgamma(r,mu) where r and mu are the shape and rate parameters, respectively. In JAGS (rjags) manual version 1.0.2, May 9, 2008 (http://www-fis.iarc.fr/~martyn/software/jags/jags_user_manual.pdf), on page 26 the gamma density is presented as dgamma(mu,r) instead of dgamma(r,mu).
2005 Jul 12
1
three par. fitting with fitdistr
Hello, I want to fit a tree parameter distribution to given data. I tried it with sample data using the "fitdistr" function. Here my workflow that didn't had any result: I started with the generalized gamma distr, which is: r*dgamma(x^r,shape,rate) The R-function is: ggamma = function (x,r,shape,rate) r*dgamma(x^r,shape,rate=rate) For the first step I assumed r = 1 and I
2001 Dec 17
1
behavior of r* and d* functions at boundaries (PR#1218)
(Sent this to r-help back in October, got no comments, forgot to re-submit it as a bug report.) There are a few inconsistencies, at least, in some of the functions that generate random deviates from particular distributions (I think they're bugs because they're inconvenient, but maybe someone can make an argument for the current behavior). If people think these are really bugs I can
2001 Nov 09
2
ks.test
Dear R-List members, I want to check if a set of measurements follows better a gamma or a lognormal distribution (see data below). Using shapiro.test I can test for normality (shapiro.test(log (Lt)). To test for gamma (and normal) distribution I would use ks.test but I need to specify its shape and scale. How should I calculate these values in R? I tried > Lt.fit <- glm(Lt ~ 1,
2002 Jan 11
2
new dgamma rate argument
Can someone explain to me in what way the new (dpqr)gamma parameter can be interpreted as a rate (when shape != 1)? The only gamma rate that I am aware of is the hazard rate given by dgamma/(1-pgamma), the log of which is returned by my hgamma function (event library). Jim -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2000 Apr 14
1
rgamma with negative shape and scale parameters works?
Dear R people, This is a possibly silly question, but the rgamma function takes the shape and scale arguments and simulates gamma rvs corresponding to those values, right? But the shape and scale parameters have to be positive, right? However, rgamma quite happily returns to me values for negative values of shape and scale, and in some cases returns negative values eg. > rgamma(1, 1, -1) [1]
2005 Jun 25
1
comment in src/nmath/dgamma.c
Hi, In src/nmath/dgamma.c the comment at the top says * DESCRIPTION * * Computes the density of the gamma distribution, * * 1/s (x/s)^{a-1} exp(-x/s) * p(x;a,s) = ----------------------- * (a-1)! * * where `s' is the scale (= 1/lambda in other parametrizations) * and `a' is the shape parameter ( = alpha in
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):
2000 Feb 10
3
creating a grid of function values
I want to create a grid of function values for use in `contour' or `persp'. The function is the log-likelihood for the gamma. The sample is stored as vector of length 20 called `Survival'. A single evaluation of the log-likelihood at, say, scale = 9 and shape = 10 would be obtained by sum(dgamma(Survival, scale = 9, shape = 10, log = TRUE)) (This may work only 0.99.0, I'm not
2010 Mar 19
1
Gamma parametrization
Dear R users, ?rgamma gives me : rgamma(n, shape, rate = 1, scale = 1/rate) rate: an alternative way to specify the scale. The Gamma distribution with parameters ‘shape’ = a and ‘scale’ = s has density f(x)= 1/(s^a Gamma(a)) x^(a-1) e^-(x/s) Should I understand that scale=1/rate ? Is it written somewhere ? Then
2004 Feb 05
5
rgamma question
I was trying to generate random numbers with a gamma distribution. In R the function is: rgamma(n, shape, rate = 1, scale = 1/rate). My question is that if X~gamma(alpha, beta) and I want to generate one random number where do I plug alpha and beta in rgamma? and, what is the meaning and use of rate? Thanks for your attention, Jorge [[alternative HTML version deleted]]
2008 Jul 07
4
Plot Mixtures of Synthetically Generated Gamma Distributions
Hi, I have the following vector which is created from 3 distinct distribution (three components) of gamma: x=c(rgamma(30,shape=.2,scale=14),rgamma(30,shape=12,scale=10),rgamma(30,shape=5,scale=6)) I want to plot the density curve of X, in a way that it shows a distinct 3 curves that represent each component. How can I do that? I tried this but doesn't work: lines(density(x)) Please
2007 Oct 07
1
a function to compute the cumulative distribution function (cdf) of the gamma
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible Url : https://stat.ethz.ch/pipermail/r-help/attachments/20071006/065906cc/attachment.pl
2009 Sep 25
1
Problem with dgamma function.
Hi, All, I am getting some funny results trying to use R's built in distribution functions. In R: > dgamma(4.775972,1.37697964405418, 0.106516604930466) [1] 0.05585295 > dgamma(4.775972,1.37697964405418, 0.106516604930466,TRUE) ### THIS IS JUST WRONG! [1] 0.01710129 > log(dgamma(4.775972,1.37697964405418, 0.106516604930466)) [1] -2.885033 > In C: