Skip to content
This repository was archived by the owner on Nov 19, 2020. It is now read-only.
This repository was archived by the owner on Nov 19, 2020. It is now read-only.

TwoSampleWilcoxonSignedRankTest crashing when sample vectors are exactly the same values #849

@hkoestin

Description

@hkoestin

Hello,

it seems, that TwoSampleWilcoxonSignedRankTest has a bug when both passed in sample vectors are exactly the same. The signs and diffs are thus 0 all the time, which leads to an exception later on.

Can you please check on that?

Here the stack-trace:

Index was outside the bounds of the array.
   at Accord.Statistics.Tools.Rank(Double[] samples, Boolean& hasTies, Boolean alreadySorted, Boolean adjustForTies)
   at Accord.Statistics.Testing.WilcoxonTest.Compute(Int32[] signs, Double[] diffs, DistributionTail tail, Nullable`1 exact, Boolean adjustForTies)
   at Accord.Statistics.Testing.TwoSampleWilcoxonSignedRankTest..ctor(Double[] sample1, Double[] sample2, TwoSampleHypothesis alternate, Nullable`1 exact, Boolean adjustForTies)

Regards
Harald

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions