@@ -1557,28 +1557,6 @@ def normpdf(x, *args):
15571557 return 1. / (np .sqrt (2 * np .pi )* sigma )* np .exp (- 0.5 * (1. / sigma * (x - mu ))** 2 )
15581558
15591559
1560- def levypdf (x , gamma , alpha ):
1561- "Returm the levy pdf evaluated at *x* for params *gamma*, *alpha*"
1562-
1563- N = len (x )
1564-
1565- if N % 2 != 0 :
1566- raise ValueError ('x must be an event length array; try\n ' + \
1567- 'x = np.linspace(minx, maxx, N), where N is even' )
1568-
1569- dx = x [1 ] - x [0 ]
1570-
1571- f = 1 / (N * dx )* np .arange (- N / 2 , N / 2 , np .float_ )
1572-
1573- ind = np .concatenate ([np .arange (N / 2 , N , int ),
1574- np .arange (0 , N / 2 , int )])
1575- df = f [1 ] - f [0 ]
1576- cfl = np .exp (- gamma * np .absolute (2 * np .pi * f ) ** alpha )
1577-
1578- px = np .fft .fft (np .take (cfl , ind ) * df ).astype (np .float_ )
1579- return np .take (px , ind )
1580-
1581-
15821560def find (condition ):
15831561 "Return the indices where ravel(condition) is true"
15841562 res , = np .nonzero (np .ravel (condition ))
@@ -1670,13 +1648,13 @@ def __init__(self, a, standardize=True):
16701648
16711649 *numrows*, *numcols*: the dimensions of a
16721650
1673- *mu* : a numdims array of means of a. This is the vector that points to the
1674- origin of PCA space.
1651+ *mu* : a numdims array of means of a. This is the vector that points to the
1652+ origin of PCA space.
16751653
16761654 *sigma* : a numdims array of standard deviation of a
16771655
16781656 *fracs* : the proportion of variance of each of the principal components
1679-
1657+
16801658 *s* : the actual eigenvalues of the decomposition
16811659
16821660 *Wt* : the weight vector for projecting a numdims point or array into PCA space
@@ -1705,23 +1683,23 @@ def __init__(self, a, standardize=True):
17051683 U , s , Vh = np .linalg .svd (a , full_matrices = False )
17061684
17071685 # Note: .H indicates the conjugate transposed / Hermitian.
1708-
1686+
17091687 # The SVD is commonly written as a = U s V.H.
17101688 # If U is a unitary matrix, it means that it satisfies U.H = inv(U).
1711-
1689+
17121690 # The rows of Vh are the eigenvectors of a.H a.
1713- # The columns of U are the eigenvectors of a a.H.
1691+ # The columns of U are the eigenvectors of a a.H.
17141692 # For row i in Vh and column i in U, the corresponding eigenvalue is s[i]**2.
1715-
1693+
17161694 self .Wt = Vh
1717-
1695+
17181696 # save the transposed coordinates
17191697 Y = np .dot (Vh , a .T ).T
17201698 self .Y = Y
1721-
1699+
17221700 # save the eigenvalues
17231701 self .s = s ** 2
1724-
1702+
17251703 # and now the contribution of the individual components
17261704 vars = self .s / float (len (s ))
17271705 self .fracs = vars / vars .sum ()
0 commit comments