Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brokenstick() ignores the last observation #10

Open
stefvanbuuren opened this issue Apr 9, 2024 · 1 comment
Open

brokenstick() ignores the last observation #10

stefvanbuuren opened this issue Apr 9, 2024 · 1 comment

Comments

@stefvanbuuren
Copy link
Member

The default setting in for the Boundary.knots argument of brokenstick() (2.5.0) ignores the data in the last, rightmost observation in a specific situation.

The default Boundary.knots are set as follows (from the JSS paper):

These conditions require that Boundary.knots span at least the range of the data. This requirement is easy to achieve by setting Boundary.knots = range(data$age), which is done by default. Also, we need to ensure that the range of knots is not outside Boundary.knots. We may achieve that by setting Boundary.knots to include at least range(knots).

Somewhat unexpectedly, the current version ignores the data from the last knot if these show no age variation (i.e. if all observations are made at the same time). This may occur when the data have been pre-arranged or rounded into waves.

A quick solution is to manually set the right boundary knot slightly higher than the last knot value. For example, if the knots = c(0, ..., 10) then set boundary = c(0, 11).

Ideally, the procedure should test for this case, and adapt the default.

@stefvanbuuren
Copy link
Member Author

Related #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant