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

How to use gamma family in GLMMTMB

I have a variable called "duration_bout" which corresponds to a duration in seconds. Here's what the distribution looks like: It looks like a Poisson distribution, but my durations are a continuous variable. If I transform my data to integers,…
Saaa
  • 11
  • 2
1
vote
1 answer

Specify parameters of a gamma distribution given known median and mode

I need to specify a gamma distribution to represent a random variable in my modelling process. I have no data so cannot estimate parameters in a traditional way. All I know is that the mode must be 3 and the median must be 7. Is there any way I can…
fil0607
  • 101
  • 5
1
vote
1 answer

Maximum Likelihood estimation of GARCH(1,1) with gamma distribution

I am trying to fit a GARCH(1,1) model to a dataset with Gamma(a, 1/a) distribution, using maximum likelihood estimation. Therefore, the loglikelihood function im using is: LogL = - ln(Γ(nu)) + (nu - 1) * ln(x) - nu*(x/mu) - nu * ln(mu) x = data, mu…
zjos020
  • 11
  • 2
1
vote
1 answer

Predicting the outcome based on first few results

I need to solve a forecasting problem I have in my company. I am going to use the example of racing cars because it very closely matches the problem I am trying to solve: Let's say I have data from hundreds of races and the distribution of time…
DrBorrow
  • 950
  • 12
  • 24
1
vote
1 answer

Is weibull the right distribution for this data? How do i find the best parameters using R?

I have some time occurrence data for multiple(1000s) event groups. I need to cluster the event groups showing similar distribution and find the parameters for each cluster. each event group has between 5-15 data points. I took a random sample of 50…
1
vote
1 answer

Random Samples from Gamma distribution with two parameters / Python

If I would like to generate 10 random samples from a gamma distribution with (with the following form): with alpha = 2 and beta = 3, how would I do it? The documentation:…
1
vote
1 answer

R - Gamma distribution - Linear Mixed-Effects Model - lmer/glmer errors

First time asking here so please let me know if anything else is needed to be able to help! I have analysed my data using lmer() which worked well. I have since realised that a Gamma distribution is more fitting than the Gaussian I am currently…
AGS
  • 11
  • 4
1
vote
0 answers

Plotting a calculus function

How can I plot this function in R? I am not sure how to express this function.
VXL963
  • 41
  • 5
1
vote
2 answers

Gamma(log) in stat_poly_eq

I'm having some trouble having stat_poly_eq print the correct formula within my plot. My current plot is plotted as follows. ggplot(DataSB,aes(x=Year,y=Kilos))+ geom_point(shape=21, size=3, color="black", fill="#E29578") + geom_smooth(method =…
Thije Zuidewind
  • 87
  • 1
  • 1
  • 7
1
vote
0 answers

Gamma cdf function returns array of 1's

clc clear all close all dth_dB_vec = -5:5:15 epsilon = 5 v = 4 qp = 4 var = 10 Mp = 2^(qp) Detection_per_vec = []; for i = 1:length(dth_dB_vec) dthdB = dth_dB_vec(i); dth_Natural = 10^(dthdB/10); Detection_per = 0; Pfa =…
1
vote
1 answer

Is there a way to do a Regression in Catboost for a Gamma distributed response variable?

I'm working on an Insurance model and I'd like to run Severity and Frequency models using the Catboost gradient boosting algorithm. The problem is that according to the literature, a Severity model assumes a Gamma distributed response variable,…
1
vote
2 answers

Monte Carlo to Estimate Theta using Gamma Distribution

I would like to run a monte carlo simulation in r to estimate theta. Could someone please recommend some resources and suggests for how I could do this? I have started with creating a sample with the gamma distribution and using the shape and rate…
John Huang
  • 845
  • 4
  • 15
1
vote
2 answers

Random Gamma distribution using python

I am trying to fit a random gamma distribution on my data using python. I have written so far following codes a = 10 b = 1 n=25 n_classes = 16 true_val = [] for i in np.arange(n_classes): gamma_process= np.cumsum(np.random.gamma(n,a,b)) …
Ankita
  • 485
  • 5
  • 18
1
vote
2 answers

equivalent of MATLAB function gaminv()

I have been struggling for quite a while trying to find an R equivalent to MATLAB's gaminv function. To my knowledge, there are no packages/functions in R that do exactly what `gaminv does. I am not sure how to code it up myself either. Any…
DellasZi
  • 13
  • 3
1
vote
2 answers

Solving function containing gamma in Python

I'm quite new to programming with python. I was wondering, if there is a smart way to solve a function, which includes a gamma function with a certain shape and scale. I already created a function G(x), which is the cdf of a gamma function up to a…
Hello3456
  • 25
  • 4