-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add option to modify penalization, fix warnings from coef
- Loading branch information
Showing
17 changed files
with
1,228 additions
and
1,063 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
real prior = 0; | ||
// priors for (very weak) regularisation | ||
prior += normal_lpdf(to_vector(beta_i_raw) | 0, 5); | ||
for(s in 1:S) { | ||
prior += normal_lpdf(to_vector(beta_s_raw[s]) | 0, 5); | ||
if (penalize == 1) { | ||
// priors for (very weak) regularisation | ||
prior += normal_lpdf(to_vector(beta_i_raw) | 0, penalty); | ||
for(s in 1:S) { | ||
prior += normal_lpdf(to_vector(beta_s_raw[s]) | 0, penalty); | ||
} | ||
prior += normal_lpdf(beta_o_raw | 0, penalty); | ||
} | ||
prior += normal_lpdf(beta_o_raw | 0, 5); |
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
// priors for (very weak) regularisation | ||
real prior = 0; | ||
for (d in 1:D){ | ||
prior += normal_lpdf(to_vector(beta_i_raw[d]) | 0, 5); | ||
for(s in 1:S) { | ||
prior += normal_lpdf(to_vector(beta_s_raw[d, s]) | 0, 5); | ||
if (penalize == 1) { | ||
for (d in 1:D){ | ||
prior += normal_lpdf(to_vector(beta_i_raw[d]) | 0, penalty); | ||
for(s in 1:S) { | ||
prior += normal_lpdf(to_vector(beta_s_raw[d, s]) | 0, penalty); | ||
} | ||
prior += normal_lpdf(beta_o_raw[d] | 0, penalty); | ||
} | ||
prior += normal_lpdf(beta_o_raw[d] | 0, 5); | ||
prior += normal_lpdf(to_vector(theta_raw) | 0, penalty); | ||
} | ||
prior += normal_lpdf(to_vector(theta_raw) | 0, 5); |
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
// priors for (very weak) regularisation | ||
real prior = normal_lpdf(to_vector(beta_i_raw) | 0, 5); | ||
for(s in 1:S) { | ||
prior += normal_lpdf(to_vector(beta_s_raw[s]) | 0, 5); | ||
prior += normal_lpdf(to_vector(beta_o_raw[s]) | 0, 5); | ||
real prior = 0; | ||
if (penalize == 1) { | ||
prior += normal_lpdf(to_vector(beta_i_raw) | 0, penalty); | ||
for(s in 1:S) { | ||
prior += normal_lpdf(to_vector(beta_s_raw[s]) | 0, penalty); | ||
prior += normal_lpdf(to_vector(beta_o_raw[s]) | 0, penalty); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
// priors for (very weak) regularisation | ||
real prior = 0; | ||
for (d in 1:D){ | ||
prior += normal_lpdf(to_vector(beta_i_raw[d]) | 0, 5); | ||
for(s in 1:S) { | ||
prior += normal_lpdf(to_vector(beta_s_raw[d, s]) | 0, 5); | ||
prior += normal_lpdf(to_vector(beta_o_raw[d, s]) | 0, 5); | ||
if (penalize == 1) { | ||
for (d in 1:D){ | ||
prior += normal_lpdf(to_vector(beta_i_raw[d]) | 0, penalty); | ||
for(s in 1:S) { | ||
prior += normal_lpdf(to_vector(beta_s_raw[d, s]) | 0, penalty); | ||
prior += normal_lpdf(to_vector(beta_o_raw[d, s]) | 0, penalty); | ||
} | ||
} | ||
prior += normal_lpdf(to_vector(theta_raw) | 0, penalty); | ||
} | ||
prior += normal_lpdf(to_vector(theta_raw) | 0, 5); |
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
Oops, something went wrong.