I would like to generate thousands of distributions with respect to: VaR@5%=-7% and Median=0%.
A first idea:
- Choose a family, say the Gaussian one.
Estimate its parameters. This is straightforward for the Gaussian but let's write the general algorithm (see mpiktas' answer on Estimating a distribution based on three percentiles):
library(nleqslv) VaR_Threshold <- c(0.05,0.5) VaR_Value <- c(-0.07,0) ufn <- function(x,q) q-pnorm(VaR_Value, x[1],x[2]) usol <- nleqslv(c(0,1), ufn,q=VaR_Threshold) usol$x [1] -1.262016e-11 4.255698e-02 (estimated parameters) plot(x<-seq(-1,1,by=0.01),dnorm(x,usol$x[1],usol$x[2]),type="l",col=2) points(p<-VaR_Value,dnorm(p,usol$x[1],usol$x[2])) pnorm(VaR_Value,usol$x[1],usol$x[2]) [1] 0.05 0.50 (check)
So this is for the Gaussian family: one unique solution.
My question: is there a parametric family flexible enough to generate thousands of distributions with a given VaR and median? I tried with the stable distributions (4 parameters : 2 manually fixed + 2 optimized), in vain, probably because I don't master it...