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

Comment model code #72

Open
VLucet opened this issue Oct 25, 2023 · 4 comments
Open

Comment model code #72

VLucet opened this issue Oct 25, 2023 · 4 comments

Comments

@VLucet
Copy link

VLucet commented Oct 25, 2023

I really like that this package is bundling so many models in such an accessible way! Thank for your for efforts in that direction.

Eventually, users will want to build upon the included models (I do!). The packaged stan code seems to be written to be able to accommodate all the models at once, making it difficult to extract the code specific to a given model, understand said code, and build upon it.

I understand that modifying the code so that only code relevant to the chosen model is included at runtime would require a lot of efforts. As a first step, would it be possible to comment the stan code so that it is easier to understand? It would add great value to those who like me, have found using ubms a much needed shortcut from coding models directly from the literature.

@kenkellner
Copy link
Collaborator

It would be helpful to know if your goal is mainly to contribute to ubms, or to fit similar (customized) models separately in Stan. If the latter, I think only the code in this folder (i.e., the actual likelihood code) will be useful. I agree the lack of comments on these functions is an issue I need to fix.

Splitting the Stan code into separate files by model type is not something I'm likely to do in the future. All the Stan code is pre-compiled on package install (or when the binary package is created). The length of time this takes is proportional to the number of separate model files to compile, and it already takes a very long time. Hence the unintuitive "mega-model" structure.

I do see the need for a tool that can generate model code useful as a "starting point" for further modification. I'm working on something for this although it will use nimble rather than Stan.

@VLucet
Copy link
Author

VLucet commented Oct 25, 2023

Thanks for your reply. It would be for fitting similar customized models. To be more precise, I'm interested in considering things like group size and misclassification to distance sampling models for camera trap data.

A few comments would go a long way to help adapt these models, which are otherwise not easily found written in stan code anywhere else (unless I am mistaken), making this package quite unique and valuable. I understand the reason being the "mega-model" approach.

@VLucet
Copy link
Author

VLucet commented Oct 29, 2023

I hope this request did not come across badly, I apologize if it did. I understand there isn't much that can be done easily. I'll do my best to decode the stan files, and look forward these new development in nimble.

@VLucet VLucet closed this as completed Oct 29, 2023
@kenkellner
Copy link
Collaborator

Not at all, you're not the first person to ask about this and the comments really ought to be improved. I'm just not sure when I will get to it. Keeping this open so I remember.

@kenkellner kenkellner reopened this Oct 29, 2023
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

2 participants