#' Generate a surrogate series by randomly shuffling the values
#' of the original time series.
#'
#' @param series The series for which to generate a surrogate.
#' @export random_surrogate
random_surrogate <- function(series) {
if (!is_valid_input(series)) {
rlang::abort("Surrogate generation failed. Input series is not valid!")
}
surrogate <- rEDM::make_surrogate_data(ts = series,
method = "random",
num_surr = 1)
return(as.numeric(surrogate))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.