Skip to content

Commit ce43aed

Browse files
committed
Fix a singularity edge-case, fixes #18
1 parent f243ee3 commit ce43aed

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ Changes in Version 1.5-4-1.0.3
22

33
o Fix an edge-case in breakpoints.matrix() that resulted in an unhelpful error
44
when h = 0.5, and improve the error and warning messages in the function.
5+
o Fix another edge-case where breakpoints() crashes when confidence intervals
6+
cannot be calculated due to singularities.
57

68
Changes in Version 1.5-4-1.0.2
79

R/breakpoints.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ confint.breakpointsfull <- function(object, parm = NULL, level = 0.95, breaks =
604604
else phi2 <- sqrt(sigma2)
605605

606606
p0 <- pargmaxV(0, phi1 = phi1, phi2 = phi2, xi = xi)
607-
if(is.nan(p0) || p0 < a2 || p0 > (1-a2)) {
607+
if(!is.finite(p0) || p0 < a2 || p0 > (1-a2)) {
608608
warning(paste("Confidence interval", as.integer(i-1),
609609
"cannot be computed: P(argmax V <= 0) =", round(p0, digits = 4)))
610610
upper[i-1] <- NA

0 commit comments

Comments
 (0)