Extreme Optimization™: Complexity made simple.

Math and Statistics
Libraries for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Partners
    • Contact us
Introduction
Deployment Guide
Nuget packages
Configuration
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Data Analysis Library User's GuideData Analysis Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand Data Access Library User's GuideData Access Library User's Guide
Expand ReferenceReference

Skip Navigation LinksHome»Documentation»Statistics Library User's Guide»Continuous Distributions»The Transformed Gamma Distribution

The Transformed Gamma Distribution

Extreme Optimization Numerical Libraries for .NET Professional

The transformed gamma distribution can be used to model the time until an event occurs a specified number of times. For example, if a system has n-1 backups all with identical exponential distributions, then the time until the original system and all its backups have failed can be modeled using a gamma distribution. From this example, it is obvious that the exponential distribution is a special case of the gamma distribution.

The transformed gamma distribution has two shape parameters and a scale parameter. The probability density function is:

Probability density of the transformed gamma distribution.

The transformed gamma distribution defines a rich family of distributions. Special values of the parameters result in a variety of well-known distributions:

  • The The Weibull Distribution when a = 1.

  • The The Gamma Distribution when b = 1.

  • The The Exponential Distribution when a = 1 and b = 1.

The transformed gamma distribution is implemented by the TransformedGammaDistribution class. It has one constructor that takes three arguments. The first and second are the two shape parameters. The third is the scale parameter.

The following constructs a transformed gamma distribution with shape parameters 4.2 and 3, and scale parameter 1:

C#
VB
C++
F#
Copy
var trgamma1 = new TransformedGammaDistribution(4.2, 3.0, 1.0);
Dim trgamma1 = New TransformedGammaDistribution(4.2, 3.0, 1.0)

No code example is currently available or this language may not be supported.

let trgamma1 = TransformedGammaDistribution(4.2, 3.0, 1.0)

The TransformedGammaDistribution class has three specific properties, ShapeParameter1, ShapeParameter2, and ScaleParameter, which return the shape and scale parameters of the distribution.

TransformedGammaDistribution has one static (Shared in Visual Basic) method, Sample, which generates a random sample using a user-supplied uniform random number generator. It takes fourth parameters. The first argument is the random number generator. The second to fourth parameters are the two shape parameters and the scale parameter of the distribution.

C#
VB
C++
F#
Copy
var random = new MersenneTwister();
double sample = TransformedGammaDistribution.Sample(random, 4.2, 3.0, 1.0);
Dim random = New MersenneTwister()
Dim sample = TransformedGammaDistribution.Sample(random, 4.2, 3.0, 1.0)

No code example is currently available or this language may not be supported.

let random = MersenneTwister()
let sample = TransformedGammaDistribution.Sample(random, 4.2, 3.0, 1.0)

The above example uses the MersenneTwister to generate uniform random numbers.

For details of the properties and methods common to all continuous distribution classes, see the topic on continuous distributions.

Copyright (c) 2004-2023 ExoAnalytics Inc.

Send comments on this topic to support@extremeoptimization.com

Copyright © 2004-2023, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.