bind_probs: Stack Flexible Probabilities

View source: R/bind_probs.R

bind_probsR Documentation

Stack Flexible Probabilities

Description

This function mimics dplyr bind. It's useful if you have different ffp objects and want to stack them in the tidy (long) format.

Usage

bind_probs(...)

Arguments

...

ffp objects to combine.

Value

A tidy tibble.

The output adds two new columns:

  • rowid (an integer) with the row number of each realization;

  • key (a factor) that keeps track of the ffp inputs as separated objects.

See Also

crisp exp_decay kernel_normal kernel_entropy double_decay

Examples

library(ggplot2)
library(dplyr, warn.conflicts = FALSE)

x <- exp_decay(EuStockMarkets, lambda = 0.001)
y <- exp_decay(EuStockMarkets, lambda = 0.002)

bind_probs(x, y)

bind_probs(x, y) %>%
  ggplot(aes(x = rowid, y = probs, color = fn)) +
  geom_line() +
  scale_color_viridis_d() +
  theme(legend.position="bottom")

ffp documentation built on Sept. 29, 2022, 5:10 p.m.