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

crash in fit_OSLLifeTimes() #182

Closed
mcol opened this issue Aug 29, 2024 · 3 comments
Closed

crash in fit_OSLLifeTimes() #182

mcol opened this issue Aug 29, 2024 · 3 comments

Comments

@mcol
Copy link
Contributor

mcol commented Aug 29, 2024

fit_OSLLifeTimes(ExampleData.TR_OSL, signal_range = 1:2)
# Error in fit_OSLLifeTimes(ExampleData.TR_OSL, signal_range = 1:2) : 
#  object 'start_parameters' not found
@mcol
Copy link
Contributor Author

mcol commented Sep 3, 2024

The problem here is that the signal range contains only 2 points, and when we get here:

while(!is.na(suppressWarnings(qf(method_control_setting$p, df1 = 2, df2 = length(df[[2]]) - 2 * m - 2))) && (
F[2] > qf(method_control_setting$p, df1 = 2, df2 = length(df[[2]]) - 2 * m - 2) & F[1] >= F[2])){

we don't even enter the while loop (as df2 = length(df[[2]]) - 2 * m - 2 is negative: 2 - 2 * 1 - 2 = -2), and start_parameters doesn't get initialised.

It seems that we need a test on a minimum number of signal points (which depends on the requested number of components m).

@mcol
Copy link
Contributor Author

mcol commented Sep 3, 2024

Actually we have a check, but that happens before we restrict the dataset to only the points in the signal range requested, so it should be enough to move that to the correct spot.

@mcol
Copy link
Contributor Author

mcol commented Sep 3, 2024

Fixed by #195.

@mcol mcol closed this as completed Sep 3, 2024
@mcol mcol added this to the v0.9.25 (autumn CRAN release) milestone Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant