View source: R/derivModelMatrix.R
| derivModelMatrix | R Documentation |
Determine the derivatives of a model matrix.
derivModelMatrix(object, ...)
## Default S3 method:
derivModelMatrix(object, data, ...)
## S3 method for class 'gekm'
derivModelMatrix(object, ...)
## S3 method for class 'gekm'
model.matrix(object, ...)
object |
an object of an appropriate |
data |
a |
... |
further arguments, yet not used. |
derivModelMatrix makes use of the function deriv.
Accordingly, the calculation of derivatives is only possible for functions that are contained in the derivatives table of deriv.
Note, in contrast to model.matrix, factors are not supported.
The derivatives of the model (or design) matrix.
As in model.matrix there is an attribute "assign".
Carmen van Meegen
deriv for more details on supported arithmetic operators and functions.
model.matrix for construction of a design (or model) matrix.
## Several examples for the derivatives of a model matrix
dat <- data.frame(x1 = seq(-2, 2, length.out = 5))
model.matrix(~ 1, dat)
derivModelMatrix(~ 1, dat)
model.matrix(~ ., dat)
derivModelMatrix(~ ., dat)
model.matrix(~ . - 1, dat)
derivModelMatrix(~ . - 1, dat)
model.matrix(~ sin(x1) + I(x1^2), dat)
derivModelMatrix(~ sin(x1) + I(x1^2), dat)
dat <- cbind(dat, x2 = seq(1, 5, length.out = 5))
model.matrix(~ 1, dat)
derivModelMatrix(~ 1, dat)
model.matrix(~ .^2, dat)
derivModelMatrix(~ .^2, dat)
model.matrix(~ log(x2), dat)
derivModelMatrix(~ log(x2), dat)
model.matrix(~ x1:x2, dat)
derivModelMatrix(~ x1:x2, dat)
model.matrix(~ I(x1^2) * I(x2^3), dat)
derivModelMatrix(~ I(x1^2) * I(x2^3), dat)
model.matrix(~ sin(x1) + cos(x2) + atan(x1 * x2), dat)
derivModelMatrix(~ sin(x1) + cos(x2) + atan(x1 * x2), dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.