Skip to content

Create a proper theta() constructor #42

@AEBilgrau

Description

@AEBilgrau

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:

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)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions