 Hi everyone, it's MJ and we're dealing with question 7 from the September 2017 paper and this question deals with two topics combined. We're looking at the moment generating function as well as compound distributions. So this is quite difficult so don't beat yourself up too much if you attempted this question and you got it wrong. What we're going to do is go through it slowly so that you can understand each of the steps. So the question reads as follows. The annual number of claims an insurance company incurs N is believed to follow a Poisson distribution with mean lambda. The value of each claim X i from i equals 1 to following follows a known distribution with mean mu and variance sigma squared. The value of each claim is independent on the value of any other claim and of the number of claims. Then we have let S equals the sum of the X's which denotes the total claims in any given year. Write down an expression so we just need to write down an expression for the moment generating function of S in terms of the moment generating function of X i. Okay so how do we do this? Well I think one very important thing to realize is the formula for MST. So MST is going to be equal to MN log MXT, okay? We're getting that straight from the theory that is something that we would have learnt in the earlier videos and we should be nice and comfortable with it. Now what we know, what we know is that N is following the Poisson with lambda as its parameter which means that we know on its own MN say Y would be equal to something like this, sorry, Y over there, minus 1. Okay where am I getting this from? I'm getting this from the formula book which we all should have for the exam. Hopefully you don't have to learn it but if you've been doing this for quite a while you will be quite familiar with this as your formula. So that is the moment generating function of the Poisson distribution. But now we have a situation where Y needs to be substituted for the log of the moment generating function of MXT and we don't really know what the distribution of X is. We know it's a known distribution and it has these parameters but we don't actually know what it is. But that's not too much of a problem because we know that MN log MX of t and I'm going to put this expression over here every time we have the Y so we're going to get E lambda exponential log MX t minus 1. I know that looks quite crazy how many sets we're going but we know that the link between the exponential and the logs can cancel each other out so we are left with the following. If you want to know how these two cancel each other out that is from the mathematics that one needs in order to do statistics at this level. So there we kind of have our answer because we know that this is equal to MS of t we then know that yeah our answer is as followed we just needed to write it in an expression of moment generating function of X so we have exponential lambda MX t minus 1 cool and they're only giving you one mark for doing all of that which I think it's actually would have given maybe two marks for that but we do see that there's a lot of marks here in the second part of the question which is going to be a little bit trickier what we need to now do is derive the formulae for the mean and the variance of s using your answer to part one. So we need to find the mean and the variance and we know the following we know that the expected value you know of something is equal to the first derivative of the motor generating function set to zero and we know that the variance of this is equal to the following okay so we need to bear that in mind while we now come to the second part of the question so part two and what we need to do is take the derivative of our moment generating moment generating function for s which is the total claims okay so we have moment generating function here of t we're taking the derivative and of those you know when we're taking a derivative with an exponential we're going to bring this over here forward and take the derivative of that so we have the following mx of t exponential y y lambda my apologies mx of t minus one okay that is the first phase the tricky part there is taking the derivative of an exponential bringing that term down which I think we should all be comfortable with terms as the maths goes then like we see over here in order to find the expected value we now need to set this equal to zero so we want the expected value of s we then need to set the moment generating function or the derivative of it to zero which is then going to give us the following so I'm just rewriting this out again with our zeros here okay and this is where the next step is fairly straightforward we know that the mx of zero is equal to the mean we've been told what that mean is by the parameter mu and we also know that mx zero over here is going to be equal to one because in the sense we have that situation which is equal to one so you need to know what this mx actually stands for to see how that will then get one that will then subtract that will cancel each other out so this part of the equation just goes no and becomes lambda mu and that is the expected value and that is also what we expect the average to be of the total claims to be the average number of claims times the average amount of each of those claims so that is also intuitive and we're quite happy with that of course in order to do the variance now we need to get the second derivative and this is where I mean the maths does start getting a little bit messy you need to be focused in the exam make sure you don't make a mistake but you're not going to be taking the derivative of the statement here we have to break it up into the two parts so it does get a little bit yeah you'll see it does get a little bit messy but we have to have the second derivative here of our mx exponential lambda mxt minus one so we've taken the second derivative of that now we need to take the second derivative of this part over here and we're gonna have y m over here and then what we're doing is because we're taking now the derivative of the second part the second part is this thing here which is the same as this part we're now going to square it so that's where the squaring comes in because we kept the one side the same and we're adding on another term which is the same of it and that's where we're getting the square and then we have e lambda mxt minus one okay like I say if you are getting confused with this term here it is because your maths is a little bit rusty you need to look into some of you know differentiation and stuff like that but it's not that it's not that difficult it does get a little bit messy now again you need to concentrate because now we're setting this equal to zero we're seeing this equal to zero and we're gonna now see the following zero e and once again mx zero minus one plus lambda mx zero squared e lambda mx zero minus one okay so all we've done in this step is replace the t with the zero okay now what does this give us what does this give us what we can see is we're still gonna have our little lambda over there here we're gonna get sigma squared plus mu squared now you might be saying hold on where did that come from where did that come from that's coming from over here where we say mx zero over there we're moving this thing to there which as you know from the top one here it's the mu we know that that's sigma squared so we've rearranged that to write that there okay once again this term kind of dies out because it's going e to the zero because that equals one minus one is zero times that zero e to the zero is one cool done then we have the situation over here where we have lambda and we know that from the previous one that is mu we squared that and once again that becomes one which became zero which means that becomes times about one so it goes and falls away so we have this but this is not the answer this is not the answer remember the variance the variance of s is equal to ms double derivative minus this one over here squared which means we have our terms here this I'm getting straight from over here but now we need to subtract over here and look at that those two cancel each other out and we have our answer as follows and tada we are done like I said do some more practice if you were like whoa what's going on here but if you still are battling it's important that you learn the theory of moment generating functions and you do make sure that you're comfortable with some of the mathematics being able to differentiate especially when you've got multiple terms and you split them up and do your whole little thing but otherwise that is I don't know I'd say this is quite a difficult question in the exam although a well-prepared student would be getting all six marks anyway I'll see you guys for the next video and let me know if you've got any questions keep well cheers