StatisticalTools plugin - Sample Estimators, Probability Density Functions, Cumulative Density Functions, Quantile functions… - Messages
Just a seed for statistical purposes

Plugin handles primitives listed below:
Sample Estimators
Mean("matrix") - Returns the arithmetic mean from a sample.
GeometricMean("matrix") - Returns the geometric mean from a sample.
HarmonicMean("matrix") - Returns the harmonic mean from a sample.
WeightedMean("1:matrix", "2:matrix") - Returns the weighted arithmetic mean from a sample "1:matrix" and a corresponding weight "2:matrix".
Median("matrix") - Returns the median value from a sample.
Mode("matrix") - Returns the mode value from a sample.
Mode("1:matrix", "2:variable") - Returns the mode value from a sample and the number of occourrences.
Moment("1:matrix", "2:number") - Returns the "2:number"th central moment of a sample "1:matrix".
StdDev("matrix") - Returns the unbiased standard deviation from a sample "1:matrix".
Variance("matrix") - Returns the unbiased variance from a sample "1:matrix".
Skewness("matrix") - Returns the g₁ skewness from a sample (biased).
Kurtosis("matrix") - Returns the β₂ kurtosis from a sample.
KurtosisExcess("matrix") - Returns the γ₂ kurtosis excess from a sample.
Intercept("1:matrix", "2:matrix") - Returns the intercept of the straight line given by a simple linear regression from a data points "1:matrix","2:matrix".
Slope("1:matrix", "2:matrix") - Returns the slope of the straight line given by a simple linear regression from a data points "1:matrix","2:matrix".
Probability Density Functions
pdf.Binomial("1:number", "2:number") - Returns the Binomial pdf of k successes with "1:number" trials and "2:number" success probability ∈[0;1] in each trial.
pdf.Binomial("1:number", "2:number", "3:number") - Returns the Binomial pdf value of "1:number" successes with "2:number" trials and "3:number" success probability ∈[0;1] in each trial.
pdf.Cauchy("variable") - Returns the Standard Cauchy pdf (x.0 = 0 and γ = 1) evaluated in "1:variable" points.
pdf.Cauchy("1:variable", "2:number", "3:number") - Returns the Cauchy pdf evaluated in "1:variable" points, using assigned "2:number" location parameter and the "3:number" scale parameter.
pdf.ChiSquare("variable") - Returns the Χ² single degree of freedom pdf evaluated in "1:variable" points.
pdf.ChiSquare("1:variable", "2:number") - Returns the Χ² pdf evaluated in "1:variable" points, using assigned "2:number" degrees of freedom.
pdf.Exponential("variable") - Returns the Standard Exponential pdf (λ = 1) evaluated in "1:variable" points.
pdf.Exponential("1:variable", "2:number") - Returns the Exponential pdf in "1:variable" points, using assigned "2:number" rate parameter.
pdf.F("variable") - Returns the Fisher-Snedecor F single degree of freedom pdf evaluated in "1:variable".
pdf.F("1:variable", "2:number", "3:number") - Returns the Fisher-Snedecor F pdf evaluated in "1:variable" points, using assigned "2:number" numerator and "3:number" denominator degrees of freedom.
pdf.Geometric("1:variable", "2:number") - Returns the Geometric pdf of failures until the first success, for "1:variable" trials ∈[0;n] and single trial success probability "2:number" ∈(0;1].
pdf.GeometricShifted("1:variable", "2:number") - Returns the Geometric pdf used for modeling the number of trials until the first success, for "1:variable" trials ∈[1;n] and single trial success probability "2:number" ∈(0;1].
pdf.Normal("variable") - Returns the Standard Normal pdf (null mean and unitary standard deviation) evaluated in "1:variable" points.
pdf.Normal("1:variable", "2:number") - Returns the Normal pdf evaluated in "1:variable" points, using assigned "2:number" mean and unitary standard deviation.
pdf.Normal("1:variable", "2:number", "3:number") - Returns the Normal pdf evaluated in "1:variable" points, using assigned "2:number" mean and "3:number" as standard deviation.
pdf.Poisson("variable") - Returns the Standard Poisson pdf (λ = 1) evaluated in "1:variable" points.
pdf.Poisson("1:variable", "2:number") - Returns the Poisson pdf evaluated in "1:variable" points, using assigned "2:number" as expected value.
pdf.Rayleigh("variable") - Returns the Standard Rayleigh pdf (σ = 1) evaluated in "1:variable" points.
pdf.Rayleigh("1:variable", "2:number") - Returns the Rayleigh pdf evaluated in "1:variable" points, using assigned "2:number" as standard deviation.
pdf.t("variable") - Returns the Student's t single degree of freedom pdf evaluated in "1:variable" points.
pdf.t("1:variable", "2:number") - Returns the Student's t pdf evaluated in "1:variable" points, using assigned "2:number" degrees of freedom.
pdf.Uniform("1:variable", "2:number", "3:number") - Returns the Uniform Continuous pdf evaluated in "1:variable" points, inside the ["2:number","3:number"] interval of values.
pdf.UniformDiscrete("1:variable", "2:number", "3:number") - Returns the Uniform Discrete pdf evaluated in "1:variable" points, inside the ["2:number","3:number"] interval of values.
pdf.Weibull("variable") - Returns the Standard Weibull pdf (λ = 1 and k = 1) evaluated in "1:variable" points.
pdf.Weibull("1:variable", "2:number", "3:number") - Returns the Weibull pdf evaluated in "1:variable" points, using assigned "2:number" scale parameter and the "3:number" shape parameter.
Cumulative Density Functions
CDF.Binomial("1:number", "2:number") - Returns the Binomial CDF of k successes with "1:number" trials and "2:number" success probability ∈[0;1] in each trial.
CDF.Binomial("1:number", "2:number", "3:number") - Returns the Binomial CDF value of "1:number" successes with "2:number" trials and "3:number" success probability ∈[0;1] in each trial.
CDF.Cauchy("variable") - Returns the Standard Cauchy CDF (x.0 = 0 and γ = 1) evaluated in "1:variable" points.
CDF.Cauchy("1:variable", "2:number", "3:number") - Returns the Cauchy CDF evaluated in "1:variable" points, using assigned "2:number" location parameter and the "3:number" scale parameter.
CDF.ChiSquare("variable") - Returns the Χ² single degree of freedom CDF evaluated in "1:variable" points.
CDF.ChiSquare("1:variable", "2:number") - Returns the Χ² CDF evaluated in "1:variable" points, using assigned "2:number" degrees of freedom.
CDF.Exponential("variable") - Returns the Standard Exponential CDF (λ = 1) evaluated in "1:variable" points.
CDF.Exponential("1:variable", "2:number") - Returns the Exponential CDF evaluated in "1:variable" points, using assigned "2:number" rate parameter.
CDF.F("variable") - Returns the Fisher-Snedecor F single degree of freedom CDF evaluated in "1:variable".
CDF.F("1:variable", "2:number", "3:number") - Returns the Fisher-Snedecor F CDF evaluated in "1:variable" points, using assigned "2:number" numerator and "3:number" denominator degrees of freedom.
CDF.Geometric("1:variable", "2:number") - Returns the Geometric CDF of failures until the first success, for "1:variable" trials ∈[0;n] and single trial success probability "2:number" ∈(0;1].
CDF.GeometricShifted("1:variable", "2:number") - Returns the Geometric Shifted CDF used for modeling the number of trials until the first success, for "1:variable" trials ∈[1;n] and single trial success probability "2:number" ∈(0;1].
CDF.Normal("variable") - Returns the Standard Normal CDF (null mean and unitary standard deviation) evaluated in "1:variable" points.
CDF.Normal("1:variable", "2:number") - Returns the Normal CDF evaluated in "1:variable" points, using assigned "2:number" mean and unitary standard deviation.
CDF.Normal("1:variable", "2:number", "3:number") - Returns the Normal CDF evaluated in "1:variable" points, using assigned "2:number" mean and "3:number" as standard deviation.
CDF.Poisson("variable") - Returns the Standard Poisson CDF (λ = 1) evaluated in "1:variable" points.
CDF.Poisson("1:variable", "2:number") - Returns the Poisson CDF evaluated in "1:variable" points, using assigned "2:number" as expected value.
CDF.Rayleigh("variable") - Returns the Standard Rayleigh CDF (σ = 1) evaluated in "1:variable" points.
CDF.Rayleigh("1:variable", "2:number") - Returns the Rayleigh CDF evaluated in "1:variable" points, using assigned "2:number" as standard deviation.
CDF.t("variable") - Returns the Student's t single degree of freedom CDF evaluated in "1:variable" points.
CDF.t("1:variable", "2:number") - Returns the Student's t CDF evaluated in "1:variable" points, using assigned "2:number" degrees of freedom.
CDF.Uniform("1:variable", "2:number", "3:number") - Returns the Uniform Continuous CDF evaluated in "1:variable" points, inside the ["2:number","3:number"] interval of values.
CDF.UniformDiscrete("1:variable", "2:number", "3:number") - Returns the Uniform Discrete CDF evaluated in "1:variable" points, inside the ["2:number","3:number"] interval of values.
CDF.Weibull("variable") - Returns the Standard Weibull CDF (λ = 1 and k = 1) evaluated in "1:variable" points.
CDF.Weibull("1:variable", "2:number", "3:number") - Returns the Weibull CDF evaluated in "1:variable" points, using assigned "2:number" scale parameter and the "3:number" shape parameter.
Quantile functions
ICDF.Binomial("1:number", "2:number", "3:number") - Returns the Binomial quantile function for "1:number" probability values ∈[0;1] with "2:number" trials and "3:number" success probability ∈[0;1] in each trial.
ICDF.Cauchy("variable") - Returns the Standard Cauchy quantile function (x.0 = 0 and γ = 1) evaluated for "1:variable" probability values ∈[0;1].
ICDF.Cauchy("1:variable", "2:number", "3:number") - Returns the Cauchy quantile function evaluated for "1:variable" probability values ∈[0;1], using assigned "2:number" location parameter and the "3:number" scale parameter.
ICDF.Exponential("variable") - Returns the Standard Exponential quantile function (λ = 1) evaluated for "1:variable" probability values ∈[0;1].
ICDF.ChiSquare("1:variable") - Returns the single degree of freedom Χ² quantile function evaluated for "1:variable" probability values ∈[0;1].
ICDF.ChiSquare("1:variable", "2:number") - Returns the single degree of freedom Χ² quantile function evaluated for "1:variable" probability values ∈[0;1], using assigned "2:number" degrees of freedom.
ICDF.F("1:variable") - Returns the single degree of freedom Fisher-Snedecor F quantile function evaluated for "1:variable" probability values ∈[0;1].
ICDF.F("1:variable", "2:number", "3:number") - Returns the single degree of freedom Fisher-Snedecor F quantile function evaluated for "1:variable" probability values ∈[0;1], "2:number" numerator and "3:number" denominator degrees of freedom.
ICDF.Exponential("1:variable", "2:number") - Returns the Exponential quantile function evaluated for "1:variable" probability values ∈[0;1], using assigned "2:number" rate parameter.
ICDF.Geometric("1:variable", "2:number") - Returns the Geometric quantile function, for "1:variable" probability values ∈(0;1] to observe n successes with single trial probability "2:number" ∈(0;1].
ICDF.GeometricShifted("1:variable", "2:number") - Returns the Geometric Shifted quantile function used for modeling the number of trials until the first success, for "1:variable" probability values ∈(0;1] to observe n failures until the first success with single trial probability "2:number" ∈(0;1].
ICDF.Normal("variable") - Returns the Standard Normal quantile function (null mean and unitary standard deviation) evaluated for "1:variable" probability values ∈[0;1].
ICDF.Normal("1:variable", "2:number") - Returns the Normal quantile function evaluated for "1:variable" probability values ∈[0;1], using assigned "2:number" mean and unitary standard deviation.
ICDF.Normal("1:variable", "2:number", "3:number") - Returns the Normal quantile function evaluated for "1:variable" probability values, using assigned "2:number" mean and "3:number" as standard deviation.
ICDF.Poisson("variable") - Returns the Standard quantile function (λ = 1) evaluated for "1:variable" probability values.
ICDF.Poisson("1:variable", "2:number") - Returns the Poisson quantile function evaluated for "1:variable" probability values ∈[0;1], using assigned "2:number" as expected value.
ICDF.Rayleigh("variable") - Returns the Standard Rayleigh quantile function (σ = 1) evaluated for "1:variable" probability values ∈[0;1].
ICDF.Rayleigh("1:variable", "2:number") - Returns the Rayleigh quantile function evaluated for "1:variable" probability values ∈[0;1], using assigned "2:number" as standard deviation.
ICDF.t("1:variable") - Returns the Standard Student's t quantile function (ν = 1) evaluated for "1:variable" probability values ∈[0;1].
ICDF.t("1:variable", "2:number") - Returns the Student's t quantile function evaluated for "1:variable" probability values ∈[0;1], using assigned "2:number" degrees of freedom (ν).
ICDF.Uniform("1:variable", "2:number", "3:number") - Returns the Uniform Continuous quantile function evaluated for "1:variable" probability values ∈[0;1], inside the ["2:number","3:number"] interval of values.
ICDF.UniformDiscrete("1:variable", "2:number", "3:number") - Returns the Uniform Discrete quantile function evaluated for "1:variable" probability values ∈[0;1], inside the ["2:number","3:number"] interval of values.
ICDF.Weibull("variable") - Returns the Standard Weibull quantile function (λ = 1 and k = 1) evaluated for "1:variable" probability values ∈[0;1].
ICDF.Weibull("1:variable", "2:number", "3:number") - Returns the Weibull quantile function evaluated for "1:variable" probability values ∈[0;1], using assigned "2:number" scale parameter and the "3:number" shape parameter.
Random Numbers
Random("number") - Returns a vector containing "1:number" of random values between 0 and 1 with uniform distribution.
Random("1:number", "2:number") - Returns a "1:number" x "2:number" rectangular matrix containing random values between 0 and 1 with uniform distribution.
Random.N("1:number", "2:number") - Returns a random value between "1:number" and "2:number" with uniform distribution. "1:number" and "2:number" must be between -2147483648 and 2147483646.
Random.N("1:number", "2:number", "3:number") - Returns a vector containing "1:number" of random values between "2:number" and "3:number" with uniform distribution. "2:number" and "3:number" must be between -2147483648 and 2147483646.
Random.N("1:number", "2:number", "3:number", "4:number") - Returns a "1:number" x "2:number" rectangular matrix containing random values between "3:number" and "4:number" with uniform distribution. "3:number" and "4:number" must be between -2147483648 and 2147483646.
Tools
Beta("1:variable", "2:variable") - Returns the Beta function of "1:variable" and "2:variable" positive parameters.
BetaRegularized("1:variable", "2:variable", "3:variable") - Returns the Regularized Beta function evaluated in "1:variable" ∈[0;1], using "2:variable" and "3:variable" positive parameters.
GammaRegularized.P("1:variable", "2:variable") - Regularized Gamma function P(a,x):γ(a,x)/Γ(a).
GammaRegularized.Q("1:variable", "2:variable") - Regularized Gamma function Q(a,x):Γ(a,x)/Γ(a).
Dirac("variable") - Dirac delta function, evaluated in "1:variable" points.
Dirac("1:variable", "2:number") - Dirac delta function, evaluated in "1:variable" points and shifted in the "2:number" point.
erf("variable") - Approximated error function (Abramowitz and Stegun - max error: 1.5E-7), evaluated in "1:variable" points.
erf("1:variable", "2:number") - Approximated error function (Abramowitz and Stegun - max error: 1.5E-7), evaluated in "1:variable" points and shifted in the "2:number" point.
erfc("variable") - Approximated complementary error function (Abramowitz and Stegun - max error: 1.5E-7), evaluated in "1:variable" points.
erfc("1:variable", "2:number") - Approximated complementary error function (Abramowitz and Stegun - max error: 1.5E-7), evaluated in "1:variable" points and shifted in the "2:number" point.
erfinv("variable") - Approximated inverse error function, evaluated in "1:variable" points.
Heaviside("variable") - Heaviside step function, evaluated in "1:variable" points.
Heaviside("1:variable", "2:number") - Heaviside step function, evaluated in "1:variable" points and shifted in the "2:number" point.
Heaviside.D("variable") - Discrete Heaviside step function, evaluated in "1:variable" points.
Heaviside.D("1:variable", "2:number") - Discrete Heaviside step function, evaluated in "1:variable" points and shifted in the "2:number" point.
Ceil("variable") - Ceil function. Returns the smallest integer greater than or equal to "1:variable".
Floor("variable") - Floor function. Returns the largest integer less than or equal to "1:variable".
PLEASE REPORT HERE ANY ISSUE.
requirements: .Net Framework 3.5 (Windows) / Mono 2.0 (Linux) / SMath Studio 0.97.5581
installation: Tools > Plugins > change "Local Storage" to "Online Gallery" > Statistical Tools
sources: if you want to see the plugin sources, look in the SVN repository.
embedded plugins: Meta Numerics library 2.2.1.0 (website, license)
StatisticalTools_docs.zip (34 KiB) downloaded 560 time(s).
I remained almost speechless by seeing this




Have no words to express my gratitude for this plugin

Just hope that the inverse cumulative distributions would be applied as well.
Just one suggestion if you would not mind. There is a naming convention in Mathcad and R ("lingua franca" for statistics).
pdf (probability density starts with d - like dnorm)
cdf (cumulative probability function starts with p - like pnorm)
inverse cdf (inverse cumulative probability function starts with q - like qnorm)
random numbers from a distribution starting with r - like rnorm
Regards,
Radovan
EDIT: Maybe redundant to say, but besides normal there are t-student, chi-squared and F which are "must have" continuous distributions.
thank you for the great work. I just got one question. As far as I understand, the Mode function gives the value (or a vector of values) with the highest number of occurences in a dataset.
Then, in the following the result should be a vector of (1 2 3 5) with 4 occurences.
[MATH lang=ENG]Mode(mat(1,3,5,1,6,2,3,2,5,2,3,5,5,2,1,3,4,1,3,6),1)=mat(mat(5,1,1),mat(2,1,1),2,1)@#[/MATH]
Best regards, Martin
BTW, I like the smart handling of vector arguments in functions!
WroteHello w3b5urf3r,
thank you for the great work. I just got one question. As far as I understand, the Mode function gives the value (or a vector of values) with the highest number of occurences in a dataset.
Then, in the following the result should be a vector of (1 2 3 5) with 4 occurences.
[MATH lang=ENG]Mode(mat(1,3,5,1,6,2,3,2,5,2,3,5,5,2,1,3,4,1,3,6),1)=mat(mat(5,1,1),mat(2,1,1),2,1)@#[/MATH]
Best regards, Martin
BTW, I like the smart handling of vector arguments in functions!
Thank you Martin, I've lost 2 lines of code cleaning the sources...
fixed & updated

best regards
w3b5urf3r
some minor doc issues:
in pdf.sm, the doc for pdf.uniform needs a little correction:
[MATH lang=ENG]f(x,a,b):line(if(a>b,line(swap:a,a:b,b:swap,3,1),0),if((x≥a)&(x≤b),1/{b-a},0),2,1)[/MATH]
Also, the pdf.Rayleigh(2) and cdf.Rayleigh(2) help strings seem to have a copy-paste error.
Best regards, Martin
I would kindly ask you to insert into this plugin at least intercept(x,y) and slope(x,y) functions for calculating the least square intercept and slope of a straight line giving two data vectors.
Regards,
Radovan
WroteHello w3b5urf3r,
I would kindly ask you to insert into this plugin at least intercept(x,y) and slope(x,y) functions for calculating the least square intercept and slope of a straight line giving two data vectors.
Regards,
Radovan
Ok :d .
WroteHello w3b5urf3r,
some minor doc issues:
in pdf.sm, the doc for pdf.uniform needs a little correction:
[MATH lang=ENG]f(x,a,b):line(if(a>b,line(swap:a,a:b,b:swap,3,1),0),if((x≥a)&(x≤b),1/{b-a},0),2,1)[/MATH]
Also, the pdf.Rayleigh(2) and cdf.Rayleigh(2) help strings seem to have a copy-paste error.
Best regards, Martin
Done, will be available in the next relase

regards,
w3b5urf3r
- added more tools: Regularized Beta function, Regularized Gamma functions (P and Q), Ceil, Floor, error function, inverse error function;
- added more estimators: Kurtosis, Kurtosis Excess, Moment, Skewness, Intercept, Slope;
- added more probability distributions: Student's t, Fisher-Snedecor, Chi-squared, Cauchy;
- added quantiles (all distributions except Student's t, Fisher-Snedecor and Chi-squared).
best regards,
w3b5urf3r
Many thanks for this plugin

Just played a bit, and have seen a problem with CDF.ChiSquare( "variable" )-(image attached). Did not quite understand why this problem appear at the moment. Also, do not quite understand what this description mean
CDF.ChiSquare( "variable" ) - Returns the Χ² sDOF CDF evaluated in "1:variable" points.
I suppose that sDOF means "single degree of freedom"
Regards,
Radovan
WroteHello w3b5urf3r,
Many thanks for this plugin.
Just played a bit, and have seen a problem with CDF.ChiSquare( "variable" )-(image attached). Did not quite understand why this problem appear at the moment. Also, do not quite understand what this description mean
CDF.ChiSquare( "variable" ) - Returns the Χ² sDOF CDF evaluated in "1:variable" points.
I suppose that sDOF means "single degree of freedom"
Regards,
Radovan
:d seem that some eval() in the Reguarized Gamma functions it's stricly necessary for some value.... fixed and updated

You supposed right :-p Now I've extended the acronym

EDIT: plugin updated again (Mean and StdDev names)
regards,
w3b5urf3r
I wonder why all of the functions inside plugin are not in a separate function category. They are inside "Matrix and vector" function category now.
Not so important at the moment, I am just curious

Regards,
Radovan
P.S. I am looking forward to the missing ICDF's


WroteHello w3b5urf3r,
I wonder why all of the functions inside plugin are not in a separate function category. They are inside "Matrix and vector" function category now.
Not so important at the moment, I am just curious![]()
Regards,
Radovan
P.S. I am looking forward to the missing ICDF's![]()
![]()
Hi omorr,
I'd like to put them in a new category "Statistics" but I do not know if it is possible to expand the available categories through the plugin. Because all functions accept a vector as input i've grouped all as "matrix and vector".
About the missing ICDF I'm looking for a fast and accurate algorithm to compute each of them... if I find anything I will use a bisection algorithm

regards,
w3b5urf3r
I would be using this to create random white Gaussian noise to simulate measured/actual situations. For instance, Mathcad has the function rnorm() that does this.
Thank you, and I greatly appreciate SMath and am looking forward to transitioning to it once I understand it has all the capabilities I need.
WroteWill this plugin eventually have the ability to produce a random number from a normal or Gaussian distribution (rather than uniform distribution)?
I would be using this to create random white Gaussian noise to simulate measured/actual situations. For instance, Mathcad has the function rnorm() that does this.
Thank you, and I greatly appreciate SMath and am looking forward to transitioning to it once I understand it has all the capabilities I need.
Sure, soon or later...

best regards,
w3b5urf3r
- improvements of existing Random() functions (seed issues)
- Added a Guid (after the download an error should appear using worksheets created with the old plugin, just continue and save again the file)
- Sources are moved to the SVN server (there is a link in the first post)
best regards,
w3b5urf3r
Gamma.sm (8 KiB) downloaded 159 time(s).

WroteGamma(1) is a built-in function, don't know what's the issue
![]()
Sorry, I was tricked by the capital letter...
One more reason to mention the plugin in the description string in order to avoid such confusion. Sometimes I check plugin origin of a given function by switching off the guessed one and trying if I still get the function. As that is not really handy, I tend to be lazy just like in the given case :-(
At last...long awaited quantile functions

Best Regards,
Radovan
-
New Posts
-
No New Posts