crisp: Full Information by Market Conditioning

View source: R/full_information.R

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

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