Description Usage Arguments Details Author(s) References See Also
Functional data analysis using functional principle components. The principal components are formed using orthogonalized spline basis.
1 | pfda(model, data = environment(model), ..., driver)
|
model |
a formula describing the model. |
data |
optional environment with variables in |
... |
optional arguments, see details. |
driver |
argument to force a driver function, see details for options. |
This is a generic function that interprets the formula into a principal component model. The driver
argument controls which function the data is passed to, and is inferred if omitted. This will be most useful when forcing a binary response model over a continuous.
The model
argument is a formula object that describes the variable and model that should be estimated. It uses unique special formula operators %&%
and %|%
. The following table gives the name of the driver an example formula, and any notes.
Name | Formula | Notes |
single.continuous | y ~ t %|% id + z1 + z2 | A single continuous response variable, x , as a function of t . |
single.binary | y ~ t %|% id | y should be a logical or factor. |
dual.continuous | y %&% z ~ t %|% id | Paired model where both responses are continuous |
dual.continuous | y %&% z ~ t %|% id | Paired model where y is a binary (logical or factor) variable |
additive | y ~ t %&% x %|% id + z1 + z2 | Paired model where y is a binary (logical or factor) variable |
where
y
denotes a response variable. If this is a binary variable this must be of class logical
or a 2 level factor
. If the binary drivers are used y
must be coercible into a binary form.
z
is the second variable in dual/paired models, and is always continuous.
t
the domain variable of the functions.
x
A second domain variable for the additive model.
id
is a factor
variable that specifies the subject IDs.
z1, z2, ...
are extra additive effect variables, only applies to the additive and the single continuous models.
The ...
argument is to hold the optional arguments that control the fit. All optional arguments have default values that are implied if the argument is omitted. The possible arguments are
knots
The knots for the basis functions. For the additive model the knots argument should be a list of length 2. The list can be named with the names the same as those in the mmodel
, but otherwise are taken in order. Alternatively, can be an object that has methods evaluate and penaltyMatrix, of a list with the already evaluated matrix and penalty matrix.
penalties
The penalties for the model. Takes precedence over the df
argument.
df
The penalties for the curves specified in terms of target degrees.
k
the number of principal components. Should be a vector of length 2 for dual and additive models.
control
List of arguments for controling the fit of the EM algorith. See pfdaControl
for details.
The penalties
and df
arguments should be vectors of length two for the single models the first being the penalty for the mean curve the second for the principal components. For the dual and additive models the arguments can be a vector or matrix the first two elements for the mean curves and the sencond for the principal components. This translates to, in terms of a 2 by 2 matrix, the rows for the variables and the columns for mean and principal component penalties.
Andrew Redd Maintainer: Andrew Redd <aredd at stat.tamu.edu>
Joint modelling of paired sparse functional data using principal components Lan Zhou; Jianhua Z. Huang; Raymond J. Carroll, Biometrika, 2008 95: 601-619
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.