Skip to content

NPC issues #223

@pbstark

Description

@pbstark

npc() seems to add 1/B or 2/(B+1) to the p-values spuriously.

pvalues_from_distr[:, j] = 1 - rankdata(distr[:, j], method="min")/(plus1+B) + (1 + plus1)/(plus1+B)

When it is called from sim_npc with plus1=False, the P-value this would give to the largest value of the test statistic is

1-B/B + 1/B = 1/B, which is correct.

If it is called with plus1=True, the P-value for the largest test statistic is

1-B/(B+1) + 2/(B+1) = 3/(B+1), which is not correct.

For the smallest test statistic, when plus1=False,
1 - 1/B + 1/B = 1, which is correct.

When plus1=True,

1 - 1/(B+1) + 2/(B+1) > 1, which is wrong.

This is probably why Liptak was throwing an error.

Need to correct this for the plus1=True case; then the error test for Liptak on lines 179-181 can be deleted, I think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions