normalize | R Documentation |
This function produces a normalized series using conditional moments.
normalize(data, y, fit_mean, fit_var)
data |
a tsibble containing all the time series which are uniquely identified by the corresponding Timestamp. |
y |
The variable name |
fit_mean |
Model object of class "conditional_moment" returned from
|
fit_var |
Model object of class "conditional_moment" returned from
|
A vector of conditional normliased series
data <- NEON_PRIN_5min_cleaned |>
dplyr::filter(site == "upstream") |>
dplyr::select(Timestamp, turbidity, level, conductance, temperature) |>
tsibble::as_tsibble(index = Timestamp)
fit_mean <- data |>
conditional_mean(turbidity ~ s(level, k = 8) +
s(conductance, k = 8) + s(temperature, k = 8))
fit_var <- data |>
conditional_var(
turbidity ~ s(level, k = 7) + s(conductance, k = 7) + s(temperature, k = 7),
family = "Gamma",
fit_mean = fit_mean
)
new_ts <- data |>
dplyr::mutate(ystar = conduits::normalize(data, turbidity, fit_mean, fit_var))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.