Package pycv :: Package cs :: Package stats
[hide private]
[frames] | no frames]

Package stats

source code

An umbrella package containing all packages related to Probability and Statistics.



Submodules [hide private]

Classes [hide private]
  BasicStats
A few statistics of a random tensor (RT) are packed as a tuple.
  Stats2
a total weight
  Stats2e
Statistics of a random tensor (RT) up to 2nd-order are packed as a tuple.
  Stats2m
a total weight
Functions [hide private]
 
statslist(data, weights=None, masks=None)
Return the (weighted) total weight, mean, and covariance of the data
source code
 
weighted(w, A)
Compute w[0]*A[0] + w[1]*A[1] + ...
source code
 
moment2e(data, weights=None)
Return the per-element 2nd order (weighted) moment of the data
source code
 
stde(n, s2e, mean)
Get the per-element standard deviation tensor based on 0th and per-element 2nd order moments and mean
source code
 
sum_outer(A, B=None)
Compute outer(A[0],B[0]) + outer(A[1],B[1]) + ...
source code
 
moment11(data1, data2, weights=None)
Return the (1,1)-th order (weighted) cross moment the two data (point1 * point2^T)
source code
 
statsliste(data, weights=None, masks=None)
Return the per-element (weighted) total weight, means, and standard deviations of the data
source code
 
moment2(data, weights=None)
Return the 2nd order (weighted) moment of the data
source code
 
moment1(data, weights=None)
Return the 1st order (weighted) moment of the data
source code
 
moment0(data, weights=None)
Return the 0th order (weighted) moment of the data
source code
 
covariance(n, s2, mean)
Get the covariance tensor based on 0th and 2nd order moments and mean
source code
 
weighted_outer(w, A, B=None)
Compute w[0]*outer(A[0],B[0]) + w[1]*outer(A[1],B[1]) + ...
source code
 
correlation(n, s11, mean1, mean2)
Compute the correlation of 2 datasets based on their 0th and (1,1)-th order cross moment and their mean tensors.
source code
 
mean(n, s1)
Get the mean tensor based on 0th and 1st order moments
source code
Variables [hide private]
  __doc__
  stdnorm = <scipy.stats.distributions.rv_frozen object at 0x03A...
Function Details [hide private]

statslist(data, weights=None, masks=None)

source code 

Return the (weighted) total weight, mean, and covariance of the data

Input:
data: a numpy.array weights: an array of weights for the instances [optional] masks: an array of masks for the instances [optional]
Output:
n: total weight mean: mean tensor thecov: covariance tensor

weighted(w, A)

source code 

Compute w[0]*A[0] + w[1]*A[1] + ... until the end.

Input:
w: a 1D numpy.array A: a multi-dimensional numpy.array

moment2e(data, weights=None)

source code 

Return the per-element 2nd order (weighted) moment of the data

Input:
data: a numpy.array weights: an array of weights for the instances [optional]
Output:
s2e: per-element 2nd order (weighted) moment

stde(n, s2e, mean)

source code 

Get the per-element standard deviation tensor based on 0th and per-element 2nd order moments and mean

Input:
n: 0th order moment s2e: per-element 2nd order moment -- see moment2e() mean: mean temsor -- see mean()
Output:
stde: per-element stdandard deviation tensor

sum_outer(A, B=None)

source code 

Compute outer(A[0],B[0]) + outer(A[1],B[1]) + ... until the end.

Input:
A: a multi-dimensional numpy.array B: a multi-dimensional numpy.array (optional)

moment11(data1, data2, weights=None)

source code 

Return the (1,1)-th order (weighted) cross moment the two data (point1 * point2^T)

Input:
data1: a numpy.array data2: a numpy.array weights: an array of weights for the instances [optional]
Output:
s11: (1,1)-th order (weighted) cross moment

statsliste(data, weights=None, masks=None)

source code 

Return the per-element (weighted) total weight, means, and standard deviations of the data

Input:
data: a numpy.array weights: an array of weights for the instances [optional] masks: an array of masks for the instances [optional]
Output:
n: total weight mean: mean tensor thestd: standard deviation tensor

moment2(data, weights=None)

source code 

Return the 2nd order (weighted) moment of the data

Input:
data: a numpy.array weights: an array of weights for the instances [optional]
Output:
s2: 2nd order (weighted) moment

moment1(data, weights=None)

source code 

Return the 1st order (weighted) moment of the data

Input:
data: a numpy.array weights: an array of weights for the instances [optional]
Output:
s1: 1st order (weighted) moment

moment0(data, weights=None)

source code 

Return the 0th order (weighted) moment of the data

Input:
data: a numpy.array weights: an array of weights for the instances [optional]
Output:
0th order moment -- number of (weighted) instances -- equivalent to len(data)

covariance(n, s2, mean)

source code 

Get the covariance tensor based on 0th and 2nd order moments and mean

Input:
n: 0th order moment s2: 2nd order moment mean: mean tensor -- see mean()
Output:
thecov: covariance tensor

weighted_outer(w, A, B=None)

source code 

Compute w[0]*outer(A[0],B[0]) + w[1]*outer(A[1],B[1]) + ... until the end.

Input:
w: a 1D numpy.array A: a multi-dimensional numpy.array B: a multi-dimensional numpy.array (optional)

correlation(n, s11, mean1, mean2)

source code 

Compute the correlation of 2 datasets based on their 0th and (1,1)-th order cross moment and their mean tensors.

Input:
n: 0th order moment s12: cross moment of the two datasets -- see moment11() mean1: mean tensor of the first dataset -- see mean() mean2: mean tensor of the second dataset -- see mean()
Output:
cor: correlation tensor of the two dataset (point1*point2^T)

mean(n, s1)

source code 

Get the mean tensor based on 0th and 1st order moments

Input:
n: 0th order moment s1: 1st order moment
Output:
mean: mean tensor

Variables Details [hide private]

stdnorm

Value:
norm(0, 1)