Questions tagged [gamma-distribution]

Anything related to the gamma probability distribution, i.e. a continuous probability distribution whose probability density function is connected to the "gamma function". DO NOT USE this tag for questions about the gamma function, use the [gamma-function] tag instead.

Anything related to the gamma probability distribution, i.e. a continuous probability distribution whose probability density function is connected to the gamma function.

If a variable X follows a gamma distribution with shape parameter k>0 and scale parameter θ, then it has probability density function:

enter image description here

It follows that E(X)=kθ and Var(X)=kθ². In some texts, the gamma distribution is parameterized instead by the rate parameter, which is the reciprocal of the scale parameter: β=1/θ.

DO NOT USE this tag for questions about the gamma function, use the tag instead.

See Wikipedia page on the gamma distribution.


Tag Usage

Questions on should be about implementation and programming problems, not about the statistical or theoretical properties of the technique. Consider whether your question might be better suited to Cross Validated, the StackExchange site for statistics, machine learning and data analysis.

219 questions
0
votes
1 answer

Generalised Gamma distribution R

I've been stuck on this for a while, and it is probably something so simple but hey I'm bogged down. I've been using the flexsurv package, and I've got the following coefficients: MU: 1.8664 SIGMA: 0.1701 Q: -47.8063 I'm trying to extrapolate…
0
votes
0 answers

error in gamma link specification for lmer

I'm trying to fit a mixed-effects model with a gamma distribution. The most basic model has one fixed predictor and 1 random effect. No matter which link I specify (I've tried log, identity and inverse), I obtain the following error. My real data…
makai
  • 31
  • 1
  • 8
0
votes
1 answer

Gamma distribution

Let X~gamma(2,1). Find: P(X>=2) (X<=10) I'm struggling to determine how to solve this. I know you must integrate some function from 2 to infinity and 0 to 10 but don't know what to integrate.
0
votes
1 answer

TypeError: _parse_args() got an unexpected keyword argument 'size' for gamma distribution

I'm trying to plot Gamma(alpha=scale=29, beta=size=3), but I'm getting the error TypeError: _parse_args() got an unexpected keyword argument 'size' for y1. I'm following the scipy documentation for gamma distributions and there's a size parameter…
14wml
  • 4,048
  • 11
  • 49
  • 97
0
votes
1 answer

Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ for Gamma distribution plot

I'm trying to plot the pdf distribution of Gamma(alpha=29, beta = 3) on a graph, but I get the error: "Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ". Why? x <- seq(0, 1000, by = 1) y <- dgamma(x, shape = 3, rate = 1/29,…
14wml
  • 4,048
  • 11
  • 49
  • 97
0
votes
0 answers

Profile likelihood based confidence intervals for gamma cdf

Can anyone please help me with the construction of the point-wise profile likelihood based confidence intervals for the gamma cdf? I'm aware of the construction of profile likelihood based confidence intervals for the estimated gamma parameters but…
Nayomi
  • 85
  • 5
0
votes
1 answer

Hessian matrix in optim() in R

I'm having some trouble using optim() in R to solve for a likelihood involving an integral and obtain the hessian matrix for the 2 parameters. The algorithm converged but I get an error when I use the hessian=TRUE option in optim(). The error is:…
0
votes
2 answers

Fit points with gamma CDF in python or R

I have series of plots looking like this: python code: a = np.array([4,4,4,4,5,5,5,6,6,6,6,6,6,6,7,7,7,8,8,8,9]) b = np.array([i/len(a) for i in range(1, len(a)+1)]) pl.plot(a,b, 'ro') r code: a <- c(4,4,4,4,5,5,5,6,6,6,6,6,6,6,7,7,7,8,8,8,9) b <-…
Bobesh
  • 1,157
  • 2
  • 15
  • 30
0
votes
1 answer

Error in gammamixEM... Try different number of components? in R

I am trying to fit a 2 component gamma mixture model to my data (residual values obtained after running Generalized Linear Model), using following command (part of the code): expr_mix_gamma <- gammamixEM(expr_glm_residuals, lambda = c(0.75,0.25),…
aan
  • 89
  • 9
0
votes
1 answer

scoring on a scale of 1-100

I have a data set having 2000 elements. I found the distribution of that data set as Gamma (0.4). I am trying to give scores to these numbers on 1-100 scale. but I think linear conversion formulas will not work since it has a statistical…
Alya
  • 1
0
votes
1 answer

SAS vs. Stata: Gamma Distribution Function

I'm trying to reverse engineer a Stata program into SAS, and I'm having trouble with the gammap function in Stata and what it correlates to in SAS. From Stata documentation, it appears that the gammap function returns the cumulative gamma…
kstats9pt3
  • 799
  • 2
  • 8
  • 28
0
votes
1 answer

Finding the shape and scale of a gamma distribution given home range

pasted below is supplemental material from an article. After finding home range values, the authors say, "gamma(13,10) covers this nicely". How did the authors find 13 and 10? # Moldenhauer and Regelski (1996) state that home range size typically #…
Datum
  • 1
  • 1
0
votes
2 answers

R: coding why show 0.00 in result

My aims of this simulation is to evaluate the type 1 error rate of the tests under several combination of factors. sample sizes-(10,10),(10,25),(25,25),(25,50),(25,100),50,25),(50,100), (100,25),(100,100) standard deviation ratio- (1.00, 1.50,…
j.l
  • 25
  • 8
0
votes
1 answer

generate random sample from inverse gamma distribution with boost C++

I'm trying to sample from a inverse gamma distribution using the following code, obtain modifying some code I found on line. I'm not an expert in coding in C++, so I need some explanation and help from you. #include #include…
user58058
  • 3
  • 3
0
votes
2 answers

Gamma equivalent to standard deviations

I have a gamma distribution fit to my data using libary(fitdistrplus). I need to determine a method for defining the range of x values that can be "reasonably" expected, analogous to using standard deviations with normal distributions. For example,…
viridius
  • 477
  • 5
  • 17