I have this function that works similar to a probability generating function
$$g(x):=\left(\frac{c}{D} x^{-1}+\frac{D-t-c}D+\frac{t-d}{D} x+\frac{d}D x^2\right)^M$$
with $g(1)=1$. This is not a generating function in the common sense but from $g$ we can define the following PMF
$$f(k):=\begin{cases}[x^k]g(x),& k>0\\\sum_{k=-M}^0 [x^k]g(x),& k=0\end{cases}$$
and it CDF in a similar manner. I want to use the built-in function ProbabilityDistribution (if this is possible) to define $f$ as a PDF for the discrete random variable $K$ that take values in $\{0,\ldots,2M\}$ and depend on parameters $D,t,c,d$ and $M$ where
$$D,M\in\Bbb N_{>0},\quad 0\le d,c<D\quad\text{and}\quad 1\le t<D$$
But in the Wolfram language documentation center there is no information about if ProbabilityDistribution can be used to define distributions that depends on parameters or how to do it.
Some help will be appreciated, thank you.
P.S.: the notation $[x^k]p$ means "the $k$-th coefficient of the series $p$".
ProbabilityDistributioncan be used when you have parameters. Just make sure that the probabilities add up to 1—it doesn't check this. Also, if you have too many parameters, many of the simple symbolic calculations (likeMean) may fail. Consider also setting$Assumptionsin that case. $\endgroup$ProbabilityDistributionmay or may not be the best way to deal with it. $\endgroup$dist = ProbabilityDistribution[((-1 + x)/x) x^-k, {k, 0, Infinity, 1}]. Herexis a parameter.Mean[dist]andVariance[dist]work. You will notice that the latter is aConditionalExpression, because these probabilities make sense only ifx>1. It is these kinds of assumptions that are harder to control when usingMean/Variancethan when you do theSums directly. $\endgroup$ProbabilityDistribution) $\endgroup$