mt: Multivariate Student t Distribution

Description Usage Arguments Value Side Effects Background Note References See Also Examples

Description

Density and random number generation for the multivariate Student t distribution.

Usage

1
2
3
4
dmt(x, df=stop("'df' argument is missing, with no default"), 
    mm=rep(0, length(x)), cov=diag(rep(1, length(x))))
rmt(n, df=stop("'df' argument is missing, with no default"), 
    mm=rep(0, mult), cov=diag(rep(1, mult)), mult, is.chol=FALSE)

Arguments

x

a single multivariate observation. Missing values (NAs) are allowed.

n

the sample size. If length(n) is larger than 1, then length(n) random vectors are returned, bound together in a length(n) times mult matrix, where mult is the dimension of the multivariate variable.

df

the degrees of freedom. In rmt this is replicated to be of the same length than the number of deviates generated by rmt.

mult

the dimension of the multivariate Student t variate.

mm

a vector location parameter. The default is a vector of 0's.

cov

a square scale matrix. The default is the identity matrix.

is.chol

logical flag. If TRUE, the argument cov is the result from the Choleski decomposition of the original scale matrix.

Value

Returns the density (dmt) of or a random sample (rmt) from the multivariate Student t distribution on df degrees of freedom.

Side Effects

The function rmt causes creation of the dataset .Random.seed if it does not already exist, otherwise its value is updated.

Background

The multivariate Student t distribution is a real valued symmetric distribution centered at mm. It is defined as the ratio of a centred multivariate normal distribution with covariance matrix cov, and the square root of an independent Chi square distribution with df degrees of freedom subsequently translated by mm. (See Johnson and Kotz, 1976, par. 37.3, pg. 134ff.) The multivariate t distribution approaches the multivariate Gaussian (Normal) distribution as the degrees of freedom go to infinity.

Note

Elements of x that are missing will cause the corresponding elements of the result to be missing.

References

Johnson, N. L. and Kotz, S. (1976) Distributions in Statistics: Continuous Multivariate Distributions. New York: Wiley.

See Also

TDist, Normal, Random.

Examples

1
2
3
4
5
6
7
dmt(c(0.1, -0.4), df = 4, mm = c(1, -1))  
## density of a bivariate t distribution with 4 degrees of freedom 
## and centered at (1,-1)

rmt(n = 100, df = 5, mult = 4)  
## generates 100 replicates of a standard four-variate t distribution 
## with 5 degress of freedom

Example output

Loading required package: marg
Loading required package: statmod
Loading required package: survival

   Package "marg" 1.2-2 (2014-03-31) 
    Copyright (C) 2000-2014 A. R. Brazzale

 This is free software, and you are welcome to redistribute
 it and/or modify it under the terms of the GNU General
 Public License published by the Free Software Foundation.
 Package "marg" comes with ABSOLUTELY NO WARRANTY.

 type `help(package="marg")' for summary information


   Package "csampling" 1.2-2 (2014-03-31) 
    Copyright (C) 2000-2014 A. R. Brazzale

 This is free software, and you are welcome to redistribute
 it and/or modify it under the terms of the GNU General
 Public License published by the Free Software Foundation.
 Package "csampling" comes with ABSOLUTELY NO WARRANTY.

 type `help(package="csampling")' for summary information

           [,1]
[1,] 0.07371035
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -1.6510691  2.6519122 0.03130315  3.1741228 -1.1943972 -0.2772877
[2,]  0.4739886  0.2990193 0.99366197 -0.2496408 -0.4342124  0.3712476
[3,] -1.1440846 -1.2000409 0.41986936  0.8412134 -0.5835667  0.3881349
[4,] -0.6889033  0.6814757 0.66627465 -0.5405901  1.8912224  0.3228317
           [,7]       [,8]        [,9]       [,10]      [,11]      [,12]
[1,] -0.2431374  0.3676005  1.70551192 -0.08334539  2.7598447 -0.4619959
[2,]  2.4256245 -0.7865345  4.26629729  0.02651118 -3.8466396 -0.7934225
[3,] -0.4098513  0.6800088  0.01161636  2.89355416  0.6522042 -0.1813636
[4,] -0.2032295 -2.3744360 -1.71765707 -0.31059318 -1.6650533 -0.9258016
          [,13]       [,14]       [,15]       [,16]      [,17]      [,18]
[1,]  0.5073745 -1.01269083  1.17775177 -0.39049960 3.16536915 -0.6604465
[2,] -1.2448749  1.54468438 -0.04307064  0.06804313 0.79331888 -1.7833146
[3,] -1.1190500  0.09764659 -0.11650056 -0.37124111 0.04401563  0.2489496
[4,] -1.1034590 -0.51208465  0.37519271  1.67315772 0.29743960 -1.7722285
          [,19]      [,20]      [,21]      [,22]      [,23]       [,24]
[1,] 0.33050735 -0.2534777 -1.3655532 -1.7811962 -2.1824830 -0.52219624
[2,] 0.09422842 -1.6621997  0.6802780 -1.8561467  1.4131355 -0.08167431
[3,] 0.29095749 -1.9280891 -2.0865606  0.3644364 -0.3901742  0.13465605
[4,] 0.51387560  0.9687012  0.6672574  0.4648723 -0.3765141 -0.29269574
          [,25]      [,26]       [,27]      [,28]      [,29]      [,30]
[1,]  0.4229307  2.4007546  3.67334808  1.0497789 -0.2194606  1.0450768
[2,]  0.3865245  0.6779658  0.52421179  0.5104643  0.4245955 -0.6113526
[3,]  2.1076589 -1.0063525 -0.05647905  4.6373292  0.9019807 -1.0324729
[4,] -0.2944741 -0.3641187  0.11913193 -0.6424190  1.3022748 -0.2930532
         [,31]      [,32]       [,33]      [,34]       [,35]      [,36]
[1,] 1.3491808 -0.4492745  1.37562802 -0.6679410  0.88275167  1.0928494
[2,] 0.3720006 -0.1728343  0.09125178 -1.7207009 -0.63530292 -0.7504999
[3,] 0.3473656 -0.3294812 -1.31745344 -1.8786465 -0.08783677 -0.1955956
[4,] 0.4698410  0.4947499  1.21013271  0.4726193 -0.39660454 -2.1399709
          [,37]      [,38]      [,39]      [,40]      [,41]       [,42]
[1,] -0.4373386 -0.4099925 -1.3673293 -1.4280079 -0.3766324 -0.11223550
[2,] -0.8980361  0.9898248 -0.6965248  0.6248386 -0.8066396  0.86029694
[3,]  0.4214634 -1.8419922 -0.5041886 -0.4709267 -1.9962209  0.01647892
[4,]  0.9824242 -0.3595177 -0.2099638  1.9023174 -0.3775860  1.52173449
          [,43]       [,44]      [,45]       [,46]       [,47]      [,48]
[1,] 0.16769106 -0.08007273  0.6901580 -1.01151678  0.14436275 -1.3022784
[2,] 0.74534246  0.71995748  0.1920063  0.04417489 -0.09459481  1.1208110
[3,] 1.47264764 -0.18053289 -0.1915378  1.11515702  0.70307392 -0.4229516
[4,] 0.09363583  0.52824051  1.3523380 -0.01266131 -0.06586633  0.7446983
          [,49]      [,50]      [,51]     [,52]      [,53]      [,54]
[1,]  1.7254676  0.9402285 -4.5022248 2.2632305  0.2199848 -0.6472877
[2,] -0.3956249  1.5980926 -2.2040295 0.7643276 -0.1956220 -0.4399064
[3,] -1.4994892 -1.2079860 -0.1320272 0.5265254 -0.3540189 -0.5648491
[4,] -0.5436612  0.1414146  1.5225099 0.6643404  1.0310727  0.4844797
          [,55]       [,56]      [,57]       [,58]      [,59]      [,60]
[1,] -0.1369232  1.33949509 -0.8037633 -0.02356089 -1.1686346 -0.9351032
[2,]  1.3280638 -0.06123726 -1.3797465  1.35467269  3.0854956 -0.7319793
[3,] -2.1352039 -0.43881664 -0.1128113  0.63162838  0.8879956  3.3012596
[4,] -0.1681676 -0.55590455  0.8783203 -0.01553768  0.6754601 -0.5447985
          [,61]      [,62]      [,63]      [,64]        [,65]      [,66]
[1,] -0.9881328 -1.3217101 -0.2631397 -0.8166135  1.465493407  0.3354269
[2,]  0.5986959  1.3708247  0.3406151 -1.8651356 -0.003002213  0.6349155
[3,]  0.1195535 -0.5141424 -0.6685629 -0.4662524  0.496984202 -1.0087155
[4,] -0.1113936 -0.3358248 -1.7320443 -1.6562054  1.693228384 -0.3876002
          [,67]     [,68]      [,69]      [,70]       [,71]      [,72]
[1,] -1.5226182 0.4380019  0.8913616 -0.4551614 0.371782594  0.5162672
[2,]  0.6493148 0.1578547 -0.5432717  2.0207564 0.095237921  1.1607894
[3,] -2.0022981 0.6170733  0.2706101  0.1386314 0.005014721 -0.3670088
[4,] -0.7698531 1.0801724 -0.1647576  1.5062327 0.371680906  1.0307985
          [,73]      [,74]      [,75]      [,76]      [,77]      [,78]
[1,] -0.3606347 -0.1267295  0.5850967  5.3208690  1.1254751 -0.5759248
[2,]  0.3888936 -0.6433728 -0.3982021  0.0743603  0.3517205  1.0337542
[3,]  0.8870169 -0.3344633 -1.5339506 -0.1996525  0.7582362 -3.2533578
[4,] -1.1290570 -1.8223294  2.1509957 -0.8012300 -0.3570022  0.6883264
          [,79]      [,80]       [,81]      [,82]      [,83]     [,84]
[1,]  3.1819851 -1.4084352 -1.03345672  0.6371589  0.1790071  2.296024
[2,]  0.6909243 -0.4725662  0.93686139 -1.4862753 -1.2836009 -2.115662
[3,]  0.6490018  1.3749517 -0.01539485 -0.2171612 -0.7342085 -1.731348
[4,] -0.3432253  1.0660060 -0.74661629 -0.3243636  1.3606393  1.244201
          [,85]      [,86]      [,87]      [,88]       [,89]      [,90]
[1,] -2.3387744 -0.8762176 -0.2119280  1.1008720  1.74558709  0.1977104
[2,] -0.9566076 -1.5141273 -2.2597723 -0.7276607  0.09956215 -1.1101167
[3,]  7.8319404 -1.5324972  0.6750770  1.3226356 -1.58796336 -1.1105186
[4,] -0.3608383  1.0971291  0.8034581 -0.4555225  0.21027280 -2.7818078
          [,91]      [,92]      [,93]       [,94]      [,95]      [,96]
[1,] -0.8742876 -2.1042077 -0.5631524 -0.43136747 0.07695546 -1.1540957
[2,]  0.1544034 -2.5826888 -0.5705401 -0.18317195 0.40265277  0.4820896
[3,]  1.4130358  3.6236922  0.9232430  1.34572965 0.76697298  0.3883506
[4,] -0.2156004  0.9155029  0.1432396  0.03323186 4.64116131  0.2456098
           [,97]       [,98]      [,99]     [,100]
[1,] -0.75322589 -0.00131080  0.2811127  1.6728863
[2,]  0.34294355 -0.41093609 -0.8068621 -0.3213382
[3,]  0.02044793  0.30652701  0.9946953  1.2722344
[4,]  0.80616563  0.02760507  1.1840419 -0.6937467

csampling documentation built on May 2, 2019, 6:46 a.m.