
Smooth a stack with a local-linear-trend Kalman smoother.
kalman_smooth.RdFits a per-pixel local-linear-trend Kalman filter and smoother over
the time axis and returns the smoothed level (and optionally its
standard error). Convenience wrapper: one scan_over() per
requested output, sharing one kalman_llt() parameterisation.
Usage
kalman_smooth(
x,
sigma_lvl,
sigma_slp,
sigma_obs = 1,
obs_var = NULL,
outputs = c("mean", "sd"),
dtype = "f32",
...
)Arguments
- x
Observation stack (
LazyRasterwith ataxis), or aLazyDataset(each band smoothed independently).- sigma_lvl, sigma_slp, sigma_obs
Noise standard deviations (level disturbance, slope disturbance, observation).
- obs_var
Optional relative observation-variance stack on the same grid (
Var(v_t) = sigma_obs^2 * obs_var_t).- outputs
Which outputs to build (
"mean","sd").- dtype
Output dtype (default f32).
- ...
Passed to
kalman_llt().
See also
hampel_smooth() for outlier removal, fill_gaps() for
simple gap filling, scan_over() for custom scans.