Hello, I need some help in differencing a time series.
For example I have a data set with 100 data points. I
need to create a new dataset that consists of the
difference of two succeeding data points.
something akin to this formula in java:
for (int i = 0, i < 100, i++)
{
newdataset[i] = olddataset[i] - olddataset[i-1]
}
any help is appreciated. Thanks
differencing a time series
2 messages · oliver wee, Brian Ripley
On Sun, 12 Feb 2006, oliver wee wrote:
Hello, I need some help in differencing a time series.
For example I have a data set with 100 data points. I
need to create a new dataset that consists of the
difference of two succeeding data points.
something akin to this formula in java:
for (int i = 0, i < 100, i++)
{
newdataset[i] = olddataset[i] - olddataset[i-1]
}
Surely that is incorrect: what is olddataset[-1] in Java? R does this right in diff().
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595