{ From user Lonnie, Model Multivariate_distrib at Tue, Nov 11, 2008 1:59 PM~~ } Softwareversion 4.2.0 Linklibrary Multivariate_distrib Title: Multivariate Distributions Description: A library of multivariate distributions.~ ~ In a multivariate distribution, each sample is a vector. This vector~~ is identified by an index, identified by the I parameter of the func~~ tions in this library. A Mid value from a distribution function will~~ therefore be indexed by I, whlie a Sample from a distribution functi~~ on is indexed by both I and Run. These distribution functions can al~~ so be used from within the Random function to generate a single monte~~ -carlo sample, which will be indexed by I.~ ~ This library also contains functions for generating correlated distri~~ butions. Correlate_with, for example, allows you to generate a univa~~ rite distribution with an arbitrary marginal distribution that has a ~~ specified rank correlation with an arbitrary reference distribution. ~~ Several functions may be used for generating serial correlations, w~~ here each distribution along an index is correlated with the previous~~ point along that index. Author: Lonnie Chrisman, Ph.D.~ Lumina Decision Systems~ ~ With contributions by:~ John Bowers, US FDA.~ Max Henrion, Lumina Decision Systems Date: Fri, Aug 01, 2003 7:12 PM Saveauthor: Lonnie Savedate: Tue, Nov 11, 2008 1:59 PM Defaultsize: 48,24 Nodesize: 56,24 Nodeinfo: 1,1,1,1,1,1,0,0,0,0 Diagstate: 1,42,10,649,1009,17 Windstate: 2,401,199,483,316 Fontstyle: Arial, 15 Fileinfo: 0,Linklibrary Multivariate_distrib,2,2,0,0,W:\Analytica\Exec~~ Debug\Libraries\Multivariate Distributions.ana Function Wishart( cv : Number[I,J,Run] ; n :positive ; I,J : Index ; ~ singleSampleMethod : optional hidden scalar) Title: Wishart(cv,n,I,J) Description: Suppose you sample N samples from a Gaussian(0,cv,I,J) di~~ stribution, X[I,R]. (R is the index that indexes each sample, R:=1..~~ N). The Wishart distribution describes the distribution of sum( X * ~~ X[I=J], R ). This matrix is dimensioned by I and J and is called the~~ scatter matrix. ~ ~ A sample drawn from the Wishart is therefore a sample scatter matrix.~~ If you divide that sample by (N-1), you have a sampled covariance m~~ atrix. ~ ~ If you compute a sample covariance matrix from data, and then want to~~ use this in your model, if you just use it directly, you'll be ignor~~ ing sampling error. That may be insignificant of N is large. Otherw~~ ise, you may want to use:~ Wishart( SampleCV, N, I, J) / (N-1)~ instead of just SampleCV in your model. The extended variance will ~~ account for the uncertainty from the finite sample size that was used~~ to obtain your sample CV.~ ~ If you can express a prior probability on covariances in the form of ~~ an InvertedWishart distribution, then the posterior distribution, aft~~ er having computed the sample covariance matrix (assumed to be drawn,~~ by nature, from a Wishart), is also an InvertedWishart. Definition: var T := if i