Dear sir, I would ask if there are in R some code to generate a random sample from a mvariate student distribution like that one wich generate the multivariate normal one i mean( rmvnorm(n, mu, sigma) Second question : if R can plot density 3Dcurve I don't mean de histogram but de hole density function(normal for example). I use a windows version of The R software Thank you in advance wiyh kind regard -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello Hicham, Wednesday, October 2, 2002, 11:28:03 AM, you wrote: HZ> Dear sir, HZ> I would ask if there are in R some code to generate a random sample HZ> from a mvariate student distribution like that one wich generate the HZ> multivariate normal one i mean( rmvnorm(n, mu, sigma) Try rt() function, type ?rt for help. HZ> Second question : if R can plot density 3Dcurve I don't mean de HZ> histogram but de hole density function(normal for example). I think sm.density function in sm package (available on CRAN) will do what you want. hope this helps Michal ~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~ Michal Bojanowski - mbojanowski at samba.iss.uw.edu.pl Polish General Social Survey Institute for Social Studies University of Warsaw http://www.iss.uw.edu.pl/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> From: bojaniss [mailto:bojaniss at poczta.onet.pl] > > Hello Hicham, > > Wednesday, October 2, 2002, 11:28:03 AM, you wrote: > > HZ> Dear sir, > HZ> I would ask if there are in R some code to generate a > random sample > HZ> from a mvariate student distribution like that one wich > generate the > HZ> multivariate normal one i mean( rmvnorm(n, mu, sigma) > > Try rt() function, type ?rt for help.That's _univariate_ t. Use the mvtnorm package for multivariate t distribution.> HZ> Second question : if R can plot density 3Dcurve I don't mean de > HZ> histogram but de hole density function(normal for example). > > I think sm.density function in sm package (available on CRAN) will > do what you want.That gives the kernel density estimate, given data. It's not clear what Hicham wants. If he wants the _true_ density of a multivariate t, he needs to contruct a grid (e.g., with expand.grid) and evaluate the multivariate t density on that grid, then use persp to draw the surface. Andy> hope this helps > > > Michal > > > ~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~ > > Michal Bojanowski - mbojanowski at samba.iss.uw.edu.pl > Polish General Social Survey > Institute for Social Studies > University of Warsaw > http://www.iss.uw.edu.pl/ > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. > -.-.-.-.-.-.-.-.- > r-help mailing list -- Read > http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: > r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. > _._._._._._._._._ >------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it. ============================================================================= -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Roger Koeneker wrote:> > rmvt <- function(corr,df)rmvnorm(n,sigma=corr)/sqrt(rchisq(n,df)/df)>That would do the trick. One interesting note relating to Hicham's original question (Hicham was the originator of this thread): The multivariate T distribution does not have elliptical contours. For example, the contours of an independent bivariate T are not circles. One of the many fascinating facts about the independent bivariate Normal distribution is that it is the ONLY independent bivariate distribution with circular contours. Many people may know this, but I know it was a surprise to me when I learned it. --Jim James A. Rogers <rogers at cantatapharm.com> Statistical Scientist Cantata Pharmaceuticals -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Timo (see below) was kind enough to reply in private that part of my comment was incorrect. As he points out, the joint distribution of two independent T distributions is NOT a multivariate T distribution in the usual sense. That distinction had not occured to me. I hope I do more good than harm by trying to learn in public... Jim -----Original Message----- From: Timo M?kel?inen [mailto:Timo.Makelainen at Helsinki.fi] Sent: Sat 10/5/2002 1:52 AM To: Jim Rogers Cc: Subject: Re: [R] T-Distribution On 4 Oct 2002, at 9:02, Jim Rogers wrote: > Roger Koeneker wrote: > > > > > rmvt <- function(corr,df) > rmvnorm(n,sigma=corr)/sqrt(rchisq(n,df)/df) > > > > That would do the trick. > > One interesting note relating to Hicham's original question (Hicham > was the originator of this thread): > > The multivariate T distribution does not have elliptical contours. For > example, the contours of an independent bivariate T are not circles. But this differs from common usage (and your formulae above): the multivariate T has dependent components and also ellipsoidal level surfaces (Raiffa & Schlaifer 1961, 1968, Section 8.3; there may be a problem with subsection 8.3.1, though). > One of the many fascinating facts about the independent bivariate > Normal distribution is that it is the ONLY independent bivariate > distribution with circular contours. Many people may know this, but I > know it was a surprise to me when I learned it. > > --Jim > > James A. Rogers <rogers at cantatapharm.com> > Statistical Scientist > Cantata Pharmaceuticals > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. > -.-.-.-.- r-help mailing list -- Read > http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", > or "[un]subscribe" (in the "body", not the subject !) To: > r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. > _._._._._ Best wishes, Timo Timo Makelainen, Department of Mathematics University of Helsinki, P.O. Box 4 FIN-00014 Helsinki Tel.: +358-9-19122863 Fax: +358-9-19123213 E-mail: Timo.Makelainen at Helsinki.Fi -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._