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

Updating Stan Models to be more performant #224

Open
SteveBronder opened this issue Jan 14, 2021 · 3 comments
Open

Updating Stan Models to be more performant #224

SteveBronder opened this issue Jan 14, 2021 · 3 comments

Comments

@SteveBronder
Copy link

Looking over the recent paper here I noticed that a number of the models they outperform stan on need updated and are not really made for performance testing. I'll list out a few notes on these as I go

earn_height.stan:

  • seperate beta into two reals alpha and beta

hmm_example:

kidscore_interaction

  • Make data into matrix, intercept as real, and beta's as vector to use normal_id_glm
  • I think this applies to all of the kid models

log10earn_height:

  • Use vectorized version of log10
  • @t4c1 should we have a specialized version of normal_id_glm() that works for vector ~ normal_id_glm(vector, real, real , real)?

logearn_interaction

  • For all these I think they can be made ot use normal_id_glm()
  • I think for all these models the tranformed data should be written inline like
vector[N]  log_earn = log(earn);
vector[N]  inter    = height .* male;

logmesquite_logva

  • normal_glm

mesquite.stan

  • normal_glm

pretty much all of these can use normal_id_glm

arK

  • Actually idk but it looks like there is a way to make this more performant.
@t4c1
Copy link

t4c1 commented Jan 14, 2021

@t4c1 should we have a specialized version of normal_id_glm() that works for vector ~ normal_id_glm(vector, real, real , real)?

I doubt this would bring significant speedup over the code in the model. The performance bottleneck is computing the vector related stuff, so the differences in a few scalar operations is negligible.

@MansMeg
Copy link
Collaborator

MansMeg commented Jan 17, 2021

That seems like good improvements. Could you open a PR with these changes?

@SteveBronder
Copy link
Author

srry I don't have time I'm just posting this for someone who wants to contribute

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

3 participants