Fit of daily SP500 notations  S (t)  to geometric BM S (t)=Exp[mu*t + sigma*B (t)]

<< Statistics`DescriptiveStatistics`; << 
      Statistics`ContinuousDistributions`;

Clear[FEmp]; 
    FEmp[data_, 
        x_] := {ltdata = Length[data], 
          Sum[If[data[[i]] ≤ x, 1, 0], {i, 1, ltdata}]/
            ltdata}[[2]];

SP500 = 
      Part[Transpose[
          Reverse[Import["/users/math/palbin/user/courses/StokAnal/SP500.\
csv", "CSV"]]], 7]; lt = Length[SP500]; 
    ListPlot[SP500, PlotJoined -> True, 
      PlotLabel -> "SP500 1 Dec 1999 - 30 Nov 2004"]; 
    LogIncrSP500 = 
      Table[Log[SP500[[i + 1]]] - Log[SP500[[i]]], {i, 1, lt - 1}]; 
    lt = Length[LogIncrSP500]; 
    ListPlot[LogIncrSP500, 
      PlotLabel -> "Log-increments of SP500 data"];

{mu0, sigma0} = {Mean[LogIncrSP500], 
        StandardDeviation[LogIncrSP500]}

Show[{Plot[
            CDF[NormalDistribution[mu0, sigma0], x], {x, Min[LogIncrSP500], 
              Max[LogIncrSP500]}, PlotRange -> {0, 1}], 
          Plot[FEmp[LogIncrSP500, x], {x, Min[LogIncrSP500], 
              Max[LogIncrSP500]}, PlotRange -> {0, 1}]}, 
        PlotLabel -> "Empirical CDF vs fitted CDF"];

Fit of SP500 to geometric BM  Exp[
        mu*t + sigma*V (t)*
            B (t)]  with volatility  V (t)

Volatility = 
      Table[StandardDeviation[
          Table[LogIncrSP500[[i]], {i, j - 19, j}]], {j, 20, lt}]; 
    Volatility = Volatility/Mean[Volatility]; 
    DevolLogIncrSP500 = 
      Table[(LogIncrSP500[[j]] - mu0)/Volatility[[j - 19]] + 
          mu0, {j, 20, lt}]; lt = Length[DevolLogIncrSP500]; 
    ListPlot[Volatility, PlotJoined -> True, 
      PlotLabel -> "Volatility of log-increments"]; 
    ListPlot[DevolLogIncrSP500, 
      PlotLabel -> "Devolatilized log-increments"];

{mu0, sigma0} = {Mean[DevolLogIncrSP500], 
        StandardDeviation[DevolLogIncrSP500]}

Show[{Plot[
            CDF[NormalDistribution[mu0, sigma0], x], {x, 
              Min[DevolLogIncrSP500], Max[DevolLogIncrSP500]}, 
            PlotRange -> {0, 1}], 
          Plot[FEmp[DevolLogIncrSP500, x], {x, Min[DevolLogIncrSP500], 
              Max[DevolLogIncrSP500]}, PlotRange -> {0, 1}]}, 
        PlotLabel -> "Devolatilized empirical and fitted \
CDF"];