%ranmvkron(S,X) fn compared to similar fn in R
%ranmvkron(S,X) fn compared to similar fn in R
Hi,
In the %ranmvkron(S,X) fn, the dimensions of S are n*n and X is k*k and returns a draw of dimension n*k.
When I compare this with functions used for drawing from mv normal distribution in R. I find the row dimension needs to be same for mu and sigma. Like for the below fn in R:
https://stat.ethz.ch/R-manual/R-devel/l ... rnorm.html
mu will be a k*1 vector and sigma will be a square covariance matrix of dimesion k.
In the %ranmvkron(S,X) fn, the dimensions of S are n*n and X is k*k and returns a draw of dimension n*k.
When I compare this with functions used for drawing from mv normal distribution in R. I find the row dimension needs to be same for mu and sigma. Like for the below fn in R:
https://stat.ethz.ch/R-manual/R-devel/l ... rnorm.html
mu will be a k*1 vector and sigma will be a square covariance matrix of dimesion k.
Re: %ranmvkron(S,X) fn compared to similar fn in R
I'm assuming that there's no similar function in R. What you're looking at in R is going to be similar to the %RANMVNORMAL (which draws a mean zero vector, so you add the mean vector separately). %RANMVKRON is a specialized routine which takes advantage of the structure of Kroneker products to substantially speed up draws for VAR's. See
https://estima.com/docs/RATS%209%20User ... f#page=533
Note that neither of the two components is the mean---their Kroneker product forms a factor of the covariance matrix of the random variable.
https://estima.com/docs/RATS%209%20User ... f#page=533
Note that neither of the two components is the mean---their Kroneker product forms a factor of the covariance matrix of the random variable.
Re: %ranmvkron(S,X) fn compared to similar fn in R
Is there a way to see the routine behind this.
I believe its not similar to kronecker fn in R
https://stat.ethz.ch/R-manual/R-devel/l ... ecker.html
I believe its not similar to kronecker fn in R
https://stat.ethz.ch/R-manual/R-devel/l ... ecker.html
Re: %ranmvkron(S,X) fn compared to similar fn in R
Needless to say, we don't support R and it's not clear how the C code could help anyway. Just work out the matrix algebra for (A (x) B)u; there's a lot of reusable calculations.