Learn R Programming

L1pack (version 0.52)

simulate.lad: Simulate responses from lad models

Description

Simulate one or more responses from the distribution corresponding to a fitted lad object.

Usage

# S3 method for lad
simulate(object, nsim = 1, seed = NULL, ...)

Value

For the "lad" method, the result is a data frame with an attribute

"seed". If argument seed is NULL, the attribute is the value of .Random.seed before the simulation was started.

Arguments

object

an object representing a fitted model.

nsim

number of response vectors to simulate. Defaults to 1.

seed

an object specifying if and how the random number generator should be initialized (‘seeded’). For the "lad" method, either NULL or an integer that will be used in a call to set.seed before simulating the response vectors. If set, the value is saved as the "seed" attribute of the returned value. The default, NULL will not change the random generator state, and return .Random.seed as the "seed" attribute, see ‘Value’.

...

additional optional arguments.

Author

Tymoteusz Wolodzko and Felipe Osorio

Examples

Run this code
fm <- lad(stack.loss ~ ., data = stackloss)
sm <- simulate(fm, nsim = 4)

Run the code above in your browser using DataLab