public final class RandomWalk extends Object implements Model
| Constructor and Description |
|---|
RandomWalk(TimeSeries observed)
Create a new random walk model from the given time series of observations.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
TimeSeries |
fittedSeries()
Get the model fitted values, which are in-sample one-step ahead forecasts.
|
Forecast |
forecast(int steps,
double alpha)
Produce a forecast from this model up to the given number of steps ahead.
|
int |
hashCode() |
TimeSeries |
observations()
Get the series of observations.
|
TimeSeries |
predictionErrors()
Get the model prediction errors, the difference between the observed values and the model fitted values.
|
static TimeSeries |
simulate(Distribution dist,
int n)
Simulate a random walk assuming that the errors, or random shocks, follow the given Distribution.
|
static TimeSeries |
simulate(double mean,
double sigma,
int n)
Simulate a random walk assuming errors follow a Normal (Gaussian) Distribution with the given mean and standard
deviation.
|
static TimeSeries |
simulate(double sigma,
int n)
Simulate a random walk assuming errors follow a Normal (Gaussian) Distribution with zero mean and with the
provided standard deviation.
|
static TimeSeries |
simulate(int n)
Simulate a random walk assuming errors follow a standard Normal (Gaussian) Distribution.
|
String |
toString() |
public RandomWalk(@NonNull
TimeSeries observed)
observed - the observed series.public static TimeSeries simulate(@NonNull Distribution dist, int n)
dist - The probability distribution that observations are drawn from.n - The number of observations to simulate.public static TimeSeries simulate(double mean, double sigma, int n)
mean - the mean of the Normal distribution the observations are drawn from.sigma - the standard deviation of the Normal distribution the observations are drawn from.n - the number of observations to simulate.public static TimeSeries simulate(double sigma, int n)
sigma - the standard deviation of the Normal distribution the observations are drawn from.n - the number of observations to simulate.public static TimeSeries simulate(int n)
n - the number of observations to simulate.public Forecast forecast(int steps, double alpha)
Modelpublic TimeSeries observations()
Modelobservations in interface Modelpublic TimeSeries fittedSeries()
ModelfittedSeries in interface Modelpublic TimeSeries predictionErrors()
ModelpredictionErrors in interface Model