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, ...)
"simpart"(formula, simpledim, data = NULL, ...)
"simpart"(y, simpledim, measure = c('first', 'second', 'periodic'), x = seq(d), cov=FALSE, reverse=rep(FALSE, d), na.action, ...)
measure
can take a user specified function.
model.frame
)
containing the variables in the formula formula
. By default
the variables are taken from environment(formula)
.
y
. If not
supplied, a sequence from 1 to $d$ is used.
y
is assumed to be a $d x d$ covariance matrix. If false, y is assumed to be an
$n x d$ data matrix which simpart
uses to
calculate a $d x d$ covariance matrix.
reverse
is less than d, then the remaining entries
of reverse
are assumed to be false, and the corresponding
basis vectors remain unchanged.
x
is a formula
one might specify cov
or reverse
. If "periodic"
is chosen as the measure
, period is specified as a numeric.
If measure
is user specified, its arguments are passed here.
simpart
returns a list with class "simpart"
containing
the following components:simpledim=d
."first"
, "second"
,
"periodic"
or an user specified measure function
y
is the data matrix, the scores on the basis vector
loadings.
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
.
summary.simpart
, plot.simpart
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)
Run the code above in your browser using DataLab