Skip to content

Commit 9e518db

Browse files
committed
Fix issue with NULL handling in breakspoints.breakpointsfull
1 parent d459921 commit 9e518db

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: strucchangeRcpp
2-
Version: 1.5-4-1.0.1
2+
Version: 1.5-4-1.0.2
33
Title: Testing, Monitoring, and Dating Structural Changes: C++ Version
44
Authors@R: c(person(given = "Dainius", family = "Masiliunas", role = c("aut", "cre"),
55
email = "pastas4@gmail.com", comment = c(ORCID = "0000-0001-5654-1277")),

NEWS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Changes in Version 1.5-4-1.0.2
2+
3+
o Fix issue where breakpoints.breakpointsfull(breaks=NULL) would return
4+
one break when the optimal number of breaks is 0.
5+
o Update documentation of 'breakpoints' to note the special handling of
6+
the NULL value in breakpoints.breakpointsfull and the fact that the
7+
information criterion is configurable.
8+
19
Changes in Version 1.5-4-1.0.1
210

311
o Switch from deprecated arma::is_finite to member .is_finite (thanks to

R/breakpoints.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ breakpoints.breakpointsfull <- function(obj, breaks = c("BIC", "LWZ", "RSS", "al
220220
stop("Please enter an integer number of breaks")
221221
} else if (is.null(breaks)) {
222222
breaks <- length(obj$breakpoints)
223+
if (breaks == 1 && is.na(obj$breakpoints))
224+
breaks <- 0
223225
} else
224226
{
225227
breakstat <- match.arg(breaks)

man/breakpoints.Rd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
or a string specifying the information criterion to use to automatically determine
5454
the optimal number of breaks (see also \code{\link{logLik}}).
5555
\code{"all"} means the maximal number allowed by \code{h} is used.
56-
\code{NULL} is treated as the default of the \code{breakpoints} function (i.e. BIC).}
56+
In \code{breakpoints.breakpointsfull}, \code{NULL} extracts the optimal number of
57+
breaks as determined by the initial \code{breakpoints} call.}
5758
\item{data}{an optional data frame containing the variables in the model. By
5859
default the variables are taken from the environment which \code{breakpoints} is
5960
called from.}
@@ -137,7 +138,8 @@
137138
series properties and the associated RSS) but not the triangular RSS
138139
matrix and related extractor functions. The set of breakpoints which
139140
is associated by default with a \code{"breakpointsfull"} object is
140-
the minimum BIC partition.
141+
the partition determined by the information criterion defined by the
142+
\code{breaks} argument.
141143

142144
Breakpoints are the number of observations that are the last in one
143145
segment, it is also possible to compute the corresponding \code{breakdates}

0 commit comments

Comments
 (0)