SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.timeseries.multivariate.realtime
Class SimpleMultiVariateTimeSeries

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.timeseries.multivariate.realtime.SimpleMultiVariateTimeSeries
All Implemented Interfaces:
MultiVariateTimeSeries<java.lang.Integer>, TimeSeries<java.lang.Integer,Vector>
Direct Known Subclasses:
ArimaSim

public class SimpleMultiVariateTimeSeries
extends java.lang.Object
implements MultiVariateTimeSeries

A simple multivariate time series has its vectored values indexed by integers. Data are assumed to be equally spaced.

This time of series is often seen in classical multivariate time series analysis.


Nested Class Summary
 class SimpleMultiVariateTimeSeries.Iterator
          the Iterator to read a SimpleMultiVariateTimeSeries
 
Nested classes/interfaces inherited from interface com.numericalmethod.suanshu.stats.timeseries.multivariate.realtime.MultiVariateTimeSeries
MultiVariateTimeSeries.Entry
 
Constructor Summary
SimpleMultiVariateTimeSeries(double[]... values)
          Construct a SimpleMultiVariateTimeSeries.
SimpleMultiVariateTimeSeries(Matrix values)
          Construct a SimpleMultiVariateTimeSeries.
SimpleMultiVariateTimeSeries(TimeSeries ts)
          Construct a SimpleMultiVariateTimeSeries from a univariate time series.
SimpleMultiVariateTimeSeries(Vector... values)
          Construct a SimpleMultiVariateTimeSeries.
 
Method Summary
 SimpleMultiVariateTimeSeries diff(int d)
          Construct a new and independent SimpleMultiVariateTimeSeries by taking the first difference.
 int dimension()
          Get the dimensionality of the multivariate time series.
 SimpleMultiVariateTimeSeries drop(int nItems)
          Construct a new and independent SimpleMultiVariateTimeSeries by dropping the leading nItems entries.
 boolean equals(java.lang.Object obj)
           
 Vector get(int t)
          Get the value at time t.
 int hashCode()
           
 SimpleMultiVariateTimeSeries.Iterator iterator()
          Get an Iterator to read this integer-indexed multivariate time series.
 SimpleMultiVariateTimeSeries lag(int nLags)
          Construct a new and independent SimpleMultiVariateTimeSeries by lagging the time series.
 SimpleMultiVariateTimeSeries lag(int nLags, int length)
          Construct a new and independent SimpleMultiVariateTimeSeries by lagging the time series.
 int size()
          the length of the time series
 Matrix toMatrix()
          Convert this multivariate time series into an m x n matrix, where m is the dimension, and n the length.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleMultiVariateTimeSeries

public SimpleMultiVariateTimeSeries(Matrix values)
Construct a SimpleMultiVariateTimeSeries.

Parameters:
values - a matrix representation of a time series

SimpleMultiVariateTimeSeries

public SimpleMultiVariateTimeSeries(double[]... values)
Construct a SimpleMultiVariateTimeSeries.

Parameters:
values - a double array representation of a time series

SimpleMultiVariateTimeSeries

public SimpleMultiVariateTimeSeries(Vector... values)
Construct a SimpleMultiVariateTimeSeries.

Parameters:
values - a vector representation of a time series

SimpleMultiVariateTimeSeries

public SimpleMultiVariateTimeSeries(TimeSeries ts)
Construct a SimpleMultiVariateTimeSeries from a univariate time series.

Parameters:
ts - a univariate time series
Method Detail

iterator

public SimpleMultiVariateTimeSeries.Iterator iterator()
Description copied from interface: MultiVariateTimeSeries
Get an Iterator to read this integer-indexed multivariate time series.

Specified by:
iterator in interface MultiVariateTimeSeries<java.lang.Integer>
Specified by:
iterator in interface TimeSeries<java.lang.Integer,Vector>
Returns:
an iterator

toMatrix

public Matrix toMatrix()
Description copied from interface: MultiVariateTimeSeries
Convert this multivariate time series into an m x n matrix, where m is the dimension, and n the length.

Specified by:
toMatrix in interface MultiVariateTimeSeries<java.lang.Integer>
Returns:
the matrix representation of this time series

size

public int size()
Description copied from interface: TimeSeries
the length of the time series

Specified by:
size in interface TimeSeries<java.lang.Integer,Vector>
Returns:
the size

dimension

public int dimension()
Description copied from interface: MultiVariateTimeSeries
Get the dimensionality of the multivariate time series.

Specified by:
dimension in interface MultiVariateTimeSeries<java.lang.Integer>
Returns:
the dimensionality

get

public Vector get(int t)
Description copied from interface: MultiVariateTimeSeries
Get the value at time t.

Parameters:
t - the time index, ranging from 1 up to T
Returns:
ts[t]

drop

public SimpleMultiVariateTimeSeries drop(int nItems)
Construct a new and independent SimpleMultiVariateTimeSeries by dropping the leading nItems entries.

Parameters:
nItems - the number of leading entries to be dropped
Returns:
a new and independent time series

diff

public SimpleMultiVariateTimeSeries diff(int d)
Construct a new and independent SimpleMultiVariateTimeSeries by taking the first difference.

Parameters:
d - the number of differences
Returns:
diff(x, lag = 1, differences = d) as in R

lag

public SimpleMultiVariateTimeSeries lag(int nLags,
                                        int length)
Construct a new and independent SimpleMultiVariateTimeSeries by lagging the time series.

This only makes sense for equi-distant data points.

Parameters:
nLags - the number of lags
length - the length of the lagged time series
Returns:
a lagged time series

lag

public SimpleMultiVariateTimeSeries lag(int nLags)
Construct a new and independent SimpleMultiVariateTimeSeries by lagging the time series.

This only makes sense for equi-distant data points.

Parameters:
nLags - the number of lags
Returns:
a lagged time series

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.