@@ -1557,28 +1557,6 @@ def normpdf(x, *args):
1557
1557
return 1. / (np .sqrt (2 * np .pi )* sigma )* np .exp (- 0.5 * (1. / sigma * (x - mu ))** 2 )
1558
1558
1559
1559
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
-
1582
1560
def find (condition ):
1583
1561
"Return the indices where ravel(condition) is true"
1584
1562
res , = np .nonzero (np .ravel (condition ))
@@ -1670,13 +1648,13 @@ def __init__(self, a, standardize=True):
1670
1648
1671
1649
*numrows*, *numcols*: the dimensions of a
1672
1650
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.
1675
1653
1676
1654
*sigma* : a numdims array of standard deviation of a
1677
1655
1678
1656
*fracs* : the proportion of variance of each of the principal components
1679
-
1657
+
1680
1658
*s* : the actual eigenvalues of the decomposition
1681
1659
1682
1660
*Wt* : the weight vector for projecting a numdims point or array into PCA space
@@ -1705,23 +1683,23 @@ def __init__(self, a, standardize=True):
1705
1683
U , s , Vh = np .linalg .svd (a , full_matrices = False )
1706
1684
1707
1685
# Note: .H indicates the conjugate transposed / Hermitian.
1708
-
1686
+
1709
1687
# The SVD is commonly written as a = U s V.H.
1710
1688
# If U is a unitary matrix, it means that it satisfies U.H = inv(U).
1711
-
1689
+
1712
1690
# 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.
1714
1692
# For row i in Vh and column i in U, the corresponding eigenvalue is s[i]**2.
1715
-
1693
+
1716
1694
self .Wt = Vh
1717
-
1695
+
1718
1696
# save the transposed coordinates
1719
1697
Y = np .dot (Vh , a .T ).T
1720
1698
self .Y = Y
1721
-
1699
+
1722
1700
# save the eigenvalues
1723
1701
self .s = s ** 2
1724
-
1702
+
1725
1703
# and now the contribution of the individual components
1726
1704
vars = self .s / float (len (s ))
1727
1705
self .fracs = vars / vars .sum ()
0 commit comments