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 calculate the entropy of a gamma distribution using scipy(python)?

I tried the sample code by Saullo Castro to get the parameters of a gamma distribution, using scipy. import scipy import scipy.stats size = 30000 x = scipy.arange(size) y = scipy.int_(scipy.round_(scipy.stats.vonmises.rvs(5,size=size)*47)) dist =…
Michael
  • 1,398
  • 5
  • 24
  • 40
0
votes
0 answers

Range out of value in gamma fn, how to calculate factorial >200

I am attempting to create a function to calculate the binomial formula, but I keep getting the error "Range out of value in gamma fn" mything <- function(x, n, p) { a = choose(n, x) b = p^x c = (1 - p)^(n - x) d = a * b * c …
Dave
  • 17
  • 3
0
votes
1 answer

Looping over every year and apply a function

I have a data frame with an observed variable and the date stamp [Var1, DD, MM, YYYY] that runs over thousands of rows. I need to fit a distribution [exponential or gamma] for each year's observed variable and get relevant parameters for each year.…
0
votes
1 answer

Matlab gamfit equivalent function in boost

I'm looking for an equivalent function to gamfit in boost. Anyone knows if it is implemented a functionality like gamfit in boost library ? Thanks
Ariel
  • 151
  • 1
  • 9
0
votes
0 answers

Gamma Distributions in Pymc - Bayesian Testing

I've closely followed this book (http://nbviewer.ipython.org/github/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/blob/master/Chapter2_MorePyMC/MorePyMC.ipynb) but have found myself running into problems when trying to…
Kali_89
  • 617
  • 2
  • 7
  • 21
0
votes
1 answer

error of ploting pdf, cdf and quantile functions of truncated gamma distribution in R

After searching in the forum, I did not find similar questions. If I missed it, please let me know. I would really appreciate. I need to plot pdf , cdf, and quantile function of a truncated gamma for any given shape and scale values in R . But, I…
0
votes
1 answer

efficient sampling from trucnated gamma distribution in R

After searching in the forum, I did not find similar questions. If I missed it, please let me know. I would really appreciate. I need to generate N (can be 10000 or more) sample points from gamma distribution wth given shape and scale parameters and…
user3440244
  • 371
  • 1
  • 3
  • 15
0
votes
1 answer

Mixture of inverse gamma distributions in sympy.stats

Following up on a previous post, I'd like to do the following to take a weighted mixture of inverse gamma distributions using sympy.stats: %matplotlib inline from matplotlib import pyplot as plt from sympy.stats import GammaInverse, density import…
J Grif
  • 1,003
  • 2
  • 12
  • 16
0
votes
1 answer

Estimate a distribution parameters only by data mean and std. dev

I need to estimate a truncated gamma distribution parameters (shape , scale). But, I only know the data mean and std. dev. I do not know the data set. Given the mean and std. dev. of a data set from a truncated gamma distribution, how to find…
user3356689
  • 55
  • 1
  • 9
0
votes
1 answer

Which distribution fits data better?

I use fitdistr in R to select which distribution fits my data best. I've tried Cauchy, Weibull, normal, and Gamma distributions. The log-likelihoods were: -329.8492 for Cauchy, -277.4931 for Gamma, -327.7622 for Normal, -279.0352 for Weibull. Which…
0
votes
3 answers

How to do data fitting to find the distribution of given data

I need to do data fitting to find the distribution of a given data. I need to find the pdf function of the distribution. I can use data fitting functions in matlab and python. It looks like a truncated gamma. But, how to find the parameters of the…
0
votes
1 answer

SciPy took very long time for generating gamma distribution in Python 3.2

I need to generate a truncated gamma distribution pdf curve and histogram in Python 3.2 on win7. import numpy as np import matplotlib.pyplot as plt import scipy.special as sps shape, scale = 2., 2. # mean and dispersion counter =0 s =…
0
votes
0 answers

R codes for Poisson Gamma mixture distribution

I have already estimated my parameters namely mu, power variance, dispersion , power, shape and scale parameters of Gamma, i have claims data and i want to fit a Compound Poisson Gamma in R, how do i proceed from here? i have done a little bit of…
user40494
  • 101
  • 1
0
votes
1 answer

modelling claim loss using tweedie distribution in R

i want to fit a tweedie compound Poisson Gamma to my loss data using ptweedie.series R command. I am getting problems how to start with my fitting in R. Thanks in advance.
0
votes
1 answer

Gamma distribution fit error

For a classification task I want to fit a gamma distribution to two pair of data: Distance population within class and between class. This is to determine the theoretical False Accept and False Reject Rate. The fit Scipy returns puzzles me tough. A…
Peter Smit
  • 1,594
  • 1
  • 13
  • 27
1 2 3
14
15