# exp_decay: Full Information by Exponential Decay In ffp: Fully Flexible Probabilities for Stress Testing and Portfolio Construction

 exp_decay R Documentation

## Full Information by Exponential Decay

### Description

Exponential smoothing twists probabilities by giving relatively more weight to recent observations at an exponential rate.

### Usage

```exp_decay(x, lambda)

## Default S3 method:
exp_decay(x, lambda)

## S3 method for class 'numeric'
exp_decay(x, lambda)

## S3 method for class 'matrix'
exp_decay(x, lambda)

## S3 method for class 'ts'
exp_decay(x, lambda)

## S3 method for class 'xts'
exp_decay(x, lambda)

## S3 method for class 'data.frame'
exp_decay(x, lambda)

## S3 method for class 'tbl'
exp_decay(x, lambda)
```

### Arguments

 `x` An univariate or a multivariate distribution. `lambda` A `double` for the decay parameter.

### Details

The half-life is linked with the lambda parameter as follows:

• `HL = log(2) / lambda`.

For example: log(2) / 0.0166 is approximately 42. So, a parameter `lambda` of 0.0166 can be associated with a half-life of two-months (21 * 2).

### Value

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

`crisp` `kernel_normal` `half_life`

### Examples

```library(ggplot2)

# long half_life
long_hl <- exp_decay(EuStockMarkets, 0.001)
long_hl
autoplot(long_hl) +
scale_color_viridis_c()

# short half_life
short_hl <- exp_decay(EuStockMarkets, 0.015)
short_hl
autoplot(short_hl) +
scale_color_viridis_c()
```

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