R-Lum/Luminescence

calc_MinDose(bootstrap = TRUE): must be a finite number

Closed this issue · 0 comments

Expected behaviour

The function returns no error or at least a meaningful error.

Observed behaviour

Function stops with

 Unable to plot the Likelihood profile for: gamma 
 Unable to plot the Likelihood profile for: sigma
 Unable to plot the Likelihood profile for: p0
Error in seq.default(mean - 5 * sd, mean + 5 * sd, 0.001) : 
  'from' must be a finite number

Running mini example

library(Luminescence)
df <-data.frame(X__1 = c(296.27192, 148.73232, 152.51856, 295.868, 
108.29544, 62.89728, 923.39648, 235.40512, 124.61816, 358.30288, 
113.65248, 227.33352, 105.82704, 310.25544, 449.49904, 1273.0756, 
340.0544, 237.79464, 48.70704, 112.09936, 84.26288, 900.33904, 
137.1696, 286.72064, 335.56096, 236.61008, 130.3968, 349.05896, 
915.14672, 176.1472, 421.9332, 18.0268, 180.04224, 385.38456, 
221.2244, 89.66344, 175.58688, 495.60712, 42.36672, 123.38872, 
94.93752, 310.26224, 38.57912, 36.59624, 119.88536, 137.24168, 
497.11808, 166.86656, 251.59048, 83.89432, 44.64064, 90.2496, 
704.13184, 218.96408, 77.92528, 168.2048, 160.23792, 230.10656, 
155.55952, 131.94312, 537.60392, 137.66464, 381.65408, 95.7032, 
226.44408, 171.15736, 201.67032, 150.26912, 435.99696, 133.40648, 
126.4596, 153.60384, 113.53144, 83.84128), X__2 = c(59.0716, 
69.462, 230.7172, 76.41704, 14.9328, 15.76648, 484.79648, 59.68496, 
51.11696, 131.35832, 10.73584, 136.0884, 16.39888, 79.84152, 
121.90768, 1377.83096, 147.3628, 280.5408, 14.29224, 30.3348, 
19.36504, 462.38368, 24.25424, 60.22896, 168.6672, 56.62904, 
81.19472, 122.95488, 1234.36456, 63.76904, 246.41432, 12.83024, 
198.66472, 177.32088, 158.882, 137.06896, 49.01984, 289.952, 
22.94864, 13.25728, 16.17856, 69.61976, 11.81568, 14.50168, 43.99464, 
38.96128, 134.63728, 60.17728, 118.9728, 25.12872, 14.36432, 
24.17808, 138.3392, 207.19328, 8.69584, 102.02176, 197.76984, 
59.47008, 35.56944, 28.19416, 199.11896, 44.61208, 53.49696, 
15.38296, 83.33536, 16.37168, 68.21896, 41.63912, 122.2368, 35.58032, 
22.75144, 39.77048, 20.67472, 26.74168))

## Minimum  Dose Model
calc_MinDose(
  data = df,
  sigmab = 0.2,
  log = TRUE,
  par = 3,
  bootstrap = TRUE,
  init.values = list(
    gamma = 100,
    sigma = 1.5 ,
    p0 = 0.1,
    mu = 100
  ),
  level = 0.95,
  multicore = TRUE,
  plot = TRUE
)

Supplementing comment

I am aware of the fact the values provided with init.values are not meaningful, however, it should not crash uncontrolled.