crisp {ffp}R Documentation

Full Information by Market Conditioning

Description

Give full weight to occurrences that satisfies a logical condition.

Usage

crisp(x, lgl)

## Default S3 method:
crisp(x, lgl)

## S3 method for class 'numeric'
crisp(x, lgl)

## S3 method for class 'matrix'
crisp(x, lgl)

## S3 method for class 'ts'
crisp(x, lgl)

## S3 method for class 'xts'
crisp(x, lgl)

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

## S3 method for class 'tbl_df'
crisp(x, lgl)

Arguments

x

An univariate or a multivariate distribution.

lgl

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

Value

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

See Also

exp_decay kernel_normal

Examples

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()

[Package ffp version 0.2.2 Index]