inst/examples/dists/gamma/driver.R

library(hmmTMB)

# Simulate data -----------------------------------------------------------

# number of time steps
n <- 1000

# create an empty dataset
dat <- data.frame(ID = rep(0, n), y = rep(0, n))

# create true model 
true_mod <- HMM$new(file = "true_mod.hmm")

# simulate from true model
dat <- true_mod$simulate(n)

# Fit model ------------------------------------------------------------

# create model to fit 
mod <- HMM$new(file = "mod.hmm")

# fit model
mod$fit()

# look at numerical estimates
mod$par()

Try the hmmTMB package in your browser

Any scripts or data that you put into this service are public.

hmmTMB documentation built on Oct. 25, 2023, 1:07 a.m.