Repository navigation
Module_Statistics_Distribution
Location: Home / Statistics module / Distribution
Vorcyc.Mathematics.Statistics.Distribution is a class that provides methods for computing various probability distributions, including normal, Poisson, exponential, binomial, multinomial, Gamma, and Beta distributions.
All methods below are located in class: Vorcyc.Mathematics.Statistics.Distribution
📒Contents
- 🔖 NormalPDF method
- 🔖 NormalCDF method
- 🔖 PoissonPMF method
- 🔖 PoissonCDF method
- 🔖 ExponentialPDF method
- 🔖 ExponentialCDF method
- 🔖 BinomialPMF method
- 🔖 BinomialCDF method
- 🔖 MultinomialPMF method
- 🔖 GammaPDF method
- 🔖 GammaCDF method
- 🔖 BetaPDF method
- 🔖 BetaCDF method
Vorcyc.Mathematics.Statistics.Distribution is a class that provides methods for computing various probability distributions, including normal, Poisson, exponential, binomial, multinomial, Gamma, and Beta distributions.
-
public static T NormalPDF<T>(T x, T mean, T stdDev) where T : IFloatingPointIeee754<T>- Computes the probability density function of the normal distribution.
- Parameters:
-
x: The variable value. -
mean: The mean. -
stdDev: The standard deviation.
-
- Returns: The probability density value of the normal distribution.
-
public static T NormalCDF<T>(T x, T mean, T stdDev) where T : IFloatingPointIeee754<T>- Computes the cumulative distribution function of the normal distribution.
- Parameters:
-
x: The variable value. -
mean: The mean. -
stdDev: The standard deviation.
-
- Returns: The cumulative distribution value of the normal distribution.
-
public static T PoissonPMF<T>(int k, T lambda) where T : IFloatingPointIeee754<T>- Computes the probability mass function of the Poisson distribution.
- Parameters:
-
k: The number of event occurrences. -
lambda: The average rate of events per unit time.
-
- Returns: The probability mass value of the Poisson distribution.
-
public static T PoissonCDF<T>(int k, T lambda) where T : IFloatingPointIeee754<T>- Computes the cumulative distribution function of the Poisson distribution.
- Parameters:
-
k: The number of event occurrences. -
lambda: The average rate of events per unit time.
-
- Returns: The cumulative distribution value of the Poisson distribution.
-
public static T ExponentialPDF<T>(T x, T lambda) where T : IFloatingPointIeee754<T>- Computes the probability density function of the exponential distribution.
- Parameters:
-
x: The variable value. -
lambda: The distribution parameter.
-
- Returns: The probability density value of the exponential distribution.
-
public static T ExponentialCDF<T>(T x, T lambda) where T : IFloatingPointIeee754<T>- Computes the cumulative distribution function of the exponential distribution.
- Parameters:
-
x: The variable value. -
lambda: The distribution parameter.
-
- Returns: The cumulative distribution value of the exponential distribution.
-
public static T BinomialPMF<T>(int k, int n, T p) where T : IFloatingPointIeee754<T>- Computes the probability mass function of the binomial distribution.
- Parameters:
-
k: The number of successes. -
n: The total number of trials. -
p: The probability of success on each trial.
-
- Returns: The probability mass value of the binomial distribution.
-
public static T BinomialCDF<T>(int k, int n, T p) where T : IFloatingPointIeee754<T>- Computes the cumulative distribution function of the binomial distribution.
- Parameters:
-
k: The number of successes. -
n: The total number of trials. -
p: The probability of success on each trial.
-
- Returns: The cumulative distribution value of the binomial distribution.
-
public static T MultinomialPMF<T>(int[] counts, T[] probabilities) where T : IFloatingPointIeee754<T>- Computes the probability mass function of the multinomial distribution.
- Parameters:
-
counts: The count for each category. -
probabilities: The probability for each category.
-
- Returns: The probability mass value of the multinomial distribution.
-
public static T GammaPDF<T>(T x, T shape, T scale) where T : IFloatingPointIeee754<T>- Computes the probability density function of the Gamma distribution.
- Parameters:
-
x: The variable value. -
shape: The shape parameter. -
scale: The scale parameter.
-
- Returns: The probability density value of the Gamma distribution.
-
public static T GammaCDF<T>(T x, T shape, T scale) where T : IFloatingPointIeee754<T>- Computes the cumulative distribution function of the Gamma distribution.
- Parameters:
-
x: The variable value. -
shape: The shape parameter. -
scale: The scale parameter.
-
- Returns: The cumulative distribution value of the Gamma distribution.
-
public static T BetaPDF<T>(T x, T alpha, T beta) where T : IFloatingPointIeee754<T>- Computes the probability density function of the Beta distribution.
- Parameters:
-
x: The variable value. -
alpha: Shape parameter α. -
beta: Shape parameter β.
-
- Returns: The probability density value of the Beta distribution.
-
public static T BetaCDF<T>(T x, T alpha, T beta) where T : IFloatingPointIeee754<T>- Computes the cumulative distribution function of the Beta distribution.
- Parameters:
-
x: The variable value. -
alpha: Shape parameter α. -
beta: Shape parameter β.
-
- Returns: The cumulative distribution value of the Beta distribution.
The following example uses several methods from the Distribution class, with comments in the sample:
using System;
using Vorcyc.Mathematics.Statistics;
public class DistributionExample
{
public static void Main()
{
// Normal distribution example
double normalPDF = Distribution.NormalPDF(1.0, 0.0, 1.0);
double normalCDF = Distribution.NormalCDF(1.0, 0.0, 1.0);
Console.WriteLine($"Normal PDF: {normalPDF}, Normal CDF: {normalCDF}");
// Poisson distribution example
double poissonPMF = Distribution.PoissonPMF(3, 2.0);
double poissonCDF = Distribution.PoissonCDF(3, 2.0);
Console.WriteLine($"Poisson PMF: {poissonPMF}, Poisson CDF: {poissonCDF}");
// Exponential distribution example
double exponentialPDF = Distribution.ExponentialPDF(1.0, 1.0);
double exponentialCDF = Distribution.ExponentialCDF(1.0, 1.0);
Console.WriteLine($"Exponential PDF: {exponentialPDF}, Exponential CDF: {exponentialCDF}");
// Binomial distribution example
double binomialPMF = Distribution.BinomialPMF(2, 5, 0.5);
double binomialCDF = Distribution.BinomialCDF(2, 5, 0.5);
Console.WriteLine($"Binomial PMF: {binomialPMF}, Binomial CDF: {binomialCDF}");
// Multinomial distribution example
int[] counts = { 2, 3, 1 };
double[] probabilities = { 0.2, 0.5, 0.3 };
double multinomialPMF = Distribution.MultinomialPMF(counts, probabilities);
Console.WriteLine($"Multinomial PMF: {multinomialPMF}");
// Gamma distribution example
double gammaPDF = Distribution.GammaPDF(2.0, 2.0, 2.0);
double gammaCDF = Distribution.GammaCDF(2.0, 2.0, 2.0);
Console.WriteLine($"Gamma PDF: {gammaPDF}, Gamma CDF: {gammaCDF}");
// Beta distribution example
double betaPDF = Distribution.BetaPDF(0.5, 2.0, 2.0);
double betaCDF = Distribution.BetaCDF(0.5, 2.0, 2.0);
Console.WriteLine($"Beta PDF: {betaPDF}, Beta CDF: {betaCDF}");
}
}-
- 🔖 ArrayExtension class
- 🔖 BaseConverter class
- 🔖 BitMathExtension class
- 🔖 Combinatorics class
- 🔖 ConstantsFp32 class
- 🔖 NumberMapper class
- 🔖 PinnableArray<T> class
- 🔖 SimpleRNG_Fp32 and SimpleRNG_Fp64 classes
- 🔖 TrigonometryHelper class
- 🔖 VMath class
- 🔖 Pinned buffers (Buffers)
- 🔖 IPinnedBuffer<T> interface
- 🔖 POHBuffer<T> class
- 🔖 NativeBuffer<T> class
-
- 🔖 0.9 classifier walkthrough
- 🔖 KNN<T> class
- 🔖 MultipleLinearRegression<T> class
- 🔖 SimpleLinearRegression<T> class
- 🔖 SupportVectorMachine<TSelf> class
- 🔖 DBSCAN<T> class
- 🔖 ExpectationMaximization<T> class
- 🔖 GMM<T> class
- 🔖 HierarchicalClustering<T> class
- 🔖 KMeansClusterer<T> class
- 🔖 VectorQuantization<T> class
- 🔖 FactorAnalysis<T> class
- 🔖 PCA<TSelf> class
- 🔖 TSNE<T> class
- 🔖 Distance metric classes
-
📒 Examples
-
📒 GPU 策略说明
- 🔖 为何放弃主包 GPU
- 🔖 当前性能路径
- 🔖 若仍需要更强算力
-
📒 计算上下文模块
-
📒 核心模块
-
📒 深度学习模块
-
📒 线性代数模块
-
📒 机器学习模块
- 🔖 0.9 分类器完整示例
- 🔖 KNN<T> 类
- 🔖 MultipleLinearRegression<T> 类
- 🔖 SimpleLinearRegression<T> 类
- 🔖 SupportVectorMachine<TSelf> 类
- 🔖 DBSCAN<T> 类
- 🔖 ExpectationMaximization<T> 类
- 🔖 GMM<T> 类
- 🔖 HierarchicalClustering<T> 类
- 🔖 KMeansClusterer<T> 类
- 🔖 VectorQuantization<T> 类
- 🔖 FactorAnalysis<T> 类
- 🔖 PCA<TSelf> 类
- 🔖 TSNE<T> 类
- 🔖 距离度量类
-
📒 信号处理模块
-
📒 数值模块
-
📒 统计模块
- 🔖 基础统计函数
- 🔖 高级统计函数
- 🔖 稳健统计 / RunningMoments
- 🔖 其它统计函数
- 🔖 分布相关函数
- 🔖 时间序列分析
- 🔖 IComparable 扩展
- 🔖 ExtremeValueFinder
- 🔖 INumber 扩展
-
📒 FFTW 扩展
-
📒 示例