Created
August 11, 2016 19:42
-
-
Save tdhock/e2128057c13194a3455a5e465221310a to your computer and use it in GitHub Desktop.
Bug in Segmentor3IsBack package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
works_with_R("3.2.3", Segmentor3IsBack="2.0") | |
data.vec <- c(1, 2, 2) | |
Segmentor(data.vec, Kmax=3, model=1) | |
mean.vec.list <- list( | |
"1 segment"=rep(mean(data.vec), 3), | |
"2 segments"=data.vec, | |
"3 segments"=data.vec) | |
neg.log.lik.list <- list() | |
for(mean.vec.name in names(mean.vec.list)){ | |
mean.vec <- mean.vec.list[[mean.vec.name]] | |
neg.log.lik.list[[mean.vec.name]] <- | |
-sum(dpois(data.vec, mean.vec, log=TRUE)) | |
} | |
(neg.log.lik <- do.call(rbind, neg.log.lik.list)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The output I got on my machine was