 In this instance we are going to show that the inverse Gaussian otherwise known as the inverse normal distribution is a member of the natural exponential family of distributions We begin with the form of the inverse Gaussian, which is as such it is defined by two parameters Mu and lambda and note that it is more complex than the Gaussian distribution We use the same process as usual First of all, we take logs and we always use the natural log here. So log of ffx is equal to a half log lambda minus a half log of 2 pi x cubed minus lambda and then we'll expand out this square term, so x squared minus 2 mu x plus mu squared and remember all these will be multiplied by minus lambda over 2 mu squared x. We'll simplify a bit, so we'll have the log of ffx is equal to a half log lambda minus a half log 2 pi x cubed. We'll break this down and simplify, so we have minus lambda x over 2 mu squared and we have minus 2 mu on top and minus 2 mu squared on the bottom here. We have x on top and x on bottom, so we will have minus times minus is a plus lambda over mu and then we have minus times a plus is a minus lambda. We have mu squared on top and mu squared on bottom there will cancel out to x and then we can think about exponentiating. So next bit is exponentiate, so we get ffx is the exponential of all of this and we'll start by bringing things over into the form that we are familiar with. So we have lambda minus lambda over 2 mu squared times x plus lambda over mu minus lambda over 2 x and then plus a half log of lambda minus a half log of 2 pi x cubed. Now then we compare to the desired form, which is ffx is equal to the exponential of theta x minus b of theta over a of phi plus c of x and phi. So the first thing we think about here when we're looking at this is this term here which is linked with x has a lambda and a mu squared in it. But we also see that x is linked to lambda here but it's a denominator. This we would not like to try to deal with so we'll think about as theta is being a function of mu squared as opposed to being a function of lambda. Sometimes thinking ahead about what you're looking at we're going to say theta x over a of phi is equal to minus lambda over 2 mu squared x and if we let theta equal 1 over mu squared we have 1 over a of phi is equal to minus lambda over 2 so a of phi is equal to minus 2 over lambda and then for simplicity we'll let phi equal 1 over lambda so a of phi is equal to minus 2 phi. In making this decision we now have to deal with this mu here so if we say theta equals 1 over mu squared then we would say theta to the half is equal to 1 over mu. That's delta this 1 over mu here and we don't see mu anywhere else so we would rewrite this equation here in terms of theta and phi. So the first bit we have is f of x is equal to the exponential of theta x over minus 2 phi. Then we have lambda over mu what we have phi is equal to 1 over lambda so 1 over phi is equal to lambda so we plus 1 over phi that's the lambda taken care of 1 over mu is theta to the half so we've theta to the half and then we have minus phi so this minus 1 over phi and times 2x minus a half log of phi because I would have had 1 over phi here and minus a half log 2 pi x cubed. All that remains to be done is put this over 2 phi so that I have a common term here so I have theta x minus 2 theta to the half over minus 2 phi I've just multiplied this above and below the line by minus 2 minus 1 over 2 phi x and then minus a half and I'm grouping these two terms together for simplicity log of 2 pi phi x cubed. All of this becomes my c of x in terms c of x and phi. B of theta is equal to minus so it's equal to well you've got the minus here so it's equal to 2 theta to the half and we've already identified a of phi is being minus 2 phi. At this point we can now find the mean and variance quite simply so we get the expected value so the expected value of x is d d theta of b of theta which is twice d d theta of theta to the half which is theta to the minus a half because you bring your half down and these cancel out so it's 1 over theta to the half which is mu as expected. The variance of x is a of phi d squared d theta to b squared b theta which is equal to your a of phi which is minus 2 phi times d d theta of theta to the minus a half and if we think about this quite carefully we will see that everything cancels out quite nicely you get to the minus a half over this times a half so we get the minus times the minus cancels out the half cancels out with the 2 so we get phi times theta to the minus 3 over 2. We recall theta to the minus a half is equal to mu so theta to the minus 3 over 2 is equal to mu cubed and phi is equal to 1 over lambda so the variance x which is equal to phi times theta to the minus 3 over 2 equals mu cubed over lambda so both our mean and variance match up with our expected answer this is always comforting it remains then to think about what function takes your expected value of x so what function g takes your expected value of x to theta so what function takes g of theta to the minus a half to theta and this is your canonical link function