# R: Defining a new continuous distribution function to use with Kolmogorov-Smirnov Test

I wish to run the Kolmogorov-Smirnov test on my data to determine how well it conforms to a specific continuous distribution function I have in mind.

If my understanding is correct, the Kolmogorov-Smirnov test can be performed in R with something along the lines of:

ks.test(my_data, "pweibull", shape=2, scale=1)


where in the case above pweibull is indicating a test against the Weibull function.

The issue I am having is that the function I want to test against (the BiPareto function defined here for what it's worth) is not a standard part of R best I can tell. Is it possible to define one's own function with parameters in R that can be passed to ks.test()?

ie. so I can have a call like:

ks.test(my_data, "bipareto", alpha=a_param, beta=b_param, c=c_param, k=k_param)


Alternatively, y can be a character string naming a continuous (cumulative) distribution function, or such a function.
So you can make a function called bipareto (say) that computes the cdf, and use that in the call. But you don't have to put it in quotes.