2%> Return a (set of) multivariate Uniform random vector(s),
3%> from within a hyper-ellipsoidal domain.<br>
6%> The returned random vectors are uniformly distributed
7%> within the hyper-ellipsoidal domain of the Uniform distribution.<br>
9%> \param[in] mean : The input vector of MATLAB ``real``,
10%> representing the mean of a Multivariate Uniform
11%> distribution in ``size(mean)`` dimensional space.<br>
12%> (**optional**.
default = ``[]``. It must be present
if ``cholow`` is missing.)
13%> \param[in] cholow : The input square matrix of MATLAB ``real``,
14%> representing the lower-triangle of the Cholesky
15%> factorization of the Gramian matrix of the target
16%> Multivariate Uniform distribution in ``numel(mean)`` dimensional space.<br>
17%> This argument can be obtained by passing the Gramian matrix ``gramian``
18%> of the distribution to the MATLAB intrinsic function ``chol(gramian,
"lower")``.<br>
19%> (**optional**.
default = ``[]``. It must be present
if ``mean`` is missing.)
20%> \param[in] s1 : The input vector of MATLAB ``real``,
21%> representing the mean of a Multivariate Uniform
22%> distribution in ``size(mean)`` dimensional space.<br>
23%> (**optional**.
default = ``1``)
26%> ``rand`` : The output vector of MATLAB ``real`` of
27%> shape ``(numel(mean), 1)`` containing a random vector
28%> from the specified Multivariate Uniform distribution.<br>
33%> rand = pm.stats.dist.mvu.getRand(mean)
34%> rand = pm.stats.dist.mvu.getRand([], cholow)
35%> rand = pm.stats.dist.mvu.getRand(mean, cholow)
36%> rand = pm.stats.dist.mvu.getRand([], cholow, s1)
37%> rand = pm.stats.dist.mvu.getRand(mean, cholow, s1)
44%> \include{lineno} example/stats/dist/mvu/
getRand/main.m
46%> \image html example/stats/dist/mvu/
getRand/mvu.getRand.hist1.png width=700
47%> \image html example/stats/dist/mvu/
getRand/mvu.getRand.hist2.png width=700
48%> \image html example/stats/dist/mvu/
getRand/mvu.getRand.scatter1.png width=700
53%> \JoshuaOsborne, May 21 2024, 4:03 AM, University of Texas at Arlington<br>
54%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
55%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
62 ndiminv = 1 / size(cholow, 1);
63 rand = randn(size(cholow, 1), s1);
65 rand(:, irand) = cholow * rand(:, irand) * (unifrnd(0, 1)^ndiminv / norm(rand(:, irand)));
68 ndiminv = 1 / numel(mean);
69 rand = randn(numel(mean), s1);
71 rand(:, irand) = rand(:, irand) * (unifrnd(0, 1)^ndiminv / norm(rand(:, irand)));
75 ndiminv = 1 / numel(mean);
76 rand = randn(numel(mean), s1);
78 rand(:, irand) = rand(:, irand) * (unifrnd(0, 1)^ndiminv / norm(rand(:, irand)));
82 rand = bsxfun(@plus, mean(:), rand);
function getRand(in ndim, in scale)
Generate and return a random positive-definite (correlation or covariance) matrix using the Gram meth...