-
-
Notifications
You must be signed in to change notification settings - Fork 48
Expose builtin constraints #1494
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1e2eebb
Add lower_bound_jacobian and upper_bound_jacobian
WardBrian 3410581
Expose vector constraints
WardBrian 732a8ad
Warn when a _jacobian function gets all-data arguments
WardBrian 78ec40c
Add lub and offset-multiplier
WardBrian c30383f
Add stochastic matrices
WardBrian 3ffd6e3
corr and cov
WardBrian 3007e90
Update tests
WardBrian 8be0b0b
Start unconstrain functions
WardBrian c6221ee
Vectors
WardBrian ca4e8e7
Matrix unconstraining functions
WardBrian 416c507
Improve warning
WardBrian 9eac1d4
Merge branch 'master' into expose-builtin-constraints
WardBrian e68e038
Additional test
WardBrian 4220fc6
Merge branch 'master' into expose-builtin-constraints
WardBrian 84c5336
Helper function to create unary vector overloads
WardBrian a407878
Better ordering of functions in Lower_expr.fn_renames
WardBrian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
cd "$(git rev-parse --show-toplevel)" || exit | ||
dune runtest src test/unit && make format | ||
curl -X POST -F "jenkinsfile=<Jenkinsfile" "https://jenkins.flatironinstitute.org/pipeline-model-converter/validate" 2>/dev/null | tee /dev/tty | grep "Jenkinsfile successfully validated." -q |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
parameters { | ||
real b_raw; | ||
real ub; | ||
} | ||
|
||
model { | ||
real b = upper_bound_jacobian(b_raw, ub); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
data { | ||
int<lower=1> K; | ||
} | ||
parameters { | ||
vector[K-1] beta_raw; | ||
} | ||
transformed parameters { | ||
sum_to_zero_vector[K] beta = sum_to_zero_jacobian(beta_raw); | ||
} | ||
model { | ||
beta ~ normal(0, inv(sqrt(1 - inv(K)))); | ||
} | ||
generated quantities { | ||
vector[K-1] beta_recovered = sum_to_zero_unconstrain(beta); | ||
if (max(abs(beta_recovered - beta_raw)) > 1e-10) { | ||
fatal_error("beta_recovered does not match beta"); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.