View source: R/full_information.R
kernel_normal | R Documentation |
Historical realizations receive a weight proportional to their distance from a target mean.
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)
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. |
A numerical vector of class ffp
with the new
probabilities distribution.
crisp
exp_decay
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.