-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Defer inclusion of generated quantity code (#364)
- Loading branch information
Showing
22 changed files
with
269 additions
and
116 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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,29 @@ | ||
functions { | ||
vector lm_predict_value(vector time, matrix long_gq_parameters) { | ||
return sld( | ||
time, | ||
long_gq_parameters[,1], | ||
long_gq_parameters[,2], | ||
long_gq_parameters[,3], | ||
long_gq_parameters[,4] | ||
); | ||
} | ||
} | ||
|
||
generated quantities { | ||
// | ||
// Source - lm-gsf/quantities.stan | ||
// | ||
matrix[n_subjects, 4] long_gq_parameters; | ||
long_gq_parameters[, 1] = lm_gsf_psi_bsld; | ||
long_gq_parameters[, 2] = lm_gsf_psi_ks; | ||
long_gq_parameters[, 3] = lm_gsf_psi_kg; | ||
long_gq_parameters[, 4] = lm_gsf_psi_phi; | ||
|
||
|
||
matrix[gq_n_quant, 4] long_gq_pop_parameters; | ||
long_gq_pop_parameters[, 1] = exp(lm_gsf_mu_bsld[gq_long_pop_study_index]); | ||
long_gq_pop_parameters[, 2] = exp(lm_gsf_mu_ks[gq_long_pop_arm_index]); | ||
long_gq_pop_parameters[, 3] = exp(lm_gsf_mu_kg[gq_long_pop_arm_index]); | ||
long_gq_pop_parameters[, 4] = lm_gsf_a_phi[gq_long_pop_arm_index] ./ (lm_gsf_a_phi[gq_long_pop_arm_index] + lm_gsf_b_phi[gq_long_pop_arm_index]); | ||
} |
This file contains 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 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,26 @@ | ||
|
||
functions { | ||
// | ||
// Source - lm-random-slope/quantities.stan | ||
// | ||
vector lm_predict_value(vector time, matrix long_gq_parameters) { | ||
int nrow = rows(time); | ||
return ( | ||
long_gq_parameters[, 1] + long_gq_parameters[, 2] .* time | ||
); | ||
} | ||
} | ||
|
||
generated quantities { | ||
// | ||
// Source - lm-random-slope/quantities.stan | ||
// | ||
matrix[n_subjects, 2] long_gq_parameters; | ||
long_gq_parameters[, 1] = lm_rs_ind_intercept; | ||
long_gq_parameters[, 2] = lm_rs_ind_rnd_slope; | ||
|
||
|
||
matrix[gq_n_quant, 2] long_gq_pop_parameters; | ||
long_gq_pop_parameters[, 1] = to_vector(lm_rs_intercept[gq_long_pop_study_index]); | ||
long_gq_pop_parameters[, 2] = to_vector(lm_rs_slope_mu[gq_long_pop_arm_index]); | ||
} |
This file contains 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 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 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,26 @@ | ||
|
||
functions { | ||
vector lm_predict_value(vector time, matrix long_gq_parameters) { | ||
return sld( | ||
time, | ||
long_gq_parameters[,1], | ||
long_gq_parameters[,2], | ||
long_gq_parameters[,3] | ||
); | ||
} | ||
} | ||
|
||
generated quantities { | ||
// | ||
// Source - lm-stein-fojo/quantities.stan | ||
// | ||
matrix[n_subjects, 3] long_gq_parameters; | ||
long_gq_parameters[, 1] = lm_gsf_psi_bsld; | ||
long_gq_parameters[, 2] = lm_gsf_psi_ks; | ||
long_gq_parameters[, 3] = lm_gsf_psi_kg; | ||
|
||
matrix[gq_n_quant, 3] long_gq_pop_parameters; | ||
long_gq_pop_parameters[, 1] = exp(lm_sf_mu_bsld[gq_long_pop_study_index]); | ||
long_gq_pop_parameters[, 2] = exp(lm_sf_mu_ks[gq_long_pop_arm_index]); | ||
long_gq_pop_parameters[, 3] = exp(lm_sf_mu_kg[gq_long_pop_arm_index]); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.