def test_npnan(self): x = self.npts.copy() x[0] = np.nan with self.assertRaises(ValueError): vassal.ssa(x)
def test_pdinf(self): x = self.pdts.copy() x[0] = np.inf with self.assertRaises(ValueError): vassal.ssa(x)
def setUp(self): np.random.seed(0) npts = np.random.rand(100) pdts = pd.Series(npts) self.ssa_np = vassal.ssa(npts, svdmethod='skrandom', kind='toeplitz') self.ssa_np.decompose(k=50)
def setUp(self): np.random.seed(0) npts = np.random.rand(100) self.ssa_np = vassal.ssa(npts, kind='toeplitz') s,v,d = self.ssa_np.decompose()
def setUp(self): np.random.seed(0) npts = np.random.rand(100) self.ssa_np = vassal.ssa(npts, svdmethod='sparpack', kind='toeplitz') self.ssa_np.decompose(k=49)
def setUp(self): np.random.seed(0) npts = np.random.rand(100) self.ssa_np = vassal.ssa(npts) self.ssa_np.decompose()
def setUp(self): np.random.seed(0) npts = np.random.rand(100) self.ssa_np = vassal.ssa(npts, svdmethod='sparpack') self.ssa_np.decompose(k=49) # we cannot set to 50
def setUp(self): np.random.seed(0) npts = np.random.rand(100) self.ssa_np = vassal.ssa(npts, svdmethod='splapack') self.ssa_np.decompose()
import vassal import unittest import numpy as np import pandas as pd import matplotlib.pyplot as plt if __name__ == '__main__': n = 100 t = np.arange(100) ts = np.sin(t) + np.random.rand(n) ssa = vassal.ssa(ts) ssa.decompose() fig = plt.figure() ax = fig.gca() ssa.plot('paired') plt.show()