Re: [R] Gamma Simulation from Exponential Distribution: find sample size given power and sig.Level

2018-10-29 Thread MacQueen, Don via R-help
If this is homework, then r-help has a no homework policy. I'm assuming that if it is homework then the focus is on statistical concepts, not on R programming. It looks like your gen_p_vals function should be defined as gen_p_vals <- function(reps = n) instead of n = reps. Why not just use

[R] Gamma Simulation from Exponential Distribution: find sample size given power and sig.Level

2018-10-28 Thread Black Yellow
I built my function to simulate two gamma distributions X and Y based on the sum of i.i.d exponential distributions. Assume my code is correct about this simulation, I am interested in finding an equal sample size n for X and Y such that n can be determined given 90% power and 5% significance level

Re: [R] Gamma count

2015-09-04 Thread Dan D
Pick the mean (mu) and variance (sig2) you want. Then, shape = mu^2/sig2 and scale = sig2/mu. This should work fine if your mean is large enough so that p(x = 0 or 1) is small. -- View this message in context: http://r.789695.n4.nabble.com/Gamma-count-tp4711845p4711853.html Sent from the R help

[R] Gamma count

2015-09-04 Thread callyak4real via R-help
I intend to simulate data from gamma distribution. I plan rounding the observations into counts. What I want to know is how I will manipulate the parameters of gamma to have both over and under dispersed count scenarios. [[alternative HTML version deleted]] _

Re: [R] Gamma Distribution - is there any problem with "pgamma"?

2015-03-11 Thread Amelia Marsh
Dear Sir, Thanks a lot for your help and guidance. Regards Amelia --`-- On Wed, 11/3/15, Ben Bolker wrote: Subject: Re: [R] Gamma Distribution - is there any problem with "pgamma"? To: r-h...@stat.math.ethz.ch Date: Wednesday, 11 March, 2

Re: [R] Gamma Distribution - is there any problem with "pgamma"?

2015-03-11 Thread Amelia Marsh via R-help
Dear Mr Byng, Thanks a lot for your great help. Appreciate. Regards Amelia On Wed, 11/3/15, Martyn Byng wrote: Subject: RE: [R] Gamma Distribution - is there any problem with "pgamma"? e...@r-project.org> Date: Wednesday, 11 March

Re: [R] Gamma Distribution - is there any problem with "pgamma"?

2015-03-11 Thread Ben Bolker
Amelia Marsh yahoo.com> writes: > > Dear R forum > > I have following data > > amounts = c(928906.144,156091.0576,433798.3404,993425.7224, > 1323976.364,649106.9339, 369967.2612,2528872.35,1226093.655, > 1145446.149,1809624.453,599329.0394,2200955.213,2583318.064, > 745625.8069,961828.8828,174

Re: [R] Gamma Distribution - is there any problem with "pgamma"?

2015-03-11 Thread Martyn Byng
Sent: 11 March 2015 09:42 To: r-help@r-project.org Subject: [R] Gamma Distribution - is there any problem with "pgamma"? Dear R forum I have following data amounts = c(928906.144,156091.0576,433798.3404,993425.7224,1323976.364,6

[R] Gamma Distribution - is there any problem with "pgamma"?

2015-03-11 Thread Amelia Marsh
Dear R forum I have following data amounts = c(928906.144,156091.0576,433798.3404,993425.7224,1323976.364,649106.9339, 369967.2612,2528872.35,1226093.655,1145446.149,1809624.453,599329.0394,2200955.213,2583318.064,745625.8069,961828.8828,1744841.313,1939390.005,1077873.654,729924.2713,803584.26

Re: [R] Gamma curve fit to data with specific bins

2013-05-21 Thread Lorentz, Andrew
Hi Riu, Very helpful. Thanks a million! Andrew -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: 20 May 2013 23:49 To: Lorentz, Andrew Cc: r-help@r-project.org Subject: Re: [R] Gamma curve fit to data with specific bins Hello, You are fitting a vector other

Re: [R] Gamma curve fit to data with specific bins

2013-05-20 Thread Rui Barradas
Hello, You are fitting a vector other than the vector 'x'. And you are mistaking the parameter scale for rate. est <- fitdistr(x,"gamma")$estimate #plot the gamma curve with the found parameters hist(x, breaks=Size, freq=FALSE, xlab="Drop Size", ylab="No. of Drops") curve(dgamma(x, rate=est["r

[R] Gamma curve fit to data with specific bins

2013-05-20 Thread Lorentz, Andrew
Good afternoon, I have some rainfall drop size data (frequency count within drop size) that is already arranged into specific bins (Size). I am looking to fit a gamma curve onto a histogram of the data. At the moment I have been able to create estimate the gamma parameters from the PDF of the

Re: [R] gamma regression & zeros

2013-03-25 Thread Ben Bolker
Sören Prehn iamo.de> writes: > Dear all, I have a problem with gamma regression (glm - family = > Gamma) and zeros in R. The problem is the following when I try to > estimate a dataset without zeros (endogenous variable) there is no > problem. However, if I try to do the same with zeros I always

[R] gamma regression & zeros

2013-03-25 Thread Sören Prehn
Dear all, I have a problem with gamma regression (glm - family = Gamma) and zeros in R. The problem is the following when I try to estimate a dataset without zeros (endogenous variable) there is no problem. However, if I try to do the same with zeros I always get an error message. In STATA and M

Re: [R] gamma distribution in rugarch package

2012-07-26 Thread MK
I don't think it is provided and gamma is neither a special case of ghyp nor ged. Is there a reason for you to use the gamma distribution? The gamma distribution only has support for positive number and thus impossible for stock return. Cheers, M On 26/07/12 09:52, saraberta wrote: Hi guys

[R] gamma distribution in rugarch package

2012-07-26 Thread saraberta
Hi guys, does anyone know if there is the possibility to fit a gamma distribution using ugarch?honestly i don't know if maybe is possible to fix some parameters that reduce ghyp or ged in a gamma distribution.. thanks a lot sara -- View this message in context: http://r.789695.n4.nabble.com/ga

[R] Gamma Distribution - Goodness of Fit and Choice of Parameters

2012-04-20 Thread clangkamp
As a short disclaimer - I have read the previous posts on Fitting the Gamma Distribution, but have two questions going beyond that: 1. Does anybody have a reference for the theory of fitting a gamma distribution (i.e. whether to apply Kolmogorov-Smirnov, or similar) 2. Has anybody toyed around with

Re: [R] Gamma distribution parameter estimation

2011-08-07 Thread Rolf Turner
On 08/08/11 13:20, Peter Ehlers wrote: On 2011-08-07 16:57, Rolf Turner wrote: Neither Ted Harding's post, nor Prof. Ripley's, really appear to address the OP's follow-up question which was *why* did he get the ``weird error'' (non-finite finite difference, NaNs produced) when he applied fitd

Re: [R] Gamma distribution parameter estimation

2011-08-07 Thread Peter Ehlers
On 2011-08-07 16:57, Rolf Turner wrote: Neither Ted Harding's post, nor Prof. Ripley's, really appear to address the OP's follow-up question which was *why* did he get the ``weird error'' (non-finite finite difference, NaNs produced) when he applied fitdistr(), as he was advised to do by Jorge

Re: [R] Gamma distribution parameter estimation

2011-08-07 Thread Rolf Turner
Neither Ted Harding's post, nor Prof. Ripley's, really appear to address the OP's follow-up question which was *why* did he get the ``weird error'' (non-finite finite difference, NaNs produced) when he applied fitdistr(), as he was advised to do by Jorge Ivan Velez. The ``weird error'' did

Re: [R] Gamma distribution parameter estimation

2011-08-07 Thread J. R. M. Hosking
On 2011-08-06 15:14, Alexander Engelhardt wrote: Hey, I have a set of income data which I'd like to fit to a gamma distribution. How can I estimate the two parameters of the gamma distribution for a vector, e.g. c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L, 3363L, 3567L, 4798L

Re: [R] Gamma distribution parameter estimation

2011-08-07 Thread Prof Brian Ripley
Well, 'Alexander Engelhardt' failed to follow the posting guide, and so did not get a reply from some knowledgeable people. (1) When using fitdistr you need to roughly scale your data: e.g. divide by 1000 here. (2) fitdistr does 'go down the maximum likeilhood route' and it does find reasona

Re: [R] Gamma distribution parameter estimation

2011-08-06 Thread Ted Harding
On 06-Aug-11 19:37:49, Alexander Engelhardt wrote: > On 08/06/2011 09:23 PM, Jorge Ivan Velez wrote: >> Hi Alex, >> >> Try >> >>> require(MASS) >> Loading required package: MASS >>> b<- c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L, >> + 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2

Re: [R] Gamma distribution parameter estimation

2011-08-06 Thread Alexander Engelhardt
On 08/06/2011 09:23 PM, Jorge Ivan Velez wrote: Hi Alex, Try require(MASS) Loading required package: MASS b<- c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L, + 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2329L, 3944L, 2568L, + 1699L, 4545L) fitdistr(b, 'gamma') shape

Re: [R] Gamma distribution parameter estimation

2011-08-06 Thread Jorge Ivan Velez
Hi Alex, Try > require(MASS) Loading required package: MASS > b <- c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L, + 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2329L, 3944L, 2568L, + 1699L, 4545L) > fitdistr(b, 'gamma') shape rate 6.4528939045 0.0021887943 (0.

[R] Gamma distribution parameter estimation

2011-08-06 Thread Alexander Engelhardt
Hey, I have a set of income data which I'd like to fit to a gamma distribution. How can I estimate the two parameters of the gamma distribution for a vector, e.g. c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L, 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2329L, 3944L, 2568L, 169

[R] Gamma mixture models with flexmix

2011-02-28 Thread Wittner, Ben, Ph.D.
I've been trying with no success to model mixtures of Gamma distributions using the package flexmix (see examples below). Can anyone help me get it to model better? Thanks very much. -Ben ## ## Please help me get flexmix to correctly model mixtures of ## Gamma distributions. See examples below.

Re: [R] Gamma & Lognormal Model

2010-12-28 Thread Louisa
Thank you Michael! -- View this message in context: http://r.789695.n4.nabble.com/Gamma-Lognormal-Model-tp3165408p3166318.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

Re: [R] Gamma & Lognormal Model

2010-12-28 Thread Michael Dewey
At 20:08 27/12/2010, Louisa wrote: Dear, I'm very new to R Gui and I have to make an assignment on Gamma Regressions. Surfing on the web doesn't help me very much so i hope this forum may be a step forward. Well since you are so honest about it being homework try Googling for lognormal gamma

Re: [R] Gamma & Lognormal Model

2010-12-27 Thread Duncan Murdoch
On 10-12-27 3:08 PM, Louisa wrote: Dear, I'm very new to R Gui and I have to make an assignment on Gamma Regressions. Surfing on the web doesn't help me very much so i hope this forum may be a step forward. This forum isn't for homework. You should ask your instructor for help. Duncan Murdo

[R] Gamma & Lognormal Model

2010-12-27 Thread Louisa
Dear, I'm very new to R Gui and I have to make an assignment on Gamma Regressions. Surfing on the web doesn't help me very much so i hope this forum may be a step forward. The question sounds as follows: The data set is in the library MASS first install library(MASS) then type data(mammals)

[R] gamma glm - using of weights gives error

2010-10-24 Thread Andreas Wittmann
Dear R-users, i try to use the following code to do a gamma regression glm(x1 / x2 ~ x3 + x4 + x5 + x6 + x7 + x8, family=Gamma(link="log"), weights=x2) but here i get the error Error: NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: step size truncated due to diverge

[R] Gamma Copula

2010-06-09 Thread Peter Stueckler
Hello R-Team, I am trying to construct a Copula from a multivariate Gamma distribution with its marginals gamma-distributed. The multivariate Gamma should be able to contain a correlation coeficient or matrix. I have studied the book "Continuous Multivariate Distributions vol.I Models and app

Re: [R] Gamma regression doesn't converge

2010-05-30 Thread Joshua Wiley
On Sun, May 30, 2010 at 12:16 PM, Sherrie Jin wrote: > When I ran a Gamma regression in SAS, the algorithm converged. When I ran it > in R, it keeps uncoverged even if I used 1 iterations. What was wrong? > I used the following code in R: > glm(y ~ x1 x2 x3, control=glm.control(maxit=1), d

[R] Gamma regression doesn't converge

2010-05-30 Thread Sherrie Jin
When I ran a Gamma regression in SAS, the algorithm converged. When I ran it in R, it keeps uncoverged even if I used 1 iterations. What was wrong? I used the following code in R: glm(y ~ x1 x2 x3, control=glm.control(maxit=1), data, family=Gamma(link="log")) [[alternative HTML ver

Re: [R] Gamma parametrization

2010-03-22 Thread Randall Wrong
Thank you very much Jay. 2010/3/19 G. Jay Kerns > Dear Randall, > > On Fri, Mar 19, 2010 at 10:24 AM, Randall Wrong > wrote: > > Dear R users, > > > > ?rgamma gives me : > > > > rgamma(n, shape, rate = 1, scale = 1/rate) > > > > rate: an alternative way to specify th

Re: [R] Gamma parametrization

2010-03-19 Thread G. Jay Kerns
Dear Randall, On Fri, Mar 19, 2010 at 10:24 AM, Randall Wrong wrote: > 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

[R] Gamma parametrization

2010-03-19 Thread Randall Wrong
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

[R] Gamma correlation

2009-12-11 Thread Manuel Jesús López Rodríguez
Dear all, does anybody know if it is possible, and how, to compute the Gamma correlation in R? Thank you very much in advance! Manuel __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] Gamma function

2009-05-16 Thread Stavros Macrakis
What exactly is the R code you wrote for your function f? Without that, it will be hard to help you. -s On Sat, May 16, 2009 at 2:48 AM, Kon Knafelman wrote: > > Hi Guy, > > I am having trouble graphing the following function > > √2Γ(n/2)/[√n - 1Γ((n - 1)/2 for the values of n betw

Re: [R] Gamma

2009-05-16 Thread Johannes Huesing
Kon Knafelman [Sat, May 16, 2009 at 08:49:44AM CEST]: > > Hey, > > I am having trouble graphing the following function > > ???2??(n/2)/[???n ??? 1??((n ??? 1)/2 for the values of n between 2 and 50. > > i know that ??(n) = (n-1)!, which in R is factorial(n-1) > > When i type that into R, usin

[R] Gamma function

2009-05-16 Thread Kon Knafelman
Hi Guy, I am having trouble graphing the following function √2Γ(n/2)/[√n − 1Γ((n − 1)/2 for the values of n between 2 and 50. i know that Γ(n) = (n-1)!, which in R is factorial(n-1) When i type that into R, using y <- function(n). and then plot(y,2,50), it doesnt give me anythin

[R] Gamma

2009-05-16 Thread Kon Knafelman
Hey, I am having trouble graphing the following function √2Γ(n/2)/[√n − 1Γ((n − 1)/2 for the values of n between 2 and 50. i know that Γ(n) = (n-1)!, which in R is factorial(n-1) When i type that into R, using y <- function(n). and then plot(y,2,50), it doesnt give me anything m

[R] gamma regression (Zelig package)

2009-02-12 Thread soetzel
Hey, I want to estimate to regressions. First I want to estimate simple OLS. Since my dependent variable looks like a gamma distribution I want to estimate a gamme regression with the "zelig" package. But, I have some problems with the interpretation of the estimated coefficient. In the OLS the

[R] gamma parameters fitted

2008-05-16 Thread KOITA Lassana - STAC/ACE
Hi R-users, I'm fitting gamma parameters (shape and rate ) by two methods (by direct and and fitdistr of MASS library). I have realized the following code which gives me two results. However, I find that those two outcomes are significantly different. Is there any explanation to this case? Many