We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cfe7711 + 19e6a5e commit 855d59aCopy full SHA for 855d59a
1 file changed
src/stan_files/lm.stan
@@ -105,11 +105,10 @@ model {
105
if (K > 1)
106
target += beta_lpdf(R2 | half_K, eta);
107
else {
108
- // TODO(Andrew) remove once vectorised abs available in rstan
+
109
array[J] real R2_abs;
110
- for (j in 1:J) {
111
- R2_abs[j] = abs(R2[j]);
112
- }
+ R2_abs = abs(R2);
113
target += beta_lpdf(square(R2) | half_K, eta) + sum(log(R2_abs));
114
}
115
0 commit comments