LOOS 4.1.0
The Lightweight Object Oriented Structural analysis library/toolkit
|
Time Series Class. More...
#include <TimeSeries.hpp>
Public Types | |
typedef std::vector< T >::iterator | iterator |
typedef std::vector< T >::const_iterator | const_iterator |
typedef const T & | const_reference |
typedef T & | reference |
typedef T | value_type |
Public Member Functions | |
TimeSeries (const std::vector< T > &inp) | |
TimeSeries (const uint size, const T *array) | |
TimeSeries (const TimeSeries< T > &inp) | |
TimeSeries (const uint n) | |
TimeSeries (const uint n, const T val) | |
void | resize (const uint n, const T val=(T) 0.0) |
Resize the TimeSeries by calling the underlying vector's resize. | |
TimeSeries (const std::string &filename, const int col=2) | |
void | init (void) |
void | zero (void) |
T & | operator[] (const unsigned int i) |
const T & | operator[] (const unsigned int i) const |
unsigned int | size (void) const |
TimeSeries< T > | operator+= (const T val) |
TimeSeries< T > | operator+= (const TimeSeries< T > &rhs) |
TimeSeries< T > | operator+ (const T val) const |
TimeSeries< T > | operator+ (const TimeSeries< T > &rhs) const |
TimeSeries< T > | operator-= (const T val) |
TimeSeries< T > | operator-= (const TimeSeries< T > &rhs) |
TimeSeries< T > | operator- (const T val) const |
TimeSeries< T > | operator- (const TimeSeries< T > &rhs) const |
TimeSeries< T > | operator- () const |
TimeSeries< T > | operator*= (const T val) |
TimeSeries< T > | operator* (const T val) const |
TimeSeries< T > | operator*= (const TimeSeries< T > &rhs) |
TimeSeries< T > | operator* (const TimeSeries< T > &rhs) const |
TimeSeries< T > | operator/= (const T val) |
TimeSeries< T > | operator/ (const T val) const |
TimeSeries< T > | operator/= (const TimeSeries< T > &rhs) |
TimeSeries< T > | operator/ (const TimeSeries< T > &rhs) const |
TimeSeries< T > | copy (void) const |
void | set_skip (unsigned int num_points) |
T | average (void) const |
Return average of time series. | |
T | weighted_average (const std::vector< double > &w) const |
Return weighted average. | |
T | variance (void) const |
Return variance of time series. | |
T | weighted_variance (const std::vector< double > &w) const |
Return weighted variance. | |
T | stdev (void) const |
Return standard deviation of time series. | |
T | stdev (const std::vector< double > &w) const |
Return weighted standard deviation of time series. | |
T | sterr (void) const |
TimeSeries< T > | running_average (void) const |
TimeSeries< T > | windowed_average (const uint window) const |
T | block_var (const int num_blocks) const |
TimeSeries< T > | correl (const int max_time, const int interval=1, const bool normalize=true, T tol=1.0e-8) const |
void | push_back (const T &x) |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
Friends | |
TimeSeries< T > | operator+ (const T lhs, const TimeSeries< T > &rhs) |
TimeSeries< T > | operator- (const T lhs, const TimeSeries< T > &rhs) |
TimeSeries< T > | operator* (const T lhs, const TimeSeries< T > &rhs) |
TimeSeries< T > | operator/ (const T lhs, const TimeSeries< T > &rhs) |
Time Series Class.
This class provides basic operations on a time series, such as averaging, standard deviation, etc
One can do standard arimethic operations on time series combined with scalars or other timeseries (as long as the two time series are the same length).
|
inline |
Read a simple text file and create a timeseries The file is assumed to be simple columnated data. Blank lines and lines starting with "#" are ignored.
|
inline |
Return the variance of the block average for the time series. Divides the timeseries into num_blocks equally sized blocks (discarding the remaining blocks at the end), computes the average for each block, and returns the variance of the averages. This is useful for doing Flyvjberg and Petersen-style block averaging. Flyvbjerg, H. & Petersen, H. G. J. Chem. Phys., 1989, 91, 461-466
|
inline |
Return a new timeseries of the same size as the current one, containing the running average of the time series
|
inline |
Remove num_points from the front of the time series, as you would to eliminate the equilibration time
|
inline |
Return standard error of time series. This assumes all points are statistically independent Otherwise, needs to be multiplied by the square root of the correlation time, in units of the step interval for the time series
|
inline |
Return a new timeseries containing the windowed average. ith value of the new time series = 1/window * sum(data[i:i+window]). NOTE: The present algorithm is relatively fast, but can be prone to roundoff.