Description Usage Arguments Details Value Author(s) See Also Examples
Attach partial derivative and residual variance functions to the nonlinear fitted object
1 2 3 4 |
object |
the fitted nlme object |
form |
the formula used to fit the object, either formula or string used for automated derivation |
fDerivFixef |
|
fDerivRanef |
|
fVarResidual |
|
fAddDummies |
|
For usage with varPredictNlmeGnls
, this function attaches to the fitted object
derivative functions
residual variance function
Variance-Covariance methods
If proper basic formula is given, fDerivFixef
and fDerivRanef
will be automatically derived from the model.
Up until now, only single level random effects models are supported for automatic derivation.
item fAddDummies=function(newdata)
of restult entry varPrep
adds columns for dummy variables
of categorial variables to newdata.
Default implementation supports only (and assumes) contr.treatment
coding.
For other codings user must provide the function with argument fAddDummies
.
Providing no argument fResidual
assumes iid residuals, i.e. weights=NULL
.
For other residual variance models. See e.g. varResidPower
corresponding to weights=varPower(form=~fitted(.))
nfit with additional entry varPrep
, which is a list of
varFix |
variance-covariance matrix of fixed effects |
varRan |
variance-covariance matrix of random effects |
coefFix |
names of the fixed coefficients in gradiant function |
coefRan |
names of the random coefficients in gradiant function |
gradFix |
derivative function for fixed effects |
gradRan |
derivative function for random effects |
fAddDummies |
function to add dummy columns for categorial variables to predictor data frame |
fVarResidual |
function to calculate residual variance |
fullFormula |
the extended formula as a string |
Thomas Wutzler
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | data(modExampleStem)
#mtrace(.covarMap)
nfit <- attachVarPrep( modExampleStem, form = "b0*dbh^b1*height^b2")
data(Wutzler08BeechStem)
newdata=data.frame(dbh=18.8, height=16.9, age=40, si=30, alt=470)
(uNew <- nfit$varPrep$gradFix(newdata=newdata))
(wNew <- nfit$varPrep$gradRan(newdata=newdata))
newdata=head(Wutzler08BeechStem)
(uNew <- nfit$varPrep$gradFix(newdata=newdata))
(wNew <- nfit$varPrep$gradRan(newdata=newdata))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.