-
Notifications
You must be signed in to change notification settings - Fork 8
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
make missing data work with -999 #540
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -633,8 +633,16 @@ test_that("run FIMS in a for loop", { | |
catch <- em_input$L.obs$fleet1 | ||
fishing_fleet_index <- new(fims$Index, length(catch)) | ||
fishing_fleet_index$index_data <- catch | ||
testindex <- 2 | ||
na_value <- -999 | ||
if(i==4){ | ||
fishing_fleet_index$index_data[testindex] <- na_value | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is how R users would use it currently, correct? Assigning -999 to anything that should be an NA? Maybe this should be added to the PR description at least for some minimal documentation on how this works. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point - I added something to the fims-demo vignette about how to specify missing data! |
||
} | ||
fishing_fleet_age_comp <- new(fims$AgeComp, length(catch), om_input$nages) | ||
fishing_fleet_age_comp$age_comp_data <- c(t(em_input$L.age.obs$fleet1)) * em_input$n.L$fleet1 | ||
if(i==5){ | ||
fishing_fleet_age_comp$age_comp_data[testindex] <- na_value | ||
} | ||
|
||
survey_index <- em_input$surveyB.obs$survey1 | ||
survey_fleet_index <- new(fims$Index, length(survey_index)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like if we add more data types besides an index and age comps, more
if()
statements would need to be added to each of the data types' negative log likelihood assignment statements to allow for NAs to work, correct?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct! When coding we also discussed if we need to handle a case where there are NA values in some ages but not others despite the existence of some comp samples, but for now, you can only specify a full missing year. Are you thinking we should document this or add to an issue?