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

Allow scale to compose with transformations #971

Closed
wants to merge 9 commits into from

Conversation

WardBrian
Copy link
Member

@WardBrian WardBrian commented Sep 24, 2021

This is a much more limited alternate take on #947. Basically, separate out offset and multiplier from the idea of a transformation, and allow them to be composed, but not arbitrary other compositions. This aligns more directly with #659

Submission Checklist

  • Run unit tests
  • Documentation
    • If a user-facing facing change was made, the documentation PR is here: TBD

Release notes

Offset/Multiplier scaling can now be applied to constrained data types, like real<lower=0><offset=1>. When constraining, the scaling is done first so that the result is truly of the constrained type.

Copyright and Licensing

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)

@WardBrian
Copy link
Member Author

@SteveBronder - This is the proof of concept of the alternative version. If you ignore the multiarch build problem ATM it compiles all the models fine, including the following:

data {
   int<lower=0> N;
}

parameters {
    array[3] real<lower=0><offset=10> loweroffset;
    real<lower=0, upper=1><offset=1, multiplier=10> allfour;
    simplex<offset=1>[10] offset_simplex;
    positive_ordered<multiplier=10>[N] multiplied_ordered; 
}

We can throw this into cmdstan and start doing some actual modeling tests next week

@WardBrian WardBrian marked this pull request as ready for review September 29, 2021 19:10
@WardBrian
Copy link
Member Author

The implementation here should be good to go, @bob-carpenter and I need to work on some example models and the doc for it.

@WardBrian WardBrian mentioned this pull request Sep 29, 2021
6 tasks
@WardBrian WardBrian linked an issue Sep 30, 2021 that may be closed by this pull request
@WardBrian WardBrian added the feature New feature or request label Nov 9, 2021
@WardBrian WardBrian changed the title [WIP] Allow scale to compose with transformations Allow scale to compose with transformations Nov 15, 2021
@WardBrian WardBrian mentioned this pull request Jan 26, 2022
18 tasks
@WardBrian WardBrian mentioned this pull request Feb 4, 2022
@SteveBronder
Copy link
Contributor

Is this waiting on review?

@WardBrian
Copy link
Member Author

There was a lot of discussion in #659 about whether this was the right thing to do or not, which is the bigger blocker I believe

@WardBrian WardBrian linked an issue May 16, 2022 that may be closed by this pull request
@WardBrian
Copy link
Member Author

This has fallen too far behind, so I'm going to close it for now

@WardBrian WardBrian closed this Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't mix offset/multiplier with upper/lower bounds compose constraining variable transforms
2 participants