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
0 answers

How to perform survival analysis using a mixture distribution

I want to use a mixture of Gamma distribution as a parametric model for survival analysis on censored data using R. In the "flexsurv" package there are different distributions but I couldn't find a Gamma mixture distribution. In that package, it…
KRL
  • 195
  • 1
  • 1
  • 5
0
votes
1 answer

Simulate left Truncated Gamma distribution with mean = 1 and variance =0.4

Suppose X~Γ(α, β), I would like to truncate all values of X MATLAB codes: t = 0.5; theta = 0.4; syms alpha beta EX = beta*( igamma(alpha+1,t/beta) / igamma(alpha,t/beta) ); %Mean EX2 = beta^2*( igamma(alpha+2,t/beta) / igamma(alpha,t/beta)…
0
votes
1 answer

Apply 3 sigma formula in gamma distribution?

Let say i have some data that follows gamma distribution, and i calculated the Mean and Standard deviation of the gamma distribution. I also know that there are some outliers(Noise) in the data i want to exclude. Now , Is it OK to take Mean+ 3 sigma…
Monir
  • 1,402
  • 14
  • 16
0
votes
1 answer

Fit inverse gamma distribution to data in R

Let's say I have a sample that could follow an inverse gamma distribution (see Empirical PDF). I would like to estimate the shape parameter alpha and the scale parameter beta with something like fitdistr. Is it possible? I have tried the this…
Omar
  • 31
  • 7
0
votes
0 answers

plotting gamma distribution in R with ~Gamma(1000,20)

I'm still relatively new to R and I'm confused on how I'm supposed to plot gamma My data is distributed ~ Gamma(1000,20) so my code looks like curve(dgamma(x, shape = 1000 , scale = 20, log = FALSE)) This results in a straight line being plot. I am…
ajdawg
  • 17
  • 1
0
votes
0 answers

R- Likelihood function for Cox model with frailty

I am trying to write an R code for the likelihood function for a cox model with gamma frailty. I know there are packages in R which would do that easily. But I want to write a customized likelihood function for cox model with gamma frailty for my…
0
votes
0 answers

R optim() L-BFGS-B needs finite values of 'fn'

I am using MLE and l-moments method for gamma distribution, exponential distribution and weibull distribution. I used fitdistr() in gamma distribution. I have an error messga saying that L-BFGS-B needs finite values of 'fn' And I wonder if I can…
JDDD
  • 61
  • 2
  • 2
  • 7
0
votes
0 answers

How to fit Probability distribution to this data. Using scipy

I have a data like this : I have plotted histogram for each month : I can not seem to fig out which probability distribution will fit it the most. I tried to fit in gamma distribution but results are bad : alpha_mom = precip_mean ** 2 /…
PriyalChaudhari
  • 363
  • 1
  • 7
  • 23
0
votes
2 answers

How can I calculate the median in a gamma distribution?

I have the below distribution, which I want to calculate the median of: x=0:0.01:10; x=[x' x' x' x' x']; a=ones(1,1001)'; a=[a*2 a*4 a*6 a*8 a*10]; b=2; f = gampdf(x,a,b); plot(x,f) grid on
0
votes
1 answer

normalized lower incomplete gamma in R

I am attempting to reproduce results of this paper in R, but I am stuck on two parts. plotting the normalized lower incomplete gamma functions calculating the loss function This problem would be solved if there existed a function in R that…
Alex
  • 2,603
  • 4
  • 40
  • 73
0
votes
1 answer

A Boxplot in R to compare the results of 95% confidence Intervals of different sample size

I am trying to show the effect of sample size of a gamma distribution on the bounds of a 95% confidence interval by using bootstrapping. Now, I need to put together the results of 4 different sample sizes in a single boxplot. The R code follows: y…
Reza
  • 147
  • 7
0
votes
2 answers

Plotting gamma distribution in R

Am trying to plot a gamma distribution histogram using R so i have gam(10, 0.5) I have previously calculated mean as 10* 0.5 = 5 So Am supposed to plot a histoigram of 100 observations with scale = 10 and shape = 0.5 So i have tried x <-…
Geoff
  • 6,277
  • 23
  • 87
  • 197
0
votes
0 answers

compute the density of a multivariate Dirichlet and Gamma distribution in R

I'd like to compute the density of a multivariate dirichlet distribution and to generate random realizations from such a distribution. Like what the function dmvnorm does with the multivariate normal distribution. I found this for the normal…
0
votes
0 answers

Netlogo: About the controlling of turtles generating timing by decrement-timer using variable created from gamma distribution

I would like to control the timing of turtle generation with a decrement-timer using variables obtained from the gamma distribution. The following is sample program syntax. to setup-turtles set number-of-turtles 0 set-default-shape turtles…
goodgest
  • 418
  • 3
  • 10
0
votes
1 answer

Gamma distribution, incomplete beta function

I need to calculate Gamma cumulative distribution, and it seems this is fairly equivalent to calculating the incomplete beta function. Excel does have an inculded calculator, but I found no trace of the used algorithm. Do any of you know an accurate…
Pierre
  • 1,046
  • 7
  • 21