Re: Multivariate-T Simulation Problem
- To: mathgroup at smc.vnet.net
- Subject: [mg39008] Re: [mg38986] Multivariate-T Simulation Problem
- From: Dr Bob <drbob at bigfoot.com>
- Date: Fri, 24 Jan 2003 05:06:20 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
It's a SAMPLE variance, so almost anything can happen ONCE.
I'm not getting sample variances anything like that, though, so there could
be a bug in your version of Mathematica. I'm using version 4.2 with WinXP.
Also, you may as well look at the simulated covariance matrix,
CovarianceMatrix@Transpose@ET, rather than just the variance.
Bobby
On Thu, 23 Jan 2003 08:05:54 -0500 (EST), KyriakosChourdakis
<tuxedomoon at yahoo.com> wrote:
> Dear all,
>
> I am trying to simulate a multivariate t-distribution,
> and encounter the following problem:
>
> (* First load the packages *)
> <<Statistics`MultinormalDistribution`
> <<LinearAlgebra`MatrixManipulation`
>
> NS = 2; (* the number of series *)
> df = 20; (* the degrees of freedom - Since the number
> is large, it should make the t similar to a normal *)
>
> (* Create a random variance-covariance matrix *)
> rS0 = RandomArray[UniformDistribution[-0.30,
> 0.80],{NS, NS}];
> rS0 = rS0.Transpose[rS0];
> rS0 = (rS0/Max[rS0]) (1 - IdentityMatrix[NS]) + IdentityMatrix[NS];
>
> (* the var-covar matrix is *)
> rS0
> {{1, -0.290755},
> {-0.290755, 1 }}
>
> (* create 10000 draws of 2 dimensional vectors *)
> ET =
> Transpose[RandomArray[MultivariateTDistribution[rS0,
> df], 10000]];
>
> (* the theoretical cov matrix is ok, with
> var=df/[df-2]... *)
> ST = N[CovarianceMatrix[MultivariateTDistribution[rS0,
> df]]]
> {{1.11111, -0.323061}, {-0.323061, 1.11111}}
>
> (* ... But the simulated variance is not*)
> Mean /@ ET
> Variance /@ ET
> {-0.00426186, 0.00824351}
> {0.067534, 0.0670659}
>
> (* On the other hand, if I draw from the corresponding
> multinormal *)
> EN = Transpose[RandomArray[MultinormalDistribution[{0,
> 0}, ST], 10000]];
>
> (* Everything is OK *)
> Mean /@ EN
> Variance /@ EN
> {0.0196956, -0.00675908} (* Should be 0 *)
> {1.1362, 1.1099} (* Should be 1.111 *)
>
> I cannot understand why the simulated variance is
> 0.067 instead of 1.111/[20-2]. Alternatively, why
> should I multiply all values with sqrt(1.111/0.067)=4.
>
> Best,
>
> Kyriakos
>
>
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
>
--
majort at cox-internet.com
Bobby R. Treat