Skip to content

Imputation breaks down if first element of Y is NA #43

@akavalar

Description

@akavalar

I believe the imputation in CGGPfit doesn't work correctly if the first element of Y is NA.

Can easily be checked by replacing one of the NA entries in the scratch test script (https://github.com/CollinErickson/CGGP/blob/a559b397dfe459d9da29e59a46bfe5936585e406/scratch/main_rsupp_test.R), for example by changing Yb[261,1] = NA to Yb[1,1] = NA.

I had a quick look at the code and the problem seems to lie in here: https://github.com/CollinErickson/CGGP/blob/master/R/CGGP_impute_fs.R#L126. I tried setting the block value of the first value to from NA to 1, but then you run into problems in https://github.com/CollinErickson/CGGP/blob/master/R/CGGP_impute_fs.R#L132:L138.

Is there an elegant way around this, perhaps by somehow intelligently reshuffling the Y's, the design matrix, etc.? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions