Skip to content

Commit 42520bc

Browse files
authored
Merge pull request #212 from StochasticTree/global-local-variance-hotfix
Updated the homoskedastic variance model in the case of (conditional) heteroskedastic variances as well
2 parents 7e9bb78 + 3dc6e4f commit 42520bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/stochtree/variance_model.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class GlobalHomoskedasticVarianceModel {
4141
data_size_t n = residuals.rows();
4242
double sum_sq_resid = 0.;
4343
for (data_size_t i = 0; i < n; i++) {
44-
sum_sq_resid += (residuals(i) * residuals(i)) * weights(i);
44+
sum_sq_resid += (residuals(i) * residuals(i)) / weights(i);
4545
}
4646
return b + (0.5 * sum_sq_resid);
4747
}

0 commit comments

Comments
 (0)