Goodness-of-fit tests for discrete distributions I have data where only values at large x should fit to a particular distribution whose parameters I wish to determine. I want to do a goodness-of-fit test to find the value of x where the data fit to the expected distribution. My understanding is that a modified Kolmogorov-Smirnov test (modified so that I am looking at the ccdf rather than the cdf since I want $P(X ≥ x)$) should do it. But an additional complication is that my distribution is discrete. So my question is: How can I do a goodness-of-fit test in MATLAB for the ccdf in the case where the underlying distribution is discrete? I hope that phrasing makes sense. I am not a mathematician or statistician, but trying to understand this.

Not sure that I understand the first part of your problem, but unless things have changed since the following paper was published, Matlab doesn't implement the  Kolmogorov-Smirnov test for discrete distributions. You can use the test for continuous distributions but it will be overly conservative.
See "Computing the Kolmogorov-Smirnov Distribution When the Underlying CDF is Purely Discrete, Mixed, or Continuous" by Dimitrova et. al. https://www.jstatsoft.org/article/view/v095i10. For the conservative nature of the continuous test applied to a discrete distribution see section 3.1.
