Time series


In [1]:
%matplotlib inline

Just checking the logic.


In [2]:
import matplotlib.pyplot as plt
from dcprogs.likelihood import plot_time_series
from dcprogs.likelihood.random import time_series as random_time_series

perfect, series = random_time_series(N=100, n=100, tau=1)
print(perfect)
fig, ax = plt.subplots(1,1)
plot_time_series(perfect, ax=ax)
plot_time_series(series, ax=ax, marker='*', color='k', linestyle=':')


[   0.            4.74546135   12.6695942    19.45260127   22.45444387
   29.65470963   37.66236166   47.21055899   53.305299     59.97349316
   63.90831412   70.22433515   74.15287125   83.42018035   86.54892714
   93.37706804  101.50739019  105.81944245  111.90180027  120.05447999
  129.63920164  134.04513702  141.6226389   149.00074976  157.41458182
  164.30504192  167.58304251  171.3212751   178.59463529  186.15284383
  191.87338536  201.47128713  210.24324846  218.9044409   226.53731567
  231.82443715  236.70861132  239.85201642  247.21002347  250.96255353
  257.46176192  262.04452535  268.07054396  275.4958293   284.78293946
  291.91725085  301.83490275  310.9262623   313.97017921  323.13328549
  330.34590097  333.67112109  336.6986944   345.47071264  354.80365501
  360.31017249  365.90673032  375.61425461  383.75648647  388.42726059
  393.6267829   401.83385077  410.52766077  420.48961902  427.54754617
  432.70594177  441.08293399  448.79772028  452.05871769  458.59302116
  463.02751366  466.50817244  475.34367822  480.27257628  488.56874504
  493.2150171   500.95870192  507.18030118  512.51471318  518.9803798
  526.05768444  531.79230826  537.09201398  541.14917867  549.69490515
  555.53639634  564.70201042  567.83881251  573.65156966  580.1753128
  584.21257129  588.51464923  592.51522648  596.90823164  603.77042679
  613.23240743  620.41391596  629.58898445  639.27235979  643.43556275
  651.58054567]

In [3]:
from dcprogs.likelihood import time_filter as cpp_time_filter
filtered = cpp_time_filter(series, 1)
fig, ax = plt.subplots(1,1)
plot_time_series(perfect, ax=ax)
plot_time_series(filtered, ax=ax, marker='*', color='k', linestyle=':')


Now, computes the likelihood of this time series for a random QMatrix


In [ ]: