4
$\begingroup$

How do I use a custom CDF that I defined for a Kolmogorov-Smirnov test. I have one input vector of data whose CDF I claim to have derived but want to check whether it agrees with my closed form result. In order to do so, I am wondering whether there is a way to feed the command not just two data vectors but one data vector and one CDF.

In http://reference.wolfram.com/language/ref/KolmogorovSmirnovTest.html, one can only specify the distributions by name but mine is a new one that has no name (yet;-)).

Thanks!

Hirek

$\endgroup$
1
  • 1
    $\begingroup$ here CDF = cumulative distribution function (not our favorite document format) $\endgroup$ Commented Sep 12, 2014 at 7:49

1 Answer 1

7
$\begingroup$

You can use ProbabilityDistribution to define your own probability distribution from a CDF:

dist = ProbabilityDistribution[{"CDF", 1/2 Erfc[(0.1 - x)/(Sqrt[2] 1.2)]}, {x, -∞, ∞}]

With some data

data = RandomVariate[NormalDistribution[], 50];

you can now perform

KolmogorovSmirnovTest[data, dist]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.