ddalthorp / GenEst

R package development for a generalized mortality estimator
Other
6 stars 6 forks source link

some data sets don't run in GUI #612

Closed ddalthorp closed 5 years ago

ddalthorp commented 6 years ago

The attached data set runs fine in from the command line but cannot estimate mortality in the GUI (detection probability works fine). I have heard from some users who also had trouble estimating mortality from data sets where SE, CP, and generic g all worked fine (don't know about whether the data would run from command line). [seems like a simple error-check error in the GUI but I can't find the problem]

Data as .csv's:

data4.zip

Using the most simple SE and CP models:

data_SE <- read.csv(file = "pk4.csv", header = T)
data_CP <- read.csv(file = "cp4.csv", header = T)
data_DWP <- read.csv(file = "dwp4.csv", header = T)
data_CO <- read.csv(file = "co4.csv", header = T)
data_SS <- read.csv(file = "ss4.csv", header = T)
model_SE <- pkm(p ~ 1, k ~ 1, data = data_SE)
model_CP <- cpm0(l ~ 1, data = data_CP, left = "Left", right = "Right")
datai <- get(paste0("data", i))
Mhat <- estM(data_CO = data_CO,  data_SS = data_SS, data_DWP = data_DWP,
  frac = .3, COdate = "dateFound", model_SE = model_SE, model_CP = model_CP,
  unitCol = "turbine", SSdate = "datesSearched", nsim = 100)$Mhat
quantile(colSums(Mhat),
  probs = c(0.005, 0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95, 0.995))
ddalthorp commented 6 years ago

I found the problem and will fix forthwith.

ddalthorp commented 6 years ago

resolved as of v1.0.2.3

ddalthorp commented 5 years ago

Added several error-checks to estM (e.g., carcasses found on dates not searched, values other than 0 or 1 in search schedule for a given unit, carcasses found before searches begin, etc.) and pass the error messages from estM command line function to GUI.