library.stat
Submodule¶
Module Summary¶
Interfaces for the NAG Mark 30.3 stat Chapter.
stat
- Simple Calculations on Statistical Data
This module covers the following topics:
descriptive statistics and exploratory data analysis;
statistical distribution functions and their inverses;
testing for Normality and other distributions.
See Also¶
naginterfaces.library.examples.stat
:This subpackage contains examples for the
stat
module. See also the Examples subsection.
Functionality Index¶
Descriptive statistics / Exploratory analysis
summaries
frequency / contingency table
one variable:
frequency_table()
two variables, with and Fisher’s exact test:
contingency_table()
mean, variance, skewness, kurtosis (one variable)
combine summaries:
summary_onevar_combine()
from frequency table:
summary_freq()
from raw data:
summary_onevar()
mean, variance, sums of squares and products (two variables):
summary_2var()
median, hinges / quartiles, minimum, maximum:
five_point_summary()
quantiles
approximate
large data stream of fixed size:
quantiles_stream_fixed()
large data stream of unknown size:
quantiles_stream_arbitrary()
unordered vector
unweighted:
quantiles()
rolling window
mean, standard deviation (one variable):
moving_average()
Distributions
vectorized deviates:
inv_cdf_chisq_vector()
vectorized probabilities:
prob_chisq_vector()
Beta
central
deviates
scalar:
inv_cdf_beta()
vectorized:
inv_cdf_beta_vector()
probabilities and probability density function
scalar:
prob_beta()
vectorized:
prob_beta_vector()
non-central
probabilities:
prob_beta_noncentral()
binomial
distribution function
scalar:
prob_binomial()
vectorized:
prob_binomial_vector()
Dickey–Fuller unit root test
probabilities:
prob_dickey_fuller_unit()
Durbin–Watson statistic
probabilities:
prob_durbin_watson()
energy loss distributions
Landau
density:
pdf_landau()
derivative of density:
pdf_landau_deriv()
distribution:
prob_landau()
first moment:
pdf_landau_moment1()
inverse distribution:
inv_cdf_landau()
second moment:
pdf_landau_moment2()
Vavilov
central
deviates
scalar:
inv_cdf_f()
vectorized:
inv_cdf_f_vector()
probabilities
scalar:
prob_f()
vectorized:
prob_f_vector()
non-central
probabilities:
prob_f_noncentral()
gamma
deviates
scalar:
inv_cdf_gamma()
vectorized:
inv_cdf_gamma_vector()
probabilities
scalar:
prob_gamma()
vectorized:
prob_gamma_vector()
probability density function
scalar:
pdf_gamma()
vectorized:
pdf_gamma_vector()
Hypergeometric
distribution function
scalar:
prob_hypergeom()
vectorized:
prob_hypergeom_vector()
Kolomogorov–Smirnov
probabilities
one-sample:
prob_kolmogorov1()
two-sample:
prob_kolmogorov2()
Normal
bivariate
probabilities:
prob_bivariate_normal()
multivariate
probabilities:
prob_multi_normal()
probability density function
vectorized:
pdf_multi_normal_vector()
quadratic forms
cumulants and moments:
moments_quad_form()
moments of ratios:
moments_ratio_quad_forms()
univariate
deviates
scalar:
inv_cdf_normal()
vectorized:
inv_cdf_normal_vector()
probabilities
scalar:
prob_normal()
vectorized:
prob_normal_vector()
probability density function
scalar:
pdf_normal()
vectorized:
pdf_normal_vector()
reciprocal of Mill’s Ratio:
mills_ratio()
Shapiro and Wilk’s test for Normality:
test_shapiro_wilk()
Poisson
distribution function
scalar:
prob_poisson()
vectorized:
prob_poisson_vector()
Student’s
central
bivariate
probabilities:
prob_bivariate_students_t()
multivariate
probabilities:
prob_multi_students_t()
univariate
deviates
scalar:
inv_cdf_students_t()
vectorized:
inv_cdf_students_t_vector()
probabilities
scalar:
prob_students_t()
vectorized:
prob_students_t_vector()
non-central
probabilities:
prob_students_t_noncentral()
Studentized range statistic
deviates:
inv_cdf_studentized_range()
probabilities:
prob_studentized_range()
von Mises
probabilities:
prob_vonmises()
central
deviates:
inv_cdf_chisq()
probabilities:
prob_chisq()
probability of linear combination:
prob_chisq_lincomb()
non-central
probabilities:
prob_chisq_noncentral()
probability of linear combination:
prob_chisq_noncentral_lincomb()
Scores
Normal scores
accurate:
normal_scores_exact()
approximate:
normal_scores_approx()
variance-covariance matrix:
normal_scores_var()
Normal scores, ranks or exponential (Savage) scores:
ranks_and_scores()
For full information please refer to the NAG Library document
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g01/g01intro.html
Examples¶
- naginterfaces.library.examples.stat.moving_average_ex.main()[source]¶
Example for
naginterfaces.library.stat.moving_average()
.Calculate the mean and, optionally, the standard deviation using a rolling window for an arbitrary sized data stream.
>>> main() naginterfaces.library.stat.moving_average Python Example Results. Spencer's 15-point moving average for the change in rate of the Earth's rotation between 1821 and 1850. Interval Mean Std. Dev. -------------------------------------- [ 1, 15] -427.6 - [ 2, 16] -332.5 - [ 3, 17] -337.1 - [ 4, 18] -438.2 - [ 5, 19] -604.4 - [ 6, 20] -789.4 - [ 7, 21] -935.4 - [ 8, 22] -990.6 - [ 9, 23] -927.1 - [ 10, 24] -752.1 - [ 11, 25] -501.3 - [ 12, 26] -227.2 - [ 13, 27] 23.2 - [ 14, 28] 236.2 - [ 15, 29] 422.4 - [ 16, 30] 604.2 - Total number of observations: 30 Length of window: 15