<< Statistics`; << Graphics`; << 
      Statistics`DataManipulation`;

dfi = (DisplayFunction -> Identity); 
    dfdf = (DisplayFunction -> $DisplayFunction);

T = 
      3;  (Xmat = {{1. , 1.09, 1.08, 1.34}, {1. , 1.16, 1.26, 1.54}, {1. , 
              1.22, 1.07, 1.03}, {1. , 0.93, 0.97, 0.92}, {1. , 1.11, 1.56, 
              1.52}, {1. , 0.76, 0.77, 0.9}, {1. , 0.92, 0.84, 1.01}, {1. , 
              0.88, 1.22, 1.34}}) // MatrixForm

n = Length[Xmat[[1]]] - 1; dt = T/n; M = Length[Xmat];

r = 0.06;

K = 1.1;

discountVet = Table[Exp[-r dt k], {k, 1, n}];
Spaths = Drop[#, 1] & /@ Xmat;
CashFlows = 
        Table[Max[0, K - Spaths[[i, n]]], {i, 1, M}];
ExerciseTime = Table[n, {M}];
exerboun = {};
\(\(Do[
PrintD["step = ", \ 
          step]; 
InMoney = 
          Flatten[Position[
              Spaths[\([All, 
                  step]\)], _?\((\((# < 
                        K)\) &)\)]]; 
PrintD["InMoney = ", \ InMoney]; 
Xdata = 
          Spaths[\([InMoney, 
              step]\)]; 
PrintD["Xdata = ", \ 
          Xdata]; 
RegrMat = 
          Transpose[{Xdata^2, Xdata, 
              Table[1, {Length[
                    Xdata]}]}]; 
PrintD["RegrMat = ", \ 
          RegrMat // MatrixForm]; 
Ydata\  = \ 
          Distribute[
            CashFlows[\([InMoney]\)]\ *\ 
              discountVet[\([ExerciseTime[\([InMoney]\)] - 
                    step]\)]]; 
PrintD["Ydata = ", \ 
          Ydata]; 
a\  = \ 
          BestFitParameters /. 
            DesignedRegress[RegrMat, \ Ydata, 
              RegressionReport -> 
                BestFitParameters]; 
PrintD["a = ", \ 
          a]; 
IntrinsicValue = 
          K - Xdata; 
PrintD["IntrinsicValue = ", \ 
          IntrinsicValue]; 
ContinuationValue = 
          RegrMat\  . \ 
            a; 
PrintD["ContinuationValue = ", \ 
          ContinuationValue]; 
Exercise = 
          Flatten[Position[Thread[IntrinsicValue > ContinuationValue], 
              True]]; 
PrintD["Exercise = ", \ 
          Exercise]; 
exer = 
          Transpose[{Table[step\ dt, {Length[Exercise]}], 
              Xdata[\([Exercise]\)]}]; 
exerboun = 
          exerboun~Join~exer; 
PrintD["exer = ", \ 
          exer]; 
k = 
          InMoney[\([Exercise]\)]; 
PrintD["k = ", \ 
          k]; 
CashFlows[\([k]\)] = 
          IntrinsicValue[\([Exercise]\)]; 
PrintD["CashFlows = ", \ 
          CashFlows]; 
ExerciseTime[\([k]\)] = 
          step; 
PrintD["ExerciseTime = ", \ 
          ExerciseTime]
, {step, n - 1, 
          1, \(-1\)}];\)\)
price = 
        Mean[Distribute[
            CashFlows *
              discountVet[[ExerciseTime]]]];
Print["price = ", price]

paths = MapIndexed[{(#2[[1]] - 1) dt , #1} &, #] & /@ 
        Xmat

pathgr = 
      MultipleListPlot[paths, PlotJoined -> True, 
        SymbolShape -> None, PlotStyle -> Dashing[{}], 
        PlotRange -> All, dfi]

exergr = 
      ListPlot[exerboun, PlotStyle -> {PointSize[0.02], Hue[0]}, 
        PlotRange -> All, dfi]

Show[pathgr, exergr, dfdf]