kernel_normal: Full Information by Kernel-Damping

View source: R/full_information.R

kernel_normalR Documentation

Full Information by Kernel-Damping

Description

Historical realizations receive a weight proportional to their distance from a target mean.

Usage

kernel_normal(x, mean, sigma)

## Default S3 method:
kernel_normal(x, mean, sigma)

## S3 method for class 'numeric'
kernel_normal(x, mean, sigma)

## S3 method for class 'matrix'
kernel_normal(x, mean, sigma)

## S3 method for class 'ts'
kernel_normal(x, mean, sigma)

## S3 method for class 'xts'
kernel_normal(x, mean, sigma)

## S3 method for class 'tbl_df'
kernel_normal(x, mean, sigma)

## S3 method for class 'data.frame'
kernel_normal(x, mean, sigma)

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.

Value

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

See Also

crisp exp_decay

Examples

library(ggplot2)

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

kn <- kernel_normal(ret, mean, sigma)
kn

autoplot(kn) +
  scale_color_viridis_c()

# A larger sigma spreads out the distribution
sigma <- var(diff(ret)) / 0.05
kn <- kernel_normal(ret, mean, sigma)

autoplot(kn) +
  scale_color_viridis_c()

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