the code in figure produces the plot the fit is clearly good onefor these data points howeverlet' look at what the model predicts for when we add the code pred to *( ** *( ** *( ** ) * print 'model predicts that ** is roughly'round(pred to print 'actual value of ** is' ** to the end of figure it printsmodel predicts that ** is roughly actual value of ** is oh deardespite fitting the datathe model produced by polyfit is apparently not good one is it because four was not the right degreeno it is because no polynomial is good fit for an exponential distribution does this mean that we cannot use polyfit to build model of an exponential distributionfortunatelyit does notbecause we can use polyfit to find curve that fits the original independent values and the log of the dependent values consider the sequence [ if we take the log base of each value we get the sequence [ ] sequence that grows linearly in factif function ( )exhibits exponential growththe log (to any baseof (xgrows linearly this can be visualized by plotting an exponential function with logarithmic -axis the code xvalsyvals [][for in range( )xvals append(iyvals append( **ipylab plot(xvalsyvalspylab semilogy(produces the plot on the right the fact that taking the log of an exponential function produces linear function can be used to construct