# Solved – Deriving the canonical link for a binomial distribution

I define an exponential dispersion family as any distribution whose PMF/PDF is
$$f(y mid boldsymboltheta) = expleft{phi[ytheta – b(theta)] + c(y, phi) right}text{, } y in Omega$$
where $$Omega$$ is in the support of a random variable $$Y$$ in the family.

Suppose $$Y_1, dots, Y_m$$ are independent and binomially distributed ($$n$$ trials, success probability $$p_i$$). I've already shown that the Binomial distribution satisfies the above, with
begin{align} phi &= 1 \ theta_i &= logleft(dfrac{p_i}{1-p_i} right) \ b(theta_i) &= nlogleft(dfrac{1}{1-p_i}right) \ c(phi, y_i) &= logbinom{n}{y_i}text{.} end{align}
After some work, I showed that, as a function of $$theta_i$$,
$$b(theta_i) = nlog(e^{theta_i} + 1)$$
(this is consistent with what I found at http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/xlghtmlnode38.html)
and I understand that
$$mu_i = b^{prime}(theta_i) = n cdot dfrac{e^{theta_i}}{e^{theta_i}+1}text{.}$$

I also understand that what we need to do is solve for $$theta_i$$ in the above, and the canonical link function would be $$g(mu_i) = theta_i$$ according to above. But one thing bothers me: when I run the above through WolframAlpha, I obtain
$$g(mu_i) = theta_i = logleft( dfrac{mu_i}{n-mu_i}right)text{.}$$
Every source I've seen says that the $$n$$ above should be a $$1$$ for the binomial canonical link function. Did I do something wrong?

Contents

$$mu_i = p_i n$$ so $$log(frac{mu_i}{n – mu_i}) = log(frac{np_i}{n – np_i}) = …$$
So, the $$n$$ can be a 1, as long as you swap out $$mu_i$$ for $$p_i$$.