I'm trying to evaluate the PDF of a truncated multi-normal distribution. My distribution has 8 dimensions and each value must be ≥ 0.
ivalues = {1.03371, 0.617498, 1.26354, 0.855324, 0.408308, 0.158506, 1.70032,0.269946}
covariancematrix = IdentityMatrix[8]
truncate = Table[{0, \[Infinity]}, 8]
TruncatedDistribution[truncate,MultinormalDistribution[ivalues, covariancematrix]]
So I sampled one set of random values (rvalues) from this distribution using RandomVariate
rvalues= {1.13594, 0.641371, 1.31146, 0.915561, 0.327869, 0.225612, 1.44007, 0.268547}
Now I want to evaluate the PDF at rvalues
PDF[TruncatedDistribution[truncate,MultinormalDistribution[ivalues, covariancematrix]],
rvalues] // AbsoluteTiming
{0.150935, 0.00037916}
It takes about 0.15 seconds. Since I need to do a lot of this calculations (hundreds of thousands) mi script is runnnig very slow.
Is there any faster way of obtaining this PDF? Thanks