07-27-2009 08:57 PM
I am trying to use the random 'norm' function in Mathscript to randomly sample multivariate normal distribution (trivariate to be exact). I haven't worked much with Mathscript so I am fishing for a little help.
In the ideal world the code would function like MVNRND from Matlab
http://www.mathworks.com/access/helpdesk/help/toolbox/stats/index.html?/access/helpdesk/help/toolbox...://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla:en-US:official&hs=LcH&ei=HlpuSqOmCYPYM5rkveQC&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=mvnrnd+mathworks&spell=1
Where the inputs are
(1) the means
(2) the variance-covariance matrix
(3) the number of samples (cases)
Is this possible with the random 'norm' function in mathscript?
07-28-2009 01:32 AM
Hi JHourigan,
Unfortunately, random 'norm' in MathScript does not generate random number following a multivariate normal distribution. That function could return a matrix whose elemets, not vectors, follows a normal distribution.
07-28-2009 01:15 PM
It turns out there are several possible solutions to this problem using LabVIEW
(1) The TSA vector normal distribution VI in the LV 8.6 Advanced Signal Processing toolkit seems apporpriate, but I do not have the funds to upgrade.
(2) The 'mvnrnd' function could be called in a Matlab script node. This would require the target computers (once I compile this code as executable) would be required to have Matlab installed; however, one respondant to the thread below suggested that it might run on a Matlab run-time engine.
http://forums.ni.com/ni/board/message?board.id=170&message.id=427321#M427321
(3) It turns out that Scilabs function grand 'mn' does the same thing as 'mvnrnd' in Matlab and can be invoked using a scilab script node package that can be downloaded and installed. Scilab is freeware, so it is not alot to ask potential users of my Labview executable to download and install this.
The block diagram is shown below. FYI all of this is for bootstrapping uncertainties.
07-28-2009 09:18 PM
You have some solutions. That's great!