simulate-mixedRegression-method: Simulation of hierarchical (mixed) regression model

Description Usage Arguments Examples

Description

Simulation of regression model y_{ij} = f(φ_j, t_{ij}) + ε_{ij}, φ_j\sim N(μ, Ω), ε_{ij}\sim N(0,γ^2\widetilde{s}(t_{ij})).

Usage

1
2
3
## S4 method for signature 'mixedRegression'
simulate(object, nsim = 1, seed = NULL, t,
  plot.series = TRUE)

Arguments

object

class object of parameters: "mixedRegression"

nsim

number of data sets to simulate. Default is 1.

seed

optional: seed number for random number generator

t

vector of time points

plot.series

logical(1), if TRUE, simulated series are depicted grafically

Examples

1
2
3
4
5
6
mu <- 2; Omega <- 0.4; phi <- matrix(rnorm(21, mu, sqrt(Omega)))
model <- set.to.class("mixedRegression",
   parameter = list(phi = phi, mu = mu, Omega = Omega, gamma2 = 0.1),
   fun = function(phi, t) phi*t, sT.fun = function(t) t)
t <- seq(0, 1, by = 0.01)
data <- simulate(model, t = t, plot.series = TRUE)

BaPreStoPro documentation built on May 2, 2019, 3:34 p.m.