Simple Partition
simpart
partitions a d-dimensional sample space into two
orthonormal subspaces: a simpledim
-dimensional nearly null
space and a (d-simpledim)-dimensional
model space. It provides an orthonormal basis for each subspace. The
nearly null space basis is defined in terms of a simplicity measure
and is ordered from most simple to least simple. The model space basis
is made up of leading eigenvectors of the covariance matrix and is
ordered by proportion of variance explained.
Returns the result as an object of class simpart
.
simpart(y, simpledim, ...) ## S3 method for class 'formula' simpart(formula, simpledim, data = NULL, ...) ## Default S3 method: simpart(y, simpledim, measure = c('first', 'second', 'periodic'), x = seq(d), cov=FALSE, reverse=rep(FALSE, d), na.action, ...)
formula |
a formula with no response variable, referring only to numeric variables. |
y |
a matrix or data frame that specifies the data, or a covariance matrix. Data matrix has d columns, covariance matrix is d x d. |
simpledim |
the dimension of the nearly null space of the covariance matrix. It is equal to d minus the dimension of the model space. |
measure |
a function that calculates a simplicity measure of a vector, based
on a non-negative definite symmetric matrix Lambda. There are three
built in simplicity measures, specified by 'first', 'second', or
'periodic' that correspond to first divided difference, second
divided difference and periodic simplicity respectively. The
argument |
data |
an optional data frame (or similar: see |
x |
a vector of independent variable values (for functional data),
length equal to d, the number of columns of |
cov |
a logical value. If true, then |
reverse |
a logical vector of length d. If the i-th element is true, the i-th
basis vector is "reversed" by multiplication by -1. Basis vectors
are arranged with model basis first, then simplicity basis. If
length of |
na.action |
specify how missing data should be treated. |
... |
arguments passed to or from other methods. If |
simpart
is a generic function with "formula"
and
"default"
methods.
simpart
implements a method described in Gaydos et al (2013).
When cov=FALSE
, the covariance matrix is calculated using the
data matrix y
. The calculation uses divisor n, the number
of rows of y
.
simpart
returns a list with class "simpart"
containing
the following components:
model |
a d x (d-simpledim) matrix with columns containing the basis of the model space, that is, containing the first (d-simpledim) eigenvectors of the covariance matrix. Basis vectors are arranged in descending order of eigenvalue, that is, in descending order of the proportion of variance explained. |
simple |
d x simpledim matrix with columns containing the simplicity basis of the nearly null space. Basis vectors are arranged in descending order of simplicity. |
variance |
list of three components:
|
simplicity |
list of three components:
|
call |
the matched call |
measure |
the simplicity measure used: |
varperc |
the percent of variance explained by the corresponding basis vector, as a list of two components:
|
scores |
if |
The simplicity values of the simplicity basis when simpledim=d
are equal to the eigenvalues of the non-negative definite matrix,
Lambda, that defines the simplicity measure.
T.L. Gaydos, N.E. Heckman, M. Kirkpatrick, J.R. Stinchcombe, J. Schmitt, J. Kingsolver, J.S. Marron. (2013). Visualizing genetic constraints. Annals of Applied Statistics 7: 860-882.
library(prinsimp) require(graphics) ## Caterpillar data: estimated covariance from Kingsolver et al (2004) ## Measurements are at temperatures 11, 17, 23, 29, 35, 40 data(caterpillar) ## Analyze 5 dimensional model space, 1 dimensional nearly null space ## First divided difference simplicity measure simpart(caterpillar, simpledim=1, cov=TRUE) # Need to specify x simpart(caterpillar, simpledim=1, x=c(11, 17, 23, 29, 35, 40), cov=TRUE) ## Second divided difference simplicity measure and 3-dimensional model space simpart(caterpillar, simpledim=3, measure="second", x=c(11, 17, 23, 29, 35, 40), cov=TRUE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.