PDF, CDF and Quantile functions

TO SUPPORT MY WORK, ORDER A COMMERCIAL LICENSE
THANK YOU!

Tutorial Math Collection API spec Download

Below is the code for JAVA, the code for C# is almost identical.

Case 1: Expected value estimation using Probability Distribution Function

$$X\sim N(2,4) \quad \text{E}X = \int_{\mathbb{R}} xp(x) \text{d}x = 2$$

import org.mariuszgromada.math.mxparser.*;
...
Expression e = new Expression("int( x * pNor(x, 2, 4), x, -18, 22)");
mXparser.consolePrintln("Res. : " + e.getExpressionString() + " = " + e.calculate());
[mXparser-v.5.0.0] Res. : int( x * pNor(x, 2, 4), x, -18, 22) = 1.9999986197331323

Case 2: Probability estimation using Cumulative Distribution Function – the law of 3*SIGMA

$$X\sim N(0,1) \quad P(-3 < X < 3)$$

import org.mariuszgromada.math.mxparser.*;
...
Expression e = new Expression("cNor(3,0,1) - cNor(-3,0,1)");
mXparser.consolePrintln("Res. : " + e.getExpressionString() + " = " + e.calculate());
[mXparser-v.5.0.0] Res. : cNor(3,0,1) - cNor(-3,0,1) = 0.9973002039367398

Case 3: Calculating quantiles using Inverse Cumulative Distribution Function – males height example assuming males height distribution N(170, 15)

$$X\sim N(170,15)$$

import org.mariuszgromada.math.mxparser.*;
...
Expression e = new Expression("qNor(0.9, 170, 15)");
mXparser.consolePrintln("Res. : " + e.getExpressionString() + " = " + e.calculate());
[mXparser-v.5.0.0] Res. : qNor(0.9, 170, 15) = 189.223273483169
Nuget
Install-Package MathParser.org-mXparser -Version 5.0.2
Maven
<dependency>
<groupid>org.mariuszgromada.math</groupid>
<artifactid>MathParser.org-mXparser</artifactid>
<version>5.0.2</version>
</dependency>
Gradle
implementation 'org.mariuszgromada.math:MathParser.org-mXparser:5.0.2'
Gradle (Kotlin)
implementation("org.mariuszgromada.math:MathParser.org-mXparser:5.0.2")
GitHub
git clone https://github.com/mariuszgromada/MathParser.org-mXparser
OTHER DOWNLOAD OPTIONS

Download latest release – v.5.0.2 Leonis: bin + docDownload latest release – v.5.0.2 Leonis: bin only, includes separate binaries for various .NET platforms and Java versions
Source code .zipSource code .tar.gz
View on GitHubMathSpace.pl

DONATION
Did you find the software useful?
Please consider donation 🙂
DONATE