mhunter1 / dynr

Dynamic Modeling in R
5 stars 6 forks source link

Create non-matrix function for prep.noise #170

Open mhunter1 opened 7 years ago

mhunter1 commented 7 years ago

Original report by Michael Hunter (Bitbucket: mhunter, GitHub: mhunter).


Many users do not like or understand the matrix interface. This would be a function that creates common structures for the noise matrices.

Proposal 1

easy.noise(
    latent=c('Iden', 'Symm', 'Diag', 'Scalar', 'Zero'),
    observed=c('Iden', 'Symm', 'Diag', 'Scalar', 'Zero'),
    numLatent,
    numObserved,
    latentRegime,
    observedRegime)

See this page for more possible covariance structures.

The arguments could take lists of characters (or even vectors) for regime switching. We'd have to have some kind of system for indicating if the free params are equal or different across regimes. A prototype for this is in the latentRegime and observedRegime arguments. These would be something like

latentRegime = c('a', 'a', 'b') # Three regimes.  First two regimes have the same latent cov
observedRegime = c(1, 2, 3) # Three regimes.  All different observed cov

We'd also need a way to indicate the size of the latent and observed matrices. A proposal is given as numLatent and numObserved.

A similar function could be designed for initial conditions, but that should be a separate issue.

The naming here is easy.*(). It might be nice to play on getting dinner from take-out, as oppose to home cooked: take.noise(), order.noise(), fast.noise(), togo.noise()?

mhunter1 commented 7 years ago

Original comment by Michael Hunter (Bitbucket: mhunter, GitHub: mhunter).


Make prototype for non-matrix noise function

re issue #170