public class SimpleTimeSeries extends java.lang.Object implements TimeSeries
double values indexed by integers.TimeSeries.Entry| Constructor and Description |
|---|
SimpleTimeSeries(double[] values)
Construct an instance of
SimpleTimeSeries. |
| Modifier and Type | Method and Description |
|---|---|
SimpleTimeSeries |
diff(int d)
Construct an instance of
SimpleTimeSeries by taking the first difference d times. |
SimpleTimeSeries |
drop(int nItems)
Construct an instance of
SimpleTimeSeries by dropping the leading nItems entries. |
boolean |
equals(java.lang.Object obj) |
double |
get(int t)
Get the value at time
t. |
int |
hashCode() |
java.util.Iterator<TimeSeries.Entry> |
iterator() |
SimpleTimeSeries |
lag(int nLags)
Construct an instance of
SimpleTimeSeries by lagging the time series. |
SimpleTimeSeries |
lag(int nLags,
int length)
/**
Construct an instance of
SimpleTimeSeries by lagging the time series. |
int |
size()
Get the length of the time series.
|
double[] |
toArray()
Convert this time series into an array, discarding the timestamps.
|
java.lang.String |
toString() |
public SimpleTimeSeries(double[] values)
SimpleTimeSeries.values - an array of valuespublic int size()
TimeSeriessize in interface TimeSeries<java.lang.Integer,java.lang.Double,TimeSeries.Entry>public java.util.Iterator<TimeSeries.Entry> iterator()
iterator in interface java.lang.Iterable<TimeSeries.Entry>public double[] toArray()
TimeSeriespublic double get(int t)
TimeSeriest.t - a time indextpublic SimpleTimeSeries drop(int nItems)
SimpleTimeSeries by dropping the leading nItems entries.nItems - the number of leading entries to be droppedSimpleTimeSeriespublic SimpleTimeSeries diff(int d)
SimpleTimeSeries by taking the first difference d times.d - the number of differencesdiff(x, lag = 1, differences = d) as in Rpublic SimpleTimeSeries lag(int nLags, int length)
SimpleTimeSeries by lagging the time series.
This operation makes sense only for equi-distant data points.nLags - the number of lagslength - the length of the lagged time seriespublic SimpleTimeSeries lag(int nLags)
SimpleTimeSeries by lagging the time series.
This operation makes sense only for equi-distant data points.nLags - the number of lagspublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object