ulrich
ulrich

Reputation: 3587

Poisson Kolmogorov Smirnov ties warning

I am trying to run a KS test on a vector to check if its follows a Poisson distribution

require("MASS")

Data <- rpois(100000, 20)
distFit<-fitdistr(Data,"Poisson")
ks.test(Data,"ppois",lambda=distFit$estimate)

unfortunately I get the following message once I run ks.test in the next step

Warning message: In ks.test(Data, "ppois", lambda = distFit$estimate) : ties should not be present for the Kolmogorov-Smirnov test

Any idea how to fix this?

Upvotes: 0

Views: 5200

Answers (1)

GWD
GWD

Reputation: 1464

you could apply the jitter function to your data to break ties ... have a look at ?jitterto find out if it fits your needs

Upvotes: 2

Related Questions