Learn R Programming

ffp (version 0.2.2)

crisp: Full Information by Market Conditioning

Description

Give full weight to occurrences that satisfies a logical condition.

Usage

crisp(x, lgl)

# S3 method for default crisp(x, lgl)

# S3 method for numeric crisp(x, lgl)

# S3 method for matrix crisp(x, lgl)

# S3 method for ts crisp(x, lgl)

# S3 method for xts crisp(x, lgl)

# S3 method for data.frame crisp(x, lgl)

# S3 method for tbl_df crisp(x, lgl)

Value

A numerical vector of class ffp with the new probabilities distribution.

Arguments

x

An univariate or a multivariate distribution.

lgl

A logical vector with TRUE's and FALSE's indicating which scenarios should considered.

See Also

exp_decay kernel_normal

Examples

Run this code
library(ggplot2)
# invariance (stationarity)
ret <- diff(log(EuStockMarkets))

# full weight on scenarios where CAC returns were above 2%
market_condition <- crisp(x = ret, ret[ , 3] > 0.02)
market_condition

autoplot(market_condition) +
  scale_color_viridis_c()

Run the code above in your browser using DataLab