Description Usage Arguments Details Value Author(s) References Examples
Generate one or more samples from the two or more specified multivariate normal distributions.
1 2 3 4 5 6 7 8 9 |
n |
the number of samples per population required |
np |
the number of populations to be sampled from |
means |
a list of vectors specifying the means of the variable for each populations |
covs |
a matrix or a list of matrices specifying the covariance matrices of the variables. Each matrix should be positive-definite and symmetric. |
clip.sd |
an integer specifying the cutoff value of standard score. The standard score of a generated sample exceeding this value should be truncated. Default to |
tol |
tolerance (relative to largest variance) for numerical lack of positive-definiteness in |
empirical |
logical. If true, |
seed |
an integer internally supplied as |
response.acc |
an optional numeric value between 0 and 1, specifying the classification accuracy of a hypothetical observer. See ‘Details’. Default to |
This function is essentially a wrapper to the mvrnorm
function in MASS
package.
If the optional response.acc
argument is supplied, hypothetical random classification responses with specified accuracy will be generated.
a data frame containing a column of numeric category labels and column(s) of sampled values for each variable, and optionally, a column of hypothetical responses.
Author of the original Matlab routines: Leola Alfonso-Reese
Author of R adaptation: Kazunaga Matsuki
Alfonso-Reese, L. A. (2006) General recognition theory of categorization: A MATLAB toolbox. Behavior Research Methods, 38, 579-583.
1 2 3 4 5 6 7 8 9 | m <- list(c(268,157), c(332, 93))
covs <- matrix(c(4538, 4351, 4351, 4538), ncol=2)
II <- grtrnorm(n=80, np=2, means=m, covs=covs)
m <- list(c(283,98),c(317,98),c(283,152),c(317,152))
covs <- diag(75, ncol=2, nrow=2)
CJ <- grtrnorm(n=c(8,16,16,40), np=4, means=m, covs=covs)
CJ$category <- c(1,1,1,2)[CJ$category]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.