Improve the interface with a theta() constructor. Looks like list(…) but evaluates lazily and checks specified names, and applies as.theta, etc.
start.theta <-
list(m = 3,
d = 4,
pie = c(1,1,1)/3,
mu = list(comp1 = rep(0, 4), comp2 = c(1,0,0,0), comp3 = c(0,1,0,0)),
sigma = replicate(3, diag(4), simplify = FALSE))
start.theta <- as.theta(start.theta)
Improve the interface with a theta() constructor. Looks like list(…) but evaluates lazily and checks specified names, and applies as.theta, etc.
Code like this is annoying: