Source code for sails.diags

#!/usr/bin/python

# vim: set expandtab ts=4 sw=4:

import numpy as np

__all__ = []


[docs]class DelayDiagnostics(object): """ Class which computes the mutual information as a function of lag from zero lag to the first zero crossing of the autocorrelation function. """ # This is only used within NAF hdf5_outputs = ['MI', 'MI_diff', 'delay_vect_samples', 'delay_vect_ms', 'time_vect', 'autocorrelation', 'maxdelay', 'first_zero'] def __init__(self): # TODO: Add docstrings for these self.MI = None self.MI_diff = None self.delay_vect_samples = None self.delay_vect_ms = None self.time_vect = None self.autocorrelation = None self.maxdelay = None self.first_zero = None
__all__.append('DelayDiagnostics')
[docs]class ModelDiagnostics(object): """ TODO: Description """ # This is only used within NAF hdf5_outputs = ['R_square', 'SR', 'DW', 'PC', 'AIC', 'BIC', 'LL', 'SI'] def __init__(self): # TODO: Add docstrings for these self.R_square = None self.SR = None self.DW = None self.PC = None self.AIC = None self.BIC = None self.LL = None self.SI = None def __str__(self): """Show the measures in a pre-formatted manner""" template = "{0:^10}{1:^10}{2:^10}{3:^10}{4:^10}{5:^10}" return template.format(np.round(self.SI, 3), np.round(self.SR, 3), np.round(self.DW, 3), np.round(self.AIC, 3), np.round(self.BIC, 3), np.round(self.R_square.mean(), 3))
__all__.append('ModelDiagnostics')