# Writing exponential family in canonical form

I have the following pdf with support $$x>0$$:

$$f_{\mu}(x)=\frac{1}{\sqrt{2\pi x^3}}\textrm{exp}\left(-\frac{(x-\mu)^2}{2\mu^2x}\right)$$

This belongs to the exponential family, and I write this in the following form

$$f_{\mu}(x)=h(x)\space\textrm{exp}\left(\spaceη(\mu)T(x)\space-B(\mu)\right)$$

What I have thus far is by expanding the pdf is

$$h(x)=\frac{1}{\sqrt{2\pi x^3}}\textrm{exp}\left(-\frac{1}{2x}\right), η(\mu)=-\frac{1}{2\mu^2}, T(x)=x \space\textrm{and}\space B(\mu)=\frac{1}{\mu}$$

Something is wrong here, because when I write this in canonical form, i.e.

$$f_{\theta}(x)=h(x)\space\textrm{exp}\big(\theta x-b(\theta)\big)$$

I get the following

$$\theta=-\frac{1}{2\mu^2} \space\textrm{and}\space b(\theta)=\sqrt{-\frac{1}{2\theta}}$$

I want to rewrite the pdf in terms of $$\theta$$. Without this, I am unable to find the expectation, variance, fisher and so on in terms of $$\theta$$.

Can someone please tell me where I went wrong?

• Oh man @Xi'an of course $𝜂(\mu)=\frac{1}{2\mu^2}$. I will specify the support in the question right now. Commented Dec 19, 2022 at 10:56
• I think it now makes sense for $b(\theta)=\sqrt{2\theta}$ Commented Dec 19, 2022 at 10:58
• Agreed, the minus sign is a typo and that' probably why I got it wrong all along. Thanks alot @Xi'an ! Commented Dec 19, 2022 at 10:59
• How did you pull out the minus sign @Xi'an form the square root operation? Sorry it's been a long night maybe I oversee something basic here.. Commented Dec 19, 2022 at 11:04
• He might answer it. That's why may be. Commented Dec 19, 2022 at 11:09

Since $$f_{\mu}(x)=\frac{1}{\sqrt{2\pi x^3}}\textrm{exp}\left(-\frac{(x-\mu)^2}{2\mu^2x}\right)=\frac{1}{\sqrt{2\pi x^3}}\textrm{exp}\left(-\frac{x}{2\mu^2}+\frac{1}{\mu}-\frac{1}{2x}\right)$$ one gets that $$\eta(\mu)=\frac{-1}{2\mu^2}\qquad B(\mu)=-\frac{1}{\mu}$$ (hence a missing minus sign for $$B$$) and for the natural parameterisation $$\theta=\frac{-1}{2\mu^2}\qquad b(\theta)=-\sqrt{-2\theta}$$ (hence the inverse of the proposed $$b$$).
• Thanks for the answer, those minus signs got the worst of me.. To follow up, this means that the canonical link function is $b(\mu )^{-1}=(-\sqrt{-2\mu})^{-1}$ @Xi'an ? Commented Dec 19, 2022 at 11:15
• The canonical link function involves the derivative of $b(\cdot)$. Commented Dec 19, 2022 at 13:06