These are the currently available evaluator
-functions for tfd
-objects,
which control how the entries are inter-/extrapolated to previously unseen
arg
-values. They all are merely wrappers around zoo::na.fill()
,
zoo::na.approx()
, etc... Note that these are not meant to be called directly --
they are internal functions used by tf_evaluate.tfd()
to do its thing.
The list:
tf_approx_linear
for linear interpolation without extrapolation (i.e.,zoo::na.approx()
withna.rm = FALSE
) -- this is the default,tf_approx_spline
for cubic spline interpolation, (i.e.,zoo::na.spline()
withna.rm = FALSE
),tf_approx_none
in order to not inter-/extrapolate ever (i.e.,zoo::na.fill()
withfill = NA
)tf_approx_fill_extend
for linear interpolation and constant extrapolation (i.e.,zoo::na.fill()
withfill = "extend"
)tf_approx_locf
for "last observation carried forward" (i.e.,zoo::na.locf()
withna.rm = FALSE
andtf_approx_nocb
for "next observation carried backward" (i.e.,zoo::na.locf()
withna.rm = FALSE, fromLast = TRUE
).
For implementing your own, see source code of tf:::zoo_wrapper
.
Usage
tf_approx_linear(x, arg, evaluations)
tf_approx_spline(x, arg, evaluations)
tf_approx_none(x, arg, evaluations)
tf_approx_fill_extend(x, arg, evaluations)
tf_approx_locf(x, arg, evaluations)
tf_approx_nocb(x, arg, evaluations)
Arguments
- x
new
arg
values to approximate/interpolate/extrapolate the function for- arg
the
arg
values of theevaluations
- evaluations
the function values at
arg
Value
a vector of values of the function defined by the given
\((x_i, f(x_i))\)=(arg, evaluations)
-tuples at new argument values x
.
See also
tfd
Other tidyfun inter/extrapolation functions:
tf_evaluate()
,
tf_interpolate()
Other tidyfun inter/extrapolation functions:
tf_evaluate()
,
tf_interpolate()
Other tidyfun inter/extrapolation functions:
tf_evaluate()
,
tf_interpolate()
Other tidyfun inter/extrapolation functions:
tf_evaluate()
,
tf_interpolate()
Other tidyfun inter/extrapolation functions:
tf_evaluate()
,
tf_interpolate()
Other tidyfun inter/extrapolation functions:
tf_evaluate()
,
tf_interpolate()