Esempio n. 1
0
 def test_npnan(self):
     x = self.npts.copy()
     x[0] = np.nan
     with self.assertRaises(ValueError):
         vassal.ssa(x)
Esempio n. 2
0
 def test_pdinf(self):
     x = self.pdts.copy()
     x[0] = np.inf
     with self.assertRaises(ValueError):
         vassal.ssa(x)
Esempio n. 3
0
 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)
Esempio n. 4
0
 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()
Esempio n. 5
0
 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)
Esempio n. 6
0
 def setUp(self):
     np.random.seed(0)
     npts = np.random.rand(100)
     self.ssa_np = vassal.ssa(npts)
     self.ssa_np.decompose()
Esempio n. 7
0
 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
Esempio n. 8
0
 def setUp(self):
     np.random.seed(0)
     npts = np.random.rand(100)
     self.ssa_np = vassal.ssa(npts, svdmethod='splapack')
     self.ssa_np.decompose()
Esempio n. 9
0
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()