Skip to contents

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)

# S3 method for default
kernel_entropy(x, mean, sigma = NULL)

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

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

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

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

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

# S3 method for 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.

See also

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
#> <ffp[1859]>
#> 0.0009255605 0.000599916 0.0001537338 0.0004681907 0.000614085 ... 3.258238e-05

autoplot(ke) +
  scale_color_viridis_c()