Skip to content

Commit

Permalink
handle edge cases for dicho scaled residual calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
cwsimmon committed Mar 10, 2023
1 parent 8e18b10 commit 607ea3f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/code_base/dichotomous_entry_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,11 @@ void compute_dichotomous_pearson_GOF(dichotomous_PGOF_data *data, dichotomous_PG
Eigen::MatrixXd expected = Y.col(1).array()*mean_d.array();

Eigen::MatrixXd residual = Y.col(0) - expected;
//residual = residual.array()/sqrt(expected.array());
residual = residual.array()/sqrt(expected.array()*(1.0-mean_d.array())); //modified to match BMDS 3.2 calculation
//residual = residual.array()/sqrt(expected.array());
Eigen::MatrixXd SD = sqrt(expected.array()*(1.0-mean_d.array()));
std::cout<<"SD array: " << SD << std::endl;

This comment has been minimized.

Copy link
@shapiromatron

shapiromatron Apr 13, 2023

Collaborator

@cwsimmon did this std::cout make it into the release? I think it did; I'm seeing lots of noise in my logs, but wanted to confirm that's the case

This comment has been minimized.

Copy link
@cwsimmon

cwsimmon Apr 13, 2023

Author Collaborator

Yes, this is in there and will definitely contributing to the noise.

residual = (SD.array() > 0.0).select(residual.array()/SD.array(), 0.0); //modified to match BMDS 3.2 calculation

Eigen::MatrixXd sqresid = residual.array()*residual.array();
Eigen::MatrixXd resultsTable(Y.rows(),5);
resultsTable << Y.col(0) , Y.col(1) , expected , residual, sqresid;
Expand Down

0 comments on commit 607ea3f

Please sign in to comment.