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

Expose skeleton #706

Merged
merged 5 commits into from
Oct 20, 2022
Merged

Expose skeleton #706

merged 5 commits into from
Oct 20, 2022

Conversation

andrjohns
Copy link
Collaborator

Submission Checklist

  • Run unit tests
  • Declare copyright holder and agree to license (see below)

Summary

Packages like https://github.com/n-kall/priorsense and https://github.com/stan-dev/loo will need access to the parameter skeleton from the constrain_pars function for full compatibility with cmdstanr.

This PR adds a boolean flag to the constrain_pars method to return only the parameter skeleton rather than the constrained pars:

> fit$constrain_pars(skeleton_only = TRUE)
$theta
[1] 0

$log_lik
 [1] 0 0 0 0 0 0 0 0 0 0

As part of this, the model_variables object is updated to include the parameter sizes from the model when the model methods are initialised.

Copyright and Licensing

Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Andrew Johnson

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses:

@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2022

Codecov Report

Merging #706 (f979f2a) into master (39a5c4c) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #706      +/-   ##
==========================================
- Coverage   90.56%   90.53%   -0.03%     
==========================================
  Files          12       12              
  Lines        3888     3890       +2     
==========================================
+ Hits         3521     3522       +1     
- Misses        367      368       +1     
Impacted Files Coverage Δ
R/fit.R 98.17% <100.00%> (+<0.01%) ⬆️
R/install.R 62.70% <0.00%> (-0.24%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@andrjohns
Copy link
Collaborator Author

@rok-cesnovar I realised I'd made a bunch of redundant/unnecessary changes with the PR, so I've reverted those. Makes for a much simpler diff ha!

Copy link
Member

@rok-cesnovar rok-cesnovar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it!

@rok-cesnovar rok-cesnovar merged commit 53084da into stan-dev:master Oct 20, 2022
@jgabry
Copy link
Member

jgabry commented Oct 20, 2022 via email

@jgabry
Copy link
Member

jgabry commented Oct 20, 2022

Awesome, thanks!

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

Successfully merging this pull request may close these issues.

4 participants