
qtmvnorm.marginal(p,
interval = c(-10, 10),
tail = c("lower.tail","upper.tail","both.tails"),
n=1,
mean=rep(0, nrow(sigma)),
sigma=diag(length(mean)),
lower=rep(-Inf, length = length(mean)),
upper=rep( Inf, length = length(mean)),
...)
uniroot
.lower.tail
gives the quantile $x$ for which
$P[X \le x] = p$, upper.tail
gives $x$ with
$P[X > x] = p$ and
bot
corr
or
sigma
can be specified. If sigma
is given, the
problem is standardized. If neither corr
nor
s
rep(-Inf, length = length(mean))
.rep( Inf, length = length(mean))
.uniroot
.quantile
and f.quantile
give the location of the quantile and the value of the function
evaluated at that point. iter
and estim.prec
give the number
of iterations used and an approximate estimated precision from
uniroot
.uniroot
function which may result in limited accuracy of the
quantiles.ptmvnorm
, pmvnorm
# finite dimensional distribution of the Geometric Brownian Motion log-returns
# with truncation
# volatility p.a.
sigma=0.4
# risk free rate
r = 0.05
# n=3 points in time
T <- c(0.5, 0.7, 1)
# covariance matrix of Geometric Brownian Motion returns
Sigma = sigma^2*outer(T,T,pmin)
# mean vector of the Geometric Brownian Motion returns
mu = (r - sigma^2/2) * T
# lower truncation vector a (a<=x<=b)
a = rep(-Inf, 3)
# upper truncation vector b (a<=x<=b)
b = c(0, 0, Inf)
# quantile of the t_1 returns
qtmvnorm.marginal(p=0.95, interval = c(-10, 10), tail = "lower.tail", n=1,
mean = mu, sigma = Sigma, lower=a, upper=b)
Run the code above in your browser using DataLab