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.
 A: 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.
A: Goodness-of-fit tests check whether your data fits a given distribution with all the distributions parameters already fixed. It is not the method for learning the distribution parameters.
What you want to do is density estimation. And since you already know the type of the distribution, but still have to determine the parameters, it is parametric density estimation. And once you have the density, you also have the smallest value with nonzero probability.
IIUC, you think you need to add an additional parameter $s$ to the discrete Weibull $w(x)$ which is shifting the distribution: $w_s(x) = w(x-s)$. So you have to estimate the two parameters $\alpha$ and $\beta$ of the discrete Weibull plus this shift parameter $s$.
But how do you estimate the parameters $\alpha, \beta, s$? This is not that easy. You want your estimator to be good in a certain sense, e.g. you might want it to be consistent (actually converge to the real value for the sample size $n\to\infty$), unbiased (the mean of your estimator should be the real parameter to be estimated), efficient (your estimator should be, in some sense, converge fast), ...
Take as an example the well-known Gaussian distribution. If you think your data is distributed according to the Gaussian but you don't know what parameters mean ($\mu$) and standard deviation ($\sigma$) are the correct ones, you would estimate those parameters from your data in the usual way: You know that a good estimator for the mean is the sample average. But already for the estimation of the variance of the Gaussian, there are different possible estimators, each with different strengths and weaknesses.
The estimation of your parameters $\alpha, \beta, s$ will not be trivial. If you want to do all this in an impeccable manner, all I can do here is to point you to the research.
But if you just want to get your job done, and given the shape of the discrete Weibull, I would just recommend sampling as much as you can and then simply taking the minimum of all your samples and be done.
