guess_error_sd_from_residuals: Safe initialization of guess for error prior

View source: R/tulip.R

guess_error_sd_from_residualsR Documentation

Safe initialization of guess for error prior

Description

Use the MAD of the residuals if possible, else the MAD of the time series y else the fallback.

Usage

guess_error_sd_from_residuals(residuals, y, fallback = 1)

Arguments

residuals

Residuals of some initial fit, usually returned by initialize_states()

y

The time series for which we guess the standard deviation of the residual error

fallback

A fallback value that is used when both residuals and y return unusable values

Value

A strictly positive scalar


timradtke/heuristika documentation built on April 24, 2023, 1:55 a.m.