 We come back to our discussion of data fitting models, so far we have talked about single exponential decays, multi exponential decays and distribution of lifetimes. So essentially our entire story can boil down to one theme, do our photo force experience a homogeneous environment or a heterogeneous environment. So another way which I think is not as good as what we discussed in the last module, another way of handling heterogeneous environment is by using a function that is called stretched exponential. Since stretched exponential I hope the function does not look very weird, in a sense it does not because I have used too many brackets but essentially what we have done is we have taken our good old single exponential function and we have added an additional exponent and this exponent is exponent of exponent. So for which value of beta is it going to be single exponential? Let us say beta can take several values depending on the situation, if beta is 1 what happens if beta is 1 isn't it single exponential? That means it is one homogeneous environment we can think. What if beta is anything other than 1? It simply means it is not single exponential and some heterogeneity is there. So this is one rather simplistic way of describing heterogeneity. To say that it is not homogeneous, stretched exponential. Now of course there are cases where people have stretched this stretched exponential as well and you will see papers in which they have fitted the data to a sum of 2 functions. First one of which is an exponential decay, second one is a stretched exponential. So the idea is good it means that you have one kind of environment which is homogeneous and another kind of environment which is not homogeneous. And this might actually be a good model not simple stretched exponential, a linear sum of stretched exponential and a exponential function. This can actually be a good model when you have something like once again since we use the example of nanoparticle let us go back to that. Let us say you have a nanoparticle where you have bandage emission and you have trap emission. Bandage emission is more homogeneous we can expect that should be an exponential decay. But traps there can be of many kinds. The straps are due to dangling bonds and stuff like that nobody has said that all dangling bonds will dangle in exactly the same way. So it is not very unreasonable to expect that in such a case your decay will be a linear sum of an exponential function and a stretched exponential function. And once again it is possible using dust 6 and all the standard software to fit your data to something like that. The danger is will your program be able to handle it. When you make your fitting function too complicated sometimes it becomes too much for the program because poor computer does not have eyes, does not have ears, does not have brain. It has to work on numbers, it has to work on algorithms to give you the correct answer. What it thinks is the correct answer. If you make it too complicated for it it might fail right. So but it is not completely impossible thing to do. So if you want a very simplistic description of a heterogeneous system then stretched exponential is a simple way to go alright. Now let us talk about something that is more common and very useful and that is global analysis. We are talking about different environment heterogeneity and so on and so forth right. In many cases many such cases this global analysis turns out to be a very useful tool. Let us think of an experiment where you have a fluorophore it binds to a protein and you are doing a titration. You have the fluorophore solution you are adding a little bit of protein and you are recording lifetime. What will happen? What should be the fitting model assuming that the bound fluorophore experiences a homogenous environment of one kind and free fluorophore experiences a homogenous environment of another kind. What do we expect? What kind of decay? Biosponential is reasonable in this case right. What do we expect something like this a biaxponential decay but this is a special kind of biaxponential because let us say tau 1 is the characteristic lifetime of the free fluorophore. Let us say tau 2 is the characteristic lifetime of bound fluorophore. Now when I do a titration what should happen for all these cases suppose I have 10 sets of data where concentration of fluorophore is same, concentration of protein 2 is the fluorophore bind increases from 0 to some value. In all these sets do I expect the tau 1s to be same or different? Do I expect the tau 1 values to be same across the set or do I expect them to be different? Do I expect them to be something in one case something else in the other. Here tau 1 is the free fluorophore lifetime should it remain same across the set should it change ideally it should remain same. What about tau 2 lifetime of the bound fluorophore when we add protein once again it is a two state system right. What we are saying is the fluorophore is either bound or free so once again even for the bound fluorophore if there is no micro heterogeneity then tau 2 should remain the same across the set right. So for all this 10 or 12 or 20 sets that you have you should get all same values of tau 1 all same values of tau 2 so these tau 1 and tau 2 these are called global parameters or global variables which means they have the same value I mean tau 1 is not equal to tau 2 please do not get me wrong but all the tau 1 values are the same across the set all the tau 2 values are the same across the set. What about the amplitudes will they be same when you do not have any protein then there should be no tau 2 actually it should be a single exponential decay then the amplitude A 1 should be 1 A 2 should be 0 and suppose you have a situation where all fluorophores are bound to the protein then A 2 should be 1 A 1 should be 0 once again single exponential in any intermediate situation what will happen A 1 will be something between 1 and 0 A 2 will be something between 0 and 1 okay and as you increase the concentration of the protein A 1 will go from 1 to 0 A 2 will go from 0 to 1 okay so A 1 and A 2 the amplitudes these are called local variables and then the way you do it is that you do not take these decays separately of course you do take them separately to start with but then when you understand that it appears that this is a fit case for global analysis then what you do is you take all the decays together and now you know about iterative deconvolution what I am saying is in each iteration all the tau 1 values are same all the tau 2 values are same in the next iteration tau 1 value can be varied but even then across the set it will remain same just to illustrate a little bit let us say I start with tau 1 value of 1 nanosecond tau 2 value of 10 nanosecond and I have 10 sets I do a first round of fitting and then in the next round I change 1 to 1.1 nanosecond now it is 1.1 nanosecond throughout and then I find the optimum value of tau 1 is 1.3 nanosecond now I start varying tau 2 instead of 10 I use 10.1 on 9.9 and finally after doing a lot of iterations I find that tau 2 value of 9.5 gives me the best result so then tau 1 is 1. what did I say 5 yeah tau 1 is 1.5 tau 2 is 9.5 but that is finally all values of all tau 1 values are same across the set all tau 2 values are same across the set important thing to understand here is that we are not holding them constant we are holding tau 1 value is constant only for a particular iterations in the next iteration it does get changed so we are optimizing them as well it is just that we are optimizing them in a correlated manner where in every iteration tau 1 value throughout is same for all the throughout the set tau 2 value throughout is same. Now homework is it possible can you think of a situation where tau 1 and tau 2 are local parameters and a 1 and a 2 are global parameters we can actually have that as well can you think of something like that let me give you one example let us say I have a fluorophore that is bound to a protein again so we are today we are obsessed with nanoparticles and proteins so it be let us say a fluorophore that is partially bound to protein and let us say I add iodide to the system what will happen iodide is a good quencher fluorophore will get quenched but which what kind of fluorophore will get quenched iodide does not get inside protein so only free fluorophore will get quenched okay so now suppose you have this situation where 50% of the fluorophore is bound 50% is free now you keep on adding iodide for all the different iodide concentrations what will happen unless it disturbs equilibrium 50% of fluorophore will still remain bound 50% will still remain free so that is what is given by amplitude amplitude will be actually fixed throughout right global parameter what will change lifetime of the bound fraction will also not change that is also global parameter lifetime of the free fluorophore will keep on decreasing as you keep adding iodide is that right so that will be a local parameter for different concentrations of iodide lifetime of the free fluorophore usually the shorter component will keep on decreasing lifetime of bound fluorophore should not change amplitudes also should not change so do not think that for all cases of global analysis lifetimes are the global parameters and amplitudes are local parameters not necessary alright so global analysis is something that is often very useful for us if our system is like that next we move on to something which is a little different and perhaps that is why the title is in a different color time-resolved emission spectra so see you excite a molecule and then in the excited state it evolves into something else a different state your locally excited state and then due to an excited state process it goes over to another new state emission spectrum should change how do I see well of course in steady state you might see a stoke shift and all but suppose I want to see the dynamics I want to record the fluorescence spectrum at different times after excitation how do I do it if you have an instrument called a street camera then you can see it in real time perhaps next day we are going to discuss street camera briefly but if you do not have a street camera suppose you only have this TCSPC that we have can you still construct the time-resolved emission spectrum and can you work out how it evolves in time this is how you do it let us say this is a steady state spectrum okay so I have intentionally drawn two bands because this higher energy band lower wavelength that let us say is the locally excited state and this is some state that is formed as a result of some excited state process now what I do is I record the fluorescence decays at different wavelengths across the spectrum the more the better but with good enough bandwidth if you are going to open the slit of your monochromator to say 20 nanometer and then you are going to make you are going to record decays in 1 nanometer intervals it makes no sense so if you are going to record decays at 5 nanometer interval you should have a band pass of 2 nanometer no more so how many decays you will be able to record across the spectrum actually depends on how strong the fluorescence is how good a detector you have and remember band pass has to be such that you have good enough resolution so that whatever you see after doing this analysis is believable poor band pass is going to mess up this kind of experiment completely right so you record this decays now I would like to remember something let us say I fit this to a good old multi exponential function I hope you remember what this I at 0 is the only thing I have added here is I added lambda because we are recording decays at different emission wavelengths but I hope you remember that there is a relationship between intensity at time 0 and intensity of steady state right so we put that because the problem is I do not know what I 0 is generally when you do a time correlated single photon counting as you might have seen when we did the lab session you record up to 5000 counts or 10,000 counts or 20,000 counts so everything seems to have the same I at time 0 which is not really the correct case because you have recorded for different times even if you record for the same time record all the decays for 5 minutes or 10 minutes or 1 hour whatever even then it is not possible to read off I 0 with any accuracy from the raw data because do not forget that what you see is convoluted data instrument function is convoluted with the decay and especially at initial times whatever intensity you actually see is convoluted intensity until and unless you deconvolute it makes no sense that is why it is better to record the steady state spectrum and use this expression and substitute I 0 by ISS divided by sum over I a I tau I so this way what do you get you get the intensity of fluorescence at any wave emission wavelength lambda at any time T after excitation now what do you do plot for any wavelength let us say these are the time 0 intensities then for another wavelength let us say these are the time 0 time T and time T dash intensities this one other wavelength and so on and so forth. So now if you join all the points at time 0 you get the time 0 spectrum you join all the points at time T you get the emission spectrum at time T join all the points at time T dash you get the emission spectrum at time T dash of course from this figure I hope it is not difficult to understand that more points you get better it is and you can get more points only when you use a narrow enough band pass okay how narrow band pass you will be able to use depends completely on your system and your instrument right. So these are the different factors that contribute and many times what you do is you want to area normalize it the sum when you do area normalization what are you normalizing to actually what is the area under the curve of emission spectrum area under the curve is the total number of photons emitted but area is proportional to total number of photons emitted. So when you area normalize you are really looking at spectra under the equal number of photons emitted condition and then area normalize the emission spectra also tell you some story which will leave for another day good thing of this approach is that it is okay if you are using the wrong model remember in our earlier discussion we have said that you have to break your head and work with the absolutely correct model if you want information about non-dietive rate constant and so on and so forth. But in this case all you care about is the correct value of time-resolved fluorescence intensity even if your model is not accurate it is fine as long as you get a good fit. So this is why sometimes it is better to work with time-resolved emission spectrum because then first of all you get to see how the emission spectrum is moving with time with evolving with time and secondly you really do not have to worry yourself about whether the model you are using the data fitting you are doing is at all correct or not okay. So these are the models of fitting now we come to the question how does the computer know how does the computer know whether the fit is good or not and as we said earlier a computer can know anything only when you have a number associated with it. So that is where we use parameters of goodness of fit those who have studied regression to perhaps know how to draw the correct line through experimentally observed points. In good old days when we used to draw graphs on graph paper we had to do this calculation manually use a ruler and actually draw. Now when you fit your data to a straight line or a any function polynomial whatever your computer actually does this it tries to see how good the fit is by looking at some number and the easiest number you can think of is standard deviation okay you have some experimental points you draw a fitting curve if standard deviation is small then you have a good fit the problem is how small is small how good is good fortunately when you do photon counting it becomes a little easier to answer that question. So the parameter of goodness of fit that is used is reduced chi square now the expression that you see right now is not reduced chi square completely it is on the way to reduce chi square it is chi square but let us see what we have here what is the denominator sigma k square sigma standard deviation right square of standard deviation variance and what is all this n at tk and nc at tk n at tk is the experimentally observed data at point tk actually I do not know why I have written I it is not I it is tk and nc at tk is the fitting data after convolution at the same time tk what do we have in the numerator you have the difference between the experimental value and the fit and you have taken square of that what is the denominator sigma k square what should the ratio be forget the summation for the moment just this fraction n at tk minus nc at tk whole square divided by sigma k square what should it be for a good fit denominator okay I have not said what the denominator is numerator is square root of n at tk now where did that come from that came from because of the noise model when you do photon counting the noise model is Poissonian and the noise is square root of count so this is well known this you can find even in say Banvel's book chapter 1 okay and that is the theoretical limit to the noise and you cannot have less noise than this you cannot have less variation in this okay so here in this expression of chi square in the denominator your sigma k square you can think that is the theoretical error best possible theoretical error in the numerator n at tk minus nc at tk whole square you can think it is the actual experimental error so I am taking a ratio of experimental error and theoretical error when a good fit what should this ratio be multiple choice question 0.1, 1, 10, 100, 1 right it should be as close to the theoretical error as possible but then so far we have neglected this summation altogether it is not good enough to look at one point is not it you should look at all the points when you sum over all the points what does this become for every point this ratio should be ideally 1 and you are summing up by say n number of points small n what should you get you should get n but it is a little tedious to keep remembering n all the time so what you do is you divide by n minus p okay so this is what it is chi square is sum over k equal to 1 to n n at tk minus nc at tk whole square divided by n at tk where did this denominator n at tk come from here sigma k equal to square root of n at tk so square of sigma k so this square root is gone so now when you take this chi square and divide by n minus p where small n is the number of data points and p is the number of floating parameters actually not fitting floating parameters what is the meaning of floating parameters suppose you have by exponential dk then what is the number of floating parameters a1 tau 1 and tau 3 I did not say a2 because a2 is just 1 minus a1 now see what is the value of small n typically in a pre-csbc experiment what would the value of small n be how many points would you have at least 500 if I leave the choice to you it will be 16,000 because you always work at 7 picosecond per channel right and sometimes 16,000 might be required 500 at least and what will be the number of floating points unless you are fitting to 100 exponential or something number of floating points will be small 234 so what is say 1000 minus 3 practically 1000 a little less than 1000 so now if you see this expression of chi r square reduced chi reduced chi square it is chi square divided by small n minus p what is the value of chi square value of chi square is about n for a good fit denominator is also approximately n so what should n by n be 1 so for a good fit reduce chi square should be it is never equal to 1 should be close to 1 so I say anything within 1.1 is good but one point that is important to remember and this is something that is not followed carefully by practitioners of this field is that it should be close to 1 okay but it should be greater than 1 for 2 reasons first of all when you take this ratio you have experimental error in the numerator theoretical error in the denominator experimental error can never be less than the theoretical limit of error if that were the case then you would be doing better than the best possible unphysical moreover the denominator here when you work out reduced chi square denominator is not exactly n but it is n minus p numerator is close to n right so numerator should be a little more than the denominator here also okay because p we are I mean as first approximation we can neglect but actually we cannot 1000 minus 3 is not 1000 it is 997 so chi square would better be more than 1 there are plenty of reports in literature and I am going to show you one after this and in fact even in established textbook it is often said that something between 0.9 to 1.1 is okay it is not 1.1 is okay 0.9 or even 0.99 or 0.98 are not because if you write that then you are saying that your error is less than the theoretical limit see that you are wrong or this theoretical limit is wrong if you get less than 1 you would like to fit your data once again alright so this is one parameter of goodness of fit reduced chi square there is one more well there are plenty but commonly use this one more see there is a problem with reduced chi square and the problem is you are taking a summation over all data points so it is possible that error in one side is accidentally offset by error on the other so a better thing to look at is weighted residual and weighted residual is n at tk minus nc at tk divided by square root of n at tk does this have anything to do does there any relationship with chi square I show you the expression for chi square once again sum over n tk minus nc tk whole square by n tk so you can think n tk minus nc tk divided by square root of n tk everything squared and now see what we have there we have n at tk minus nc at tk divided by square root of n tk understand what is going on here if I say this is r at tk this expression we have for residual if I say this is r value at tk will you agree with me that this chi square here is sum over k r tk r tk square r tk square understood so residual and chi square are different ways of looking at the same thing but the advantage of residual is that this residual you have defined point by point so what you can do is you can plot the residual as a function of time and here of course I am not happy with this because chi square is reported to be 0.85 reduce chi square and I do not believe it but if you neglect that for the moment and look at the residual you see the upper residual is actually a good fit because you have even distribution on both sides and it should be within the limit of 4 to much of distribution is also not good and in the lower one is definitely not a good fit chi square is bad 3.81 but more importantly you can see where you are going wrong and when you know where you are going wrong especially if it is a multi exponential fit if you know that you are going wrong in the long time you can try to play around with the long time if you know you are going around in the short time you can try to play around with the short time constant. So this is why residuals are more helpful than reduce chi square so reduce chi square may not be enough. Now one thing I would like to draw your attention to is this look at the expression once again weighted residuals what would happen if I did not have the denominator I can plot that as well what would it look like look at this shape and then try to tell me what this residual would look like if I did not divide it by square root of n at tk yeah it would look like a damped oscillation because see what is the denominator n at tk as tk increases n goes down right unless it is a rise or something. So as n goes down the what is the error square root of n that also becomes smaller. So if you do not have the denominator if you only take n at tk minus nc at tk you are going to get a damped oscillation you might be able to work with that but if you actually divide by square root of n tk good thing is you get this kind of a plot where deviations are now weighted in such a way that you get the same kind of deviation throughout it is easier to judge goodness of fit using weighted residual rather than unweighted residual we have discussed parameters of goodness of fit and we have discussed the different fitting models. So we stop here today and next day we start about another kind of experiment it is called femtosecond up conversion or femtosecond optical gating.