s-news
[Top] [All Lists]

[S] Answer on how to sample correlated vectors

To: s-news@wubios.wustl.edu
Subject: [S] Answer on how to sample correlated vectors
From: Mark Tardiff <mtardiff@neptuneandco.com>
Date: Fri, 15 Sep 2000 10:17:46 -0600
Sender: owner-s-news@wubios.wustl.edu

Thanks to all who responded to my query. Rick Ditmars provided me with the most straightforward answer:

The function simulate.mv.matrix() in Environmental Stats for SPlus will generate correlated data using a matrix of rank correlation coefficients. Theoretical and/or empirical distributions can be used as well.

For those who don't have the Environmental Stats module and have the desire to write their own function, the algorithms are from Iman, R.L., and W.J. Conover. (1982). A Distribution-Free Approach to Inducing Rank Correlation Among Input Variables. Communications in Statistics--Volume B, Simulation and Computation, 11(3), 311-334.

One curiosity of the Splus programming environment emerged during my quest that I had not paid attention to in the past. Modules attach in position 2 of the search list, by default. Libraries attach at the bottom of the search list, by default. This didn't matter to me except that "Environmental Stats for SPlus" has several changed versions of Splus functions that have identical names. As an example, the rgamma function in Splus is different from the rgamma function in Environmental Stats for SPlus. Depending on whether you use module() or library() the outcome is different. Also, using "?" or help() will give the help file associated with the first version of the function encountered in the search list. Using the help index will give the help file for the Splus function, regardless of the search list.

I would be happier with unique function names, such as rgamma and rgamma.alt with help files that cross reference each other.

One final note, my slap shot is about like my ability to pose questions. So, I'm the "other" Mark Tardiff.
Mark Tardiff
Neptune and Company, Inc.
1505 15 th Street Suite B
Los Alamos, NM 87544
Phone: 505-662-0730, ext 12
Fax:  505-662-0500
mtardiff@neptuneandco.com

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>
  • [S] Answer on how to sample correlated vectors, Mark Tardiff <=