# NOT RUN {
# Not run as function relies on large arrays of likelihoods
# RUN THE FILTER STEP
f <- hmm.filter(g, L, K1, K2, maskL=T, P.final, minBounds = bnd)
nllf <- -sum(log(f$psi[f$psi>0])) # negative log-likelihood
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab