Commit 683c888a authored by Sören Henning's avatar Sören Henning

added some documentation

parent a65f806d
......@@ -8,6 +8,14 @@ import teead.timeseries.EquidistantTimeSeries;
import teead.timeseries.TimeSeries;
import teead.timeseries.TimeSeriesPoint;
/**
* This class can be used to normalize a {@link TimeSeries}. This means it
* transforms a {@link TimeSeries} to an {@link EquidistantTimeSeries} using a
* given step size (the distance) and {@link Aggregator}.
*
* @author Sören Henning
*
*/
public class TimeSeriesNormalizer {
private final Duration stepSize;
......
package teead.forecast;
import teead.timeseries.EquidistantTimeSeries;
public interface Forecaster {
public double forecast(final EquidistantTimeSeries timeSeries);
}
package teead.forecast;
import teead.timeseries.EquidistantTimeSeries;
/**
* A forecaster predicts the next value for a given {@link EquidistantTimeSeries}.
*
* @author Sören Henning
*
*/
public interface Forecaster {
public double forecast(final EquidistantTimeSeries timeSeries);
}
package teead.forecast;
import teead.timeseries.EquidistantTimeSeries;
public class MeanForecaster implements Forecaster {
@Override
public double forecast(final EquidistantTimeSeries timeSeries) {
return timeSeries.stream().mapToDouble(p -> p.getValue()).sum() / timeSeries.size();
}
}
package teead.forecast;
import teead.timeseries.EquidistantTimeSeries;
/**
* This class is a {@link Forecaster} that predicts a new value based on the
* mean of the given {@link EquidistantTimeSeries}.
*
* @author Sören Henning
*
*/
public class MeanForecaster implements Forecaster {
@Override
public double forecast(final EquidistantTimeSeries timeSeries) {
return timeSeries.stream().mapToDouble(p -> p.getValue()).sum() / timeSeries.size();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment