x <- function(...) {
str(PrepareModel(...))
cat("--------------------------------
")
str(convert.to.readable(PrepareModel(...)))
}
model <- list(list(model="whi", kappa=5, var=2, s=4), "+",
list(model="whi", kappa=1, var=3, s=0)) ## s=0 should not be used only in
## a model definition where the parameters are
## are given in a matrix, see the result
x(model=model, ti=1, me="ci")
## since convert.to.readable performs a one-step simplification,
## iterative calls may further simplify the model
xx <- convert.to.readable(PrepareModel(model=model, ti=1, me="ci"))
x(model=xx$mo, pa=xx$pa, ti=1, me=xx$me)
## back to the matrix definition of nested models
str(convert.to.readable(PrepareModel(xx, ti=1), allowed="nested"))
## back to the (correct) list definition
str(convert.to.readable(PrepareModel(xx, ti=1), allowed="list"))Run the code above in your browser using DataLab