Build a function that returns a product of four configurable elements:
\(\bar x\): a mean value
\(F_S(t)\): a seasonal pattern
\(F_T(t)\): a trend
\(F_K(t)\): a shock
The return value is a function of the form:
\(F_t(t)\) if
form == "t"\(F_t(t, V(t))\) if
form == "tV"
The user can pass any vector times and the interval is
set to
\(t_0 = \mbox{min(times)}\), and
\(t_1 = \mbox{max(times)}\).
A normalizing constant is set such that the daily average over the interval \((t_0, t_1)\) is \(\bar x\): $$\int_{t_0}^{t_1} F_t(t) dt = \bar x \left(t_1-t_0\right).$$
The component functions are specified by
passing F_obj objects (see F_obj):
season_parcreates \(F_S(t)\) orF_season(eg, using makepar_F_sin)trend_parcreates \(F_T(t)\) orF_trend(eg, using makepar_F_spline)shock_parcreates \(F_K(t)\) orF_shock(eg, using makepar_F_sharkbite)
Arguments
- avg
the average
- season_par
seasonality function for
- trend_par
trend function parameters
- shock_par
trend function parameters
- times
normalize \(t_0 = \mbox{min(times)}\) to \(t_1 = \mbox{max(times)}\)
- norm_with_shocks
if FALSE, set \(F_K(t)=1\) for normalization
- N
the length of the return value
- form
functional form: "t" returns \(F(t)\); "tV" returns \(F(t,V)\)
- options
configurable options