Professional Documents
Culture Documents
Jstat Lybrary
Jstat Lybrary
html
Table Of Contents
Overview
Description
Architecture
Core Functionality
jStat()
rows()
rowa()
cols()
cola()
slice()
sliceAssign()
dimensions()
row()
col()
diag()
antidiag()
diagonal()
transpose()
map( func )
cumreduce( func )
alter( func )
create()
zeros()
ones()
rand()
copy()
identity()
seq()
arange()
clear()
symmetric()
jStat Utility Methods
utils.isArray( arg )
utils.isFunction( arg )
utils.isNumber( arg )
Vector Functionality
sum()
sumsqrd()
sumsqerr()
sumrow()
product()
min()
max()
mean()
meansqerr()
geomean()
median()
cumsum()
cumprod()
diff()
rank()
mode()
range()
variance()
pooledvariance()
deviation()
stdev()
pooledstdev()
meandev()
meddev()
skewness()
kurtosis()
coeffvar()
quartiles()
quantiles()
percentile()
percentileOfScore()
histogram()
covariance()
corrcoeff()
Distributions
jStat.chisquare( dof )
jStat.chisquare.pdf( x, dof )
jStat.chisquare.cdf( x, dof )
jStat.chisquare.inv( p, dof )
jStat.chisquare.mean( dof )
jStat.chisquare.median( dof )
jStat.chisquare.mode( dof )
jStat.chisquare.sample( dof )
jStat.chisquare.variance( dof )
jStat.exponential( rate )
jStat.exponential.pdf( x, rate )
jStat.exponential.cdf( x, rate )
jStat.exponential.inv( p, rate )
jStat.exponential.mean( rate )
jStat.exponential.median( rate )
jStat.exponential.mode( rate )
jStat.exponential.sample( rate )
jStat.exponential.variance( rate )
jStat.studentt( dof )
jStat.studentt.pdf( x, dof )
jStat.studentt.cdf( x, dof )
jStat.studentt.inv( p, dof )
jStat.studentt.mean( dof )
jStat.studentt.median( dof )
jStat.studentt.mode( dof )
jStat.studentt.sample( dof )
jStat.studentt.variance( dof )
jStat.uniform( a, b )
jStat.uniform.pdf( x, a, b )
jStat.uniform.cdf( x, a, b )
jStat.uniform.inv( p, a, b)
jStat.uniform.mean( a, b )
jStat.uniform.median( a, b )
jStat.uniform.mode( a, b )
jStat.uniform.sample( a, b )
jStat.uniform.variance( a, b )
jStat.binomial
jStat.binomial.pdf( k, n, p )
jStat.binomial.cdf( k, n, p )
jStat.negbin
jStat.negbin.pdf( k, r, p )
jStat.negbin.cdf( x, r, p )
jStat.hypgeom
jStat.hypgeom.pdf( k, N, m, n )
jStat.hypgeom.cdf( x, N, m, n )
jStat.poisson
jStat.poisson.pdf( k, l )
jStat.poisson.cdf( x, l )
jStat.poisson.sample( l )
jStat.triangular
jStat.triangular.pdf( x, a, b, c )
jStat.triangular.cdf( x, a, b, c )
jStat.triangular.mean( a, b, c )
jStat.triangular.median( a, b, c )
jStat.triangular.mode( a, b, c )
jStat.triangular.sample( a, b, c )
jStat.triangular.variance( a, b, c )
jStat.arcsine( a, b )
jStat.arcsine.pdf( x, a, b )
jStat.arcsine.cdf( x, a, b )
jStat.arcsine.inv(p, a, b)
jStat.arcsine.mean( a, b )
jStat.arcsine.median( a, b )
jStat.arcsine.mode( a, b )
jStat.arcsine.sample( a, b )
jStat.arcsine.variance( a, b )
Special Functions
betafn( x, y )
betaln( x, y )
betacf( x, a, b )
ibetainv( p, a, b)
ibeta( x, a, b)
gammafn( x )
gammaln( x )
gammap( a, x )
lowRegGamma(a, x)
gammapinv( p, a )
factorialln( n )
factorial( n )
combination( n, m )
permutation( n, m )
erf( x )
erfc( x )
erfcinv( p )
randn( n, m )
randg( shape, n, m )
Linear Algebra
Instance Functionality
add( arg )
subtract( arg )
divide( arg )
multiply( arg )
dot( arg )
pow( arg )
exp()
log()
abs()
norm()
angle( arg )
Static Functionality
outer( A, B )
exp( arr )
log( arr )
abs( arr )
norm( arr )
aug( A, B )
det( A )
inv( A )
gauss_elimination( A, B )
gauss_jordan( A, B )
lu( A )
cholesky( A )
gauss_jacobi( A, b, x, r )
gauss_seidel( A, b, x, r )
SOR( A, b, x, r, w )
householder( A )
QR( A )
lstsq( A, b )
jacobi()
rungekutta()
romberg()
richardson()
simpson()
hermite()
lagrange()
cubic_spline()
gauss_quadrature()
PCA()
Statistical Tests
Statistics Instance Functionality
tscore( value )
anovafscore()
anovaftest()
Static Methods
Z Statistics
jStat.qtest( qscore, n, k )
jStat.tukeyhsd( arrays )
Confidence Intervals
Overview
Description
jStat is a statistical library written in JavaScript that
allows you to perform advanced statistical operations
without the need of a dedicated statistical language (e.g.
MATLAB or R). It is available for download on Github.
Architecture
Calculations are done by static methods, while working
with groups of numbers is handled by the instance
methods. Here is a pseudo example of what is
happening in core.js :
jStat.prototype.min = function() {
var i = 0,
newval = [];
while( newval.push( jStat.min( this[i] )), ++i < this.length );
return newval;
}
jStat().create( 5, function( x, y ) {
return ( x + Math.random()) / ( y + Math.random());
}).min( true, function( x ) {
// do something with the min value
}).beta( 0.5, 0.5 ).pdf(); // generate and return the pdf
// of the beta function for all values
Core Functionality
Core functionality include methods that generate and
analyse vectors or matrices.
jStat()
The jStat object can function in several capacities, as
demonstrated below. In all cases, jStat will always return
an instance of itself.
jStat()
rows()
Returns the count of rows in a matrix.
rows( array )
fn.rows( [callback] )
});
rowa()
Returns a array from matrix row.
cols()
Returns the number of columns in a matrix.
cols( array )
fn.cols( [callback] )
cola()
Returns an array from matrix column ( col() will return a
matrix form instead of an array form).
slice()
Slices matrix as numpy style.
A=[[1,2,3],[4,5,6],[7,8,9]];
slice(A,{row:{end:2},col:{start:1}}) === [[2,3],[5,6]];
slice(A,1,{start:1}) === [5,6];
sliceAssign()
Do slice assign as numpy style.
A = [[1,2,3],[4,5,6],[7,8,9]];
sliceAssign(A,{row : {start : 1}, col : {start : 1}},[[0,0],[0,0]]);
A = [[1,2,3],[4,0,0],[7,0,0]];
dimensions()
Returns an object with the dimensions of a matrix.
dimensions( array )
fn.dimensions( [callback] )
row()
Returns a specified row of a matrix.
col()
Returns the specified column as a column vector.
col( index )
diag()
Returns the diagonal of a matrix.
diag( array )
fn.diag( [callback] )
});
antidiag()
Returns the anti-diagonal of the matrix.
antidiag( array )
fn.antidiag( [callback] )
diagonal()
Creates a new diagonal matrix by given 1d diag array.
transpose()
Transposes a matrix.
transpose( array )
fn.transpose( [callback] )
map( func )
Maps a function to all values and return a new object.
map( array, fn )
fn.map( fn )
cumreduce( func )
cumreduce( array, fn )
fn.cumreduce( fn )
alter( func )
Destructively maps to an array.
alter( array, fn )
fn.alter( fn )
create()
Creates a row by col matrix using the supplied function.
If col is omitted then it will default to value row .
zeros()
Creates a row by col matrix of all zeros. If col is omitted
then it will default to value row .
jStat.zeros( 2 );
// returns [[0,0],[0,0]]
jStat().zeros( 2 );
// returns jStat([[0,0],[0,0]])
ones()
Creates a row by col matrix of all ones. If col is omitted
then it will default to value row .
jStat.zeros( 2 );
// returns [[0,0],[0,0]]
jStat().ones( 2 );
// returns jStat([[0,0],[0,0]])
rand()
Creates a matrix of normally distributed random
numbers. If col is omitted then it will default to value
row .
jStat.rand( 3 );
jStat().rand( 3 );
copy()
Returns a copy of given matrix.
identity()
Creates an identity matrix of row by col. If col is omitted
then it will default to value row .
jStat.identity( 2 );
// returns [[1,0],[0,1]]
jStat().identity( 2 );
seq()
Creates an arithmetic sequence by given length.
arange()
Creates an arithmetic sequence by given step.
clear()
Sets all values in the vector or matrix to zero.
clear( array )
fn.clear( [callback] )
jStat( 0, 1, 3 ).clear();
// returns [[0,0,0]]
symmetric()
Tests if a matrix is symmetric.
symmetric( array )
fn.symmetric( [callback] )
jStat([[1,2],[2,1]]).symmetric(function( result ) {
// result === true
});
utils.isArray( arg )
Tests if arg is an array.
utils.isFunction( arg )
Tests if arg is a function.
utils.isNumber( arg )
Tests if arg is a number and not NaN .
Vector Functionality
sum()
sum( array )
jStat.sum([1,2,3]) === 6
sumsqrd()
sumsqrd( array )
jStat.sumsqrd([1,2,3]) === 14
jStat([[1,2],[3,4]]).sumsqrd(true,function( result ) {
// result === 650
});
sumsqerr()
sumsqerr( array )
jStat.sumsqerr([1,2,3]) === 2
// result === 55
});
jStat([[1,2],[3,4]]).sumsqerr(true,function( result ) {
// result === 0
});
sumrow()
sumrow( array )
jStat.sumrow([1,2,3]) === 6
jStat([[1,2],[3,4]]).sumrow(true,function( result ) {
// result === 10
});
product()
product( array )
jStat.product([1,2,3]) === 6
jStat([[1,2],[3,4]]).product(true,function( result ) {
// result === 24
});
min()
min( array )
jStat.min([1,2,3]) === 1
jStat([[1,2],[3,4]]).min(true,function( result ) {
// result === 1
});
max()
max( array )
jStat.max([1,2,3]) === 3
jStat([[1,2],[3,4]]).max(true,function( result ) {
// result === 4
});
mean()
mean( array )
jStat.mean([1,2,3]) === 2
fn.max( [bool,][callback] )
jStat([[1,2],[3,4]]).mean(true,function( result ) {
// result === 2.5
});
meansqerr()
meansqerr( array )
jStat([[1,2],[3,4]]).meansqerr(true,function( result ) {
// result === 0
});
geomean()
geomean( array )
jStat([4,1,1\32]).geomean(function( result ) {
// result === 0.5
});
jStat([[1,2],[3,4]]).geomean(true,function( result ) {
// result === 2.213...
});
median()
median( array )
jStat.median([1,2,3]) === 2
jStat([[1,2],[3,4]]).median(true,function( result ) {
// result === 2.5
});
cumsum()
cumsum( array )
jStat([[1,2],[3,4]]).cumsum(true,function( result ) {
// result === ...
});
cumprod()
cumprod( array )
jStat([[1,2],[3,4]]).cumprod(true,function( result ) {
// result === ...
});
diff()
diff( array )
jStat([[1,2],[3,4],[1,4]]).diff(function( result ) {
// result === [[2,-2],[2,0]]
});
jStat([[1,2],[3,4],[1,4]]).diff(true,function( result ) {
// result === [0,2]
});
rank()
rank( array )
mode()
mode( array )
jStat.mode([1,2,2,3]) === 2
jStat.mode([1,2,3]) === [1,2,3]
jStat([1,2,2,3]).mode() === 2
jStat([[1,2],[3,4],[1,4]]).mode() === [1,4]
range()
range( array )
jStat.range([1,2,3]) === 2
jStat([1,2,3]).range() === 2
jStat([[1,2],[3,4]]).range() === [2,2]
// result === 4
});
jStat([[1,2],[3,5]]).range(true,function( result ) {
// result === 1
});
variance()
variance( array[, flag] )
jStat([[1,2],[3,5]]).variance(true,function( result ) {
// result === 0.140625
});
pooledvariance()
pooledvariance( arrays )
deviation()
deviation( array )
jStat([[1,2],[3,5]]).deviation(true,function( result ) {
// result === [-0.5, 0.5, -1, 1]
});
stdev()
stdev( array[, flag] )
jStat([[1,2],[3,5]]).stdev(true,function( result ) {
// result === 0.25
});
pooledstdev()
pooledstdev( arrays )
meandev()
meandev( array )
jStat.meandev([1,2,3,4]) === 1
jStat([1,2,3,4]).meandev() === 1
jStat([[1,2],[3,4]]).meandev() === [1,1]
});
jStat([[1,2],[3,5]]).meandev(true,function( result ) {
// result === 0.25
});
meddev()
meddev( array )
jStat.meddev([1,2,3,4]) === 1
jStat([1,2,3,4]).meddev() === 1
jStat([[1,2],[3,4]]).meddev() === [1,1]
jStat([[1,2],[3,5]]).meddev(true,function( result ) {
// result === 0.25
});
skewness()
skewness( array )
kurtosis()
kurtosis( array )
coeffvar()
coeffvar( array )
jStat([[1,2],[3,5]]).coeffvar(true,function( result ) {
// result === 0.142...
});
quartiles()
quartiles( array )
fn.quartiles( [callback] )
jStat(1,100,100).quartiles(function( result ) {
// result === [25,50,75]
});
quantiles()
quantiles( dataArray, quantilesArray[, alphap[, betap]] )
jStat.quantiles([1, 2, 3, 4, 5, 6],
[0.25, 0.5, 0.75]) === [1.9375, 3.5, 5.0625]
percentile()
percentile( dataArray, k, [exclusive] )
percentileOfScore()
percentileOfScore( dataArray, score[, kind] )
histogram()
histogram( dataArray[, numBins] )
jStat.histogram([100, 101, 102, 230, 304, 305, 400], 3) === [3, 1, 3];
covariance()
covariance( array1, array2 )
corrcoeff()
corrcoeff( array1, array2 )
Distributions
jStat.chisquare( dof )
jStat.chisquare.pdf( x, dof )
Returns the value of x in the pdf of the Chi Square
distribution with dof degrees of freedom.
jStat.chisquare.cdf( x, dof )
Returns the value of x in the cdf of the Chi Square
distribution with dof degrees of freedom.
jStat.chisquare.inv( p, dof )
Returns the value of x in the inverse of the cdf for the
Chi Square distribution with dof degrees of freedom.
jStat.chisquare.mean( dof )
Returns the value of the mean for the Chi Square
distribution with dof degrees of freedom.
jStat.chisquare.median( dof )
Returns the value of the median for the Chi Square
distribution with dof degrees of freedom.
jStat.chisquare.mode( dof )
Returns the value of the mode for the Chi Square
distribution with dof degrees of freedom.
jStat.chisquare.sample( dof )
Returns a random number whose distribution is the Chi
Square distribution with dof degrees of freedom.
jStat.chisquare.variance( dof )
Returns the value of the variance for the Chi Square
distribution with dof degrees of freedom.
jStat.exponential( rate )
jStat.exponential.pdf( x, rate )
Returns the value of x in the pdf of the Exponential
distribution with the parameter rate (lambda).
jStat.exponential.cdf( x, rate )
Returns the value of x in the cdf of the Exponential
distribution with the parameter rate (lambda).
jStat.exponential.inv( p, rate )
Returns the value of p in the inverse of the cdf for the
Exponential distribution with the parameter rate
(lambda).
jStat.exponential.mean( rate )
Returns the value of the mean for the Exponential
distribution with the parameter rate (lambda).
jStat.exponential.median( rate )
Returns the value of the median for the Exponential
distribution with the parameter rate (lambda)
jStat.exponential.mode( rate )
Returns the value of the mode for the Exponential
distribution with the parameter rate (lambda).
jStat.exponential.sample( rate )
Returns a random number whose distribution is the
Exponential distribution with the parameter rate
(lambda).
jStat.exponential.variance( rate )
Returns the value of the variance for the Exponential
distribution with the parameter rate (lambda).
jStat.kumaraswamy.pdf( x, a, b )
Returns the value of x in the pdf of the Kumaraswamy
distribution with parameters a and b .
deviation).
jStat.studentt( dof )
jStat.studentt.pdf( x, dof )
Returns the value of x in the pdf of the Student's T
distribution with dof degrees of freedom.
jStat.studentt.cdf( x, dof )
Returns the value of x in the cdf of the Student's T
distribution with dof degrees of freedom.
jStat.studentt.inv( p, dof )
Returns the value of p in the inverse of the cdf for the
Student's T distribution with dof degrees of freedom.
jStat.studentt.mean( dof )
Returns the value of the mean of the Student's T
distribution with dof degrees of freedom.
jStat.studentt.median( dof )
Returns the value of the median of the Student's T
distribution with dof degrees of freedom.
jStat.studentt.mode( dof )
Returns the value of the mode of the Student's T
distribution with dof degrees of freedom.
jStat.studentt.sample( dof )
Returns a random number whose distribution is the
Student's T distribution with dof degrees of freedom.
jStat.studentt.variance( dof )
Returns the value of the variance for the Student's T
distribution with dof degrees of freedom.
jStat.uniform( a, b )
jStat.uniform.pdf( x, a, b )
Returns the value of x in the pdf of the Uniform
distribution from a to b .
jStat.uniform.cdf( x, a, b )
Returns the value of x in the cdf of the Uniform
distribution from a to b .
jStat.uniform.inv( p, a, b)
Returns the inverse of the uniform.cdf function; i.e. the
value of x for which uniform.cdf(x, a, b) == p .
jStat.uniform.mean( a, b )
Returns the value of the mean of the Uniform
distribution from a to b .
jStat.uniform.median( a, b )
Returns the value of the median of the Uniform
distribution from a to b .
jStat.uniform.mode( a, b )
Returns the value of the mode of the Uniform
distribution from a to b .
jStat.uniform.sample( a, b )
Returns a random number whose distribution is the
Uniform distribution from a to b .
jStat.uniform.variance( a, b )
Returns the variance of the Uniform distribution from a
to b .
jStat.binomial
jStat.binomial.pdf( k, n, p )
Returns the value of k in the pdf of the Binomial
distribution with parameters n and p .
jStat.binomial.cdf( k, n, p )
jStat.negbin
jStat.negbin.pdf( k, r, p )
Returns the value of k in the pdf of the Negative
Binomial distribution with parameters n and p .
jStat.negbin.cdf( x, r, p )
Returns the value of x in the cdf of the Negative
Binomial distribution with parameters n and p .
jStat.hypgeom
jStat.hypgeom.pdf( k, N, m, n )
Returns the value of k in the pdf of the Hypergeometric
distribution with parameters N (the population size), m
(the success rate), and n (the number of draws).
jStat.hypgeom.cdf( x, N, m, n )
Returns the value of x in the cdf of the Hypergeometric
distribution with parameters N (the population size), m
(the success rate), and n (the number of draws).
jStat.poisson
jStat.poisson.pdf( k, l )
Returns the value of k in the pdf of the Poisson
distribution with parameter l (lambda).
jStat.poisson.cdf( x, l )
jStat.poisson.sample( l )
Returns a random number whose distribution is the
Poisson distribution with rate parameter l (lamda)
jStat.triangular
jStat.triangular.pdf( x, a, b, c )
Returns the value of x in the pdf of the Triangular
distribution with the parameters a , b , and c .
jStat.triangular.cdf( x, a, b, c )
Returns the value of x in the cdf of the Triangular
distribution with the parameters a , b , and c .
jStat.triangular.mean( a, b, c )
Returns the value of the mean of the Triangular
distribution with the parameters a , b , and c .
jStat.triangular.median( a, b, c )
Returns the value of the median of the Triangular
distribution with the parameters a , b , and c .
jStat.triangular.mode( a, b, c )
Returns the value of the mode of the Triangular
distribution with the parameters a , b , and c .
jStat.triangular.sample( a, b, c )
Returns a random number whose distribution is the
jStat.triangular.variance( a, b, c )
Returns the value of the variance of the Triangular
distribution with the parameters a , b , and c .
jStat.arcsine( a, b )
jStat.arcsine.pdf( x, a, b )
Returns the value of x in the pdf of the arcsine
distribution from a to b .
jStat.arcsine.cdf( x, a, b )
Returns the value of x in the cdf of the arcsine
distribution from a to b .
jStat.arcsine.inv(p, a, b)
Returns the inverse of the arcsine.cdf function; i.e. the
value of x for which arcsine.cdf(x, a, b) == p .
jStat.arcsine.mean( a, b )
Returns the value of the mean of the arcsine distribution
from a to b .
jStat.arcsine.median( a, b )
Returns the value of the median of the arcsine
distribution from a to b .
jStat.arcsine.mode( a, b )
Returns the value of the mode of the arcsine distribution
from a to b .
jStat.arcsine.sample( a, b )
Returns a random number whose distribution is the
arcsine distribution from a to b .
jStat.arcsine.variance( a, b )
Returns the variance of the Uniform distribution from a
to b .
Special Functions
betafn( x, y )
Evaluates the Beta function at (x,y) .
betaln( x, y )
Evaluates the log Beta function at (x,y) .
betacf( x, a, b )
Returns the continued fraction for the incomplete Beta
function with parameters a and b modified by Lentz's
method evaluated at x .
ibetainv( p, a, b)
Returns the inverse of the incomplete Beta function
evaluated at (p,a,b) .
ibeta( x, a, b)
Returns the incomplete Beta function evaluated at
(x,a,b) .
gammafn( x )
Returns the Gamma function evaluated at x . This is
sometimes called the 'complete' gamma function.
gammaln( x )
Returns the Log-Gamma function evaluated at x .
gammap( a, x )
Returns the lower incomplete gamma function evaluated
at (a,x) . This function is usually written with a lower
case greek gamma character, and is one of the two
incomplete gamma functions.
lowRegGamma(a, x)
Returns the lower regularized incomplete gamma
function evaluated at (a,x) . It is defined as the quotient
of the lower incomplete gamma function evaluated at (a,
x) and the upper incomplete gamma function ('the
gamma function') evaluated at (a). This function is
usually written as P(x, a); and is one of the two
regularized gamma functions.
gammapinv( p, a )
Returns the inverse of the lower regularized incomplete
Gamma function evaluated at (p,a) . This function is the
inverse of lowerRegularizedGamma(x, a).
factorialln( n )
Returns the natural log factorial of n .
factorial( n )
Returns the factorial of n .
combination( n, m )
Returns the number of combinations of n , m .
permutation( n, m )
Returns the number of permutations of n , m .
erf( x )
Returns the error function evaluated at x .
erfc( x )
Returns the complementary error function evaluated at
x.
erfcinv( p )
Returns the inverse of the complementary error function
evaluated at p .
randn( n, m )
Returns a normal deviate (mean 0 and standard deviation
1).
randg( shape, n, m )
Returns a Gamma deviate by the method of Marsaglia
and Tsang.
Linear Algebra
Instance Functionality
add( arg )
subtract( arg )
Subtracts all entries by value.
divide( arg )
Divides all entries by value.
multiply( arg )
Multiplies all entries by value.
dot( arg )
Takes dot product.
pow( arg )
Raises all entries by value.
exp()
log()
Returns the natural logarithm of all entries.
abs()
Returns the absolute values of all entries.
norm()
Computes the norm of a vector. Note that if a matrix is
passed, then the first row of the matrix will be used as a
vector for norm() .
angle( arg )
Computes the angle between two vectors. Note that if a
matrix is passed, then the first row of the matrix will be
used as the vector for angle() .
Static Functionality
outer( A, B )
Takes the outer product of the A and B arrays.
exp( arr )
Exponentiates all entries in the arr array.
log( arr )
Returns the natural logarithm of all entries in the arr
array
abs( arr )
Returns the absolute values of all entries in the arr array
norm( arr )
Computes the norm of the arr vector.
aug( A, B )
Augments matrix A by matrix B . Note that this method
returns a plain matrix, not a jStat object.
det( A )
Calculates the determinant of matrix A .
inv( A )
Returns the inverse of the matrix A .
gauss_elimination( A, B )
Performs Gaussian Elimination on matrix A augmented
by matrix B .
gauss_jordan( A, B )
Performs Gauss-Jordan Elimination on matrix A
augmented by matrix B .
lu( A )
Perform the LU decomposition on matrix A .
A -> [L,U]
st.
A = LU
cholesky( A )
Performs the Cholesky decomposition on matrix A .
A -> T
st.
A = TT'
gauss_jacobi( A, b, x, r )
Solves the linear system Ax = b using the Gauss-Jacobi
method with an initial guess of r .
gauss_seidel( A, b, x, r )
Solves the linear system Ax = b using the Gauss-Seidel
method with an initial guess of r .
SOR( A, b, x, r, w )
Solves the linear system Ax = b using the sucessive
over-relaxation method with an initial guess of r and
parameter w (omega).
householder( A )
Performs the householder transformation on the matrix
A.
QR( A )
Performs the Cholesky decomposition on matrix A .
A -> [Q,R]
lstsq( A, b )
Solves least squard problem for Ax=b as QR
decomposition way.
jacobi()
rungekutta()
romberg()
richardson()
simpson()
hermite()
lagrange()
cubic_spline()
gauss_quadrature()
PCA()
Statistical Tests
The test module includes methods that enact popular
statistical tests. The tests that are implemented are Z
tests, T tests, and F tests. Also included are methods for
developing confidence intervals. Currently regression is
not included but it should be included soon (once matrix
inversion is fixed).
tscore( value )
Returns the t-score of value taking the jStat object as
the observed values.
anovafscore()
Returns the f-score of the ANOVA test on the arrays of
the jStat object.
anovaftest()
Returns the p-value of an ANOVA test on the arrays of
the jStat object.
Static Methods
Z Statistics
T Statistics
F Statistics
jStat.anovafscore( [array1,array2,
...,arrayn] )
Returns the f-score of an ANOVA on the arrays.
jStat.qtest( qscore, n, k )
Returns the p-value of the q-score given the total
sample size n and k number of populations.
jStat.tukeyhsd( arrays )
Performs the full Tukey's range test returning p-values
for every pairwise combination of the arrays in the
format of [[[index1, index2], pvalue], ...]
For example:
Confidence Intervals
jStat.fn.oneSidedDifferenceOfProportions(
p1, n1, p2, n2 )
Returns the p-value for a 1-sided test for the difference
between two proportions. p1 is the sample proportion
for the first sample, whereas p2 is the sample
proportion for the second sample. Similiarly, n1 is the
jStat.fn.twoSidedDifferenceOfProportions(
p1, n1, p2, n2 )
Returns the p-value for a 2-sided test for the difference
between two proportions. p1 is the sample proportion
for the first sample, whereas p2 is the sample
proportion for the second sample. Similiarly, n1 is the
sample size of the first sample and n2 is the sample size
for the second sample.