# kernel_entropy: Partial Information Kernel-Damping In ffp: Fully Flexible Probabilities for Stress Testing and Portfolio Construction

 kernel_entropy R Documentation

## Partial Information Kernel-Damping

### Description

Find the probability distribution that can constrain the first two moments while imposing the minimal structure in the data.

### Usage

```kernel_entropy(x, mean, sigma = NULL)

## Default S3 method:
kernel_entropy(x, mean, sigma = NULL)

## S3 method for class 'numeric'
kernel_entropy(x, mean, sigma = NULL)

## S3 method for class 'matrix'
kernel_entropy(x, mean, sigma = NULL)

## S3 method for class 'ts'
kernel_entropy(x, mean, sigma = NULL)

## S3 method for class 'xts'
kernel_entropy(x, mean, sigma = NULL)

## S3 method for class 'tbl_df'
kernel_entropy(x, mean, sigma = NULL)

## S3 method for class 'data.frame'
kernel_entropy(x, mean, sigma = NULL)
```

### Arguments

 `x` An univariate or a multivariate distribution. `mean` A numeric vector in which the kernel should be centered. `sigma` The uncertainty (volatility) around the mean. When `NULL`, only the mean is constrained.

### Value

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

`double_decay`

### Examples

```library(ggplot2)

ret <- diff(log(EuStockMarkets[ , 1]))
mean <- -0.01 # scenarios around -1%
sigma <- var(diff(ret))

ke <- kernel_entropy(ret, mean, sigma)
ke

autoplot(ke) +
scale_color_viridis_c()
```

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