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
1 answer

Netlogo - Sampling from a Beta-Pert Distribtuion

I'm posting this partially to get a question answered and partially so someone else might find it later and save them the headache. I am trying to create a beta-pert distribution in NetLogo by following the formula here from Epix Analytics I've…
1
vote
0 answers

Code Repeated Measures and distribution in R from SAS

I have the following code in SAS, and I need to recreate this model for the same data set in R. I am having trouble finding the proper code to recreate the model, especially changing the distribution of the data to a gamma distribution. SAS…
Dan
  • 143
  • 4
  • 13
1
vote
0 answers

Using antiD function for variance of gamma distribution

This is my first post here and I hope I'll follow all the rules of the community. I'm trying to calculate variance of gamma distribution with shape parameter 2 and scale parameter 3 in R using function antiD from mosaic package. The R code I use is…
1
vote
2 answers

Generate random value from gamma distribution in Java

How do I generate numbers from a gamma distribution in Java?
1
vote
0 answers

Generate samples from a gamma distribution in c++ without random, boost or chrono

I would like to generate samples from a gamma distribution in c++. I am compiling my code on a supercomputer, which does not have an up-to-date version of g++ (nor can it be updated). I have written code which uses chrono and random to generate…
ben18785
  • 356
  • 1
  • 5
  • 15
1
vote
1 answer

Transform variable to gamma distribution in R

I have a variable that I want to transform to a gamma distribution with known shape and rate parameters. How can I transform the variable to a gamma distribution in R? I've looked into the dgamma, pgamma, and qgamma functions, but I can't tell if…
itpetersen
  • 1,475
  • 3
  • 13
  • 32
1
vote
1 answer

R calculated gamma distribution density wrong?

I am trying to numerically calculate marginal likelihood (marginalize over a positive parameter). I am using Gamma distribution as prior for that parameter. Here I looked at the behavior of Gamma distribution for two specific parameter settings: s =…
qkhhly
  • 1,150
  • 3
  • 12
  • 27
1
vote
1 answer

Check the return values from function Gammad and Truncate (from package distr and truncdist)

After searching the forum, I did not find similair questions. If you find one, please let me know. I would really appreciate. In R, I need to check the return values from function Gammad and Truncate (from lib distr and truncdist). It means that if…
user3440244
  • 371
  • 1
  • 3
  • 15
1
vote
2 answers

fast generating 1000 means of sample points from truncated gamma distriution with 1000 different shapes and scales values in R

After searching the forum, I did not find similair questions. If you find one, please let me know. I would really appreciate. I need to generate 1000 means of sample points from truncated gamma distriution with 1000 different shapes and scales…
user3440244
  • 371
  • 1
  • 3
  • 15
1
vote
0 answers

Convergence error for development version of lme4 - after R3.1.0

I am having the same problem as previous post from dmartin but the solution presented has not being working to my dataset. trying to fit: model<-glmer(nb~habitat*stigmatype+(1|sitecode/stigmaspecies), family=Gamma(link=log)) Warning…
Carine
  • 31
  • 1
  • 1
  • 6
1
vote
1 answer

Be accurate within 0.2 of a percent using gamma distribution in R

Carrying out enough simulations of an experiment in gamma distribution, how can I find an answer to be accurate to within 0.2 of a percent. (my answer is in the form of a percentage)
user3543192
  • 109
  • 1
  • 3
1
vote
1 answer

How to find log likelihood of Gamma, Log normal and Weibull?

I want to find the log likelihood of data given Gamma, Weibull and Log normal distributions in R. How do I proceed given that I have already estimated the parameters of the respective distributions?
user3309969
  • 55
  • 2
  • 6
1
vote
1 answer

rgamma function in R: scale as a vector

I'm trying to draw samples from Gamma distribution but I'm considering the 'scale' argument of rgamma as a vector because each sample unit has different scale parameters. I'd like to know what is the rule of this function to choose the values of the…
plb
  • 43
  • 1
  • 7
0
votes
1 answer

Matlab gamfit and gampdf functions written in C++

I am wondering if someone has already implemented the two Matlab functions gamfit and gampdf in C, C++ or objective-C. I figured I would ask before I go ahead and implement them myself.
exolaris
  • 27
  • 3
  • 9
0
votes
0 answers

Newey West Standard error adjustment in GLM

I am trying to solve this problem since weeks now and I am a little desperate. I am new to R so please be patient with me. Thus, help is highly appreciated! Here is the thing: I am running a regression discontinuity in time analysis. I have a gamma…