class ExpSmoothing extends Forecaster
The ExpSmoothing
class provide very basic time series analysis capabilities of
Exponential Smoothing models. ExpSmoothing
models are often used for forecasting.
Given time series data stored in vector 'y', its next value 'y_t = y(t)'
may be predicted based on prior/smoothed values of 'y':
y_t = s_t-1 + α (s_t-1 - s_t-2)
where vector 's' is the smoothed version of vector 'y' and 'α in [0, 1]' is the smoothing parameter. Trend and seasonality can be factored into the model with two additional smoothing parameters 'β' and 'γ', respectively.
- Alphabetic
- By Inheritance
- ExpSmoothing
- Forecaster
- Error
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
ExpSmoothing(y_: VectoD, ll: Int = 1, multiplicative: Boolean = false, validateSteps: Int = 1)
- y_
the input vector (time series data)
- ll
seasonal period
- multiplicative
whether to use multiplicative seasonality or not if false, use additive seasonality
- validateSteps
number of steps ahead within-sample forecast sse to minimize
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
diagnose(yy: VectoD, ee: VectoD): Unit
Compute diagostics for the Exponential Smoothing model.
Compute diagostics for the Exponential Smoothing model.
- yy
the response vector
- ee
the residual/error vector
- Definition Classes
- ExpSmoothing → Forecaster
-
var
e: VectoD
- Attributes
- protected
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
eval(): Unit
Compute the error and useful diagnostics for the entire dataset.
Compute the error and useful diagnostics for the entire dataset.
- Definition Classes
- ExpSmoothing → Forecaster
-
def
f_(z: Double): String
Format a double value.
-
def
f_obj(input: VectoD): Double
The objective function to be minimized (sum of squared errors).
The objective function to be minimized (sum of squared errors).
- input
the input vector of 'α', 'β' and 'γ' to be optimized
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fit: VectorD
Return the quality of fit including 'rSquared'.
Return the quality of fit including 'rSquared'. Not providing 'rBarSq'.
- Definition Classes
- ExpSmoothing → Forecaster
-
def
fitLabel: Seq[String]
Return the labels for the fit.
Return the labels for the fit.
- Definition Classes
- ExpSmoothing → Forecaster
-
def
fitMap: Map[String, String]
Build a map of quality of fit measures (use of
LinedHashMap
makes it ordered).Build a map of quality of fit measures (use of
LinedHashMap
makes it ordered). Override to add more quality of fit measures.- Definition Classes
- Forecaster
-
final
def
flaw(method: String, message: String): Unit
- Definition Classes
- Error
-
def
forecast(h: Int = 1, t: Int = n-1): VectoD
Forecast 'h'-steps ahead based on data up to time 't'.
Forecast 'h'-steps ahead based on data up to time 't'.
- h
the step size
- t
the time point to start the forecast
-
def
forecast(h: Int): VectoD
Produce n-steps-ahead forecast for ARIMA models.
Produce n-steps-ahead forecast for ARIMA models.
- h
the number of steps to forecast, must be at least one.
- Definition Classes
- ExpSmoothing → Forecaster
- See also
ams.sunysb.edu/~zhu/ams586/Forecasting.pdf
-
def
forecast(): VectoD
Produce forecasts for one step ahead into the future
Produce forecasts for one step ahead into the future
- Definition Classes
- Forecaster
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
val
index_rSq: Int
- Definition Classes
- Forecaster
-
def
init(): Unit
Compute initial values of 's', 'b', 'aa' and 'c'.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
mae: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
val
mape: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
val
mse: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
predict(): VectoD
Return the vector of fitted values on the training data.
Return the vector of fitted values on the training data.
- Definition Classes
- ExpSmoothing → Forecaster
-
val
rSq: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
val
rmse: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
def
setTS(y_: VectoD): Unit
Set/change the internal time series.
Set/change the internal time series. May be used to set the time series to a different time window (typically future when new data become available) in order to produce newer forecast (typically with the new data) without re-training the model for parameters (use existing parameters from previous training).
- y_
the new time series
-
def
smooth(input: VectoD = VectorD(α, β, γ)): VectoD
Smooth the times series data.
Smooth the times series data.
- input
the input vector of 'α', 'β' and 'γ' to be optimized
-
val
sse: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
val
ssr: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
val
sst: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
train(): ExpSmoothing
Train the
ExpSmoothing
model to times series data, by finding the value for the smoothing parameter 'α', 'β' and 'γ' that minimizes the sum of squared errors (sse).Train the
ExpSmoothing
model to times series data, by finding the value for the smoothing parameter 'α', 'β' and 'γ' that minimizes the sum of squared errors (sse).- Definition Classes
- ExpSmoothing → Forecaster
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )