Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

simulate_nlme_one

Simulate fitted values from an object of class nlme


Description

This function is based on predict.nlme function

Usage

simulate_nlme_one(
  object,
  psim = 1,
  level = Q,
  asList = FALSE,
  na.action = na.fail,
  naPattern = NULL,
  data = NULL,
  ...
)

Arguments

object

object of class nlme

psim

parameter simulation level, 0: for fitted values, 1: for simulation from fixed parameters (assuming a fixed vcov matrix), 2: for simulation considering the residual error (sigma), this returns data which will appear similar to the observed values

level

level at which simulations are performed. See predict.nlme. An important difference is that for this function multiple levels are not allowed.

asList

optional logical value. See predict.nlme

na.action

missing value action. See predict.nlme

naPattern

missing value pattern. See predict.nlme

data

the data argument is needed when using this function inside user defined functions.

...

additional arguments to be passed (possible to pass newdata this way)

Details

It uses function mvrnorm to generate new values for the coefficients of the model using the Variance-Covariance matrix vcov

Value

This function should return a vector with the same dimensions as the original data, unless newdata is provided.


nlraa

Nonlinear Regression for Agricultural Applications

v0.89
GPL-3
Authors
Fernando Miguez [aut, cre] (<https://orcid.org/0000-0002-4627-8329>), José Pinheiro [ctb, cph] (author of nlme::nlsList, nlme::predict.gnls, nlme::predict.nlme), Douglas Bates [ctb, cph] (author of nlme::nlsList, nlme::predict.gnls, nlme::predict.nlme), R-core [ctb, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.