## ----eval=FALSE---------------------------------------------------------------
# post <- post_nonlinear(fit, mode=2)
# vcov(post)                         # Natural fixed/curve covariance
# vcov(post, type="conditional")     # Conditional mode covariance
# vcov(post, type="random")          # Empirical Bayes approximate PEV
# confint(post)                      # Working-normal, positive curves transformed
# predict(post, newdata=dat, interval="confidence", cov.fit=TRUE)
# predict(post, newdata=dat, re.form="population", interval="prediction")

## ----eval=FALSE---------------------------------------------------------------
# ctrl <- mmes_control(diagnostics=list(profile="force"))
# fit <- mmes(y~0+curve_term("curve"), random=~group, data=dat,
#   curves=list(curve=nonlinear_curve("time")),
#   method=mmes_method(objective="ml"), control=ctrl)
# profile <- profile_nonlinear(fit, replications=3L)
# profile$table
# fit$executionPlan$dimensions
# fit$executionPlan$memory

## ----eval=FALSE---------------------------------------------------------------
# control <- mmes_control(
#   solve = list(method = "cholmod"),
#   curvature = list(assembly = "augmented-working"),
#   diagnostics = list(profile = "force")
# )
# fit <- mmes(y ~ environment, random = ~ id, data = dat, control = control)
# fit$engineDiagnostics$aiAssembly
# fit$executionPlan$admission$aiAssembly

## ----eval=FALSE---------------------------------------------------------------
# fit <- mmes(
#   response ~ locale + cell,
#   data = observations,
#   control = mmes_control(representation = list(fixedRank = "drop"))
# )
# fit$fixedRank[c("rank", "retained", "omitted")]
# summary(fit)$betas

## ----eval=FALSE---------------------------------------------------------------
# cells <- predict(fit, D = "locale:cell", observed = TRUE)
# cells$observed

## ----eval=FALSE---------------------------------------------------------------
# rules <- fit$Dtable
# rules$include[rules$type == "random"] <- TRUE
# conditional <- predict(fit, D = "locale:cell", observed = TRUE, Dtable = rules)

