Skip to content

Fitting a HMM with multiple known states and TPM constraints #190

Answered by bmcclintock
MattIDCarter asked this question in Q&A
Discussion options

You must be logged in to vote

You're close, but the -100s should only be in the first row for beta0. Here's an extension of the #68 example with two known states, I think it will do what you want but please be sure to play around with it and verify:

#### Simulate some data
nbObs <- 1000
nbStates <- 4
stateNames <- c("haulout","surface","foraging","transit")
dist <- list(step="gamma",angle="vm",dive="beta",dry="beta")

Par <- list(step=c(1,1,1,10,0.5,0.5,0.5,2),
            angle=c(0,0,0,0,0.1,0.1,0.1,10),
            dive=c(1,1,10,10,10,10,1,1),
            dry=c(10,1,1,1,1,10,10,10))

beta <- matrix(-1.5,1,nbStates*(nbStates-1))

simDat <- simData(obsPerAnimal = nbObs,nbStates=nbStates,dist=dist,Par=Par,beta=beta,sta…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MattIDCarter
Comment options

Answer selected by MattIDCarter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants