Sheldon Ross 10: Exercise 3.45

Question: An individual traveling on the real line is trying to reach the origin. However, the larger the desired step, the greater is the variance in the result of that step. Specifically, whenever the person is at location x, he next moves to a location having mean 0 and variance βx2. Let Xn denote the position of the individual after having taken n steps. Supposing that X0 = x0, find

  1. E[Xn]
  2. Var(Xn)

Analytical Solution

  1. E[Xn] – Calculation of the expectation is easy. This is an accumulation of events and at each stage, and at every step, the distance moved has a mean of zero. This means the E[Xn] would be the initial position which is x0
  2. Var(Xn) – This can be calculated as follows. Define the variance at the nth step and back calculate using conditionality
    • Var(Xn) = E[(Xn)2] – E[(Xn)]2 = E[(Xn)2] – 0 = E[(Xn)2] = E[(Xn)2|Xn-1] = βE[(Xn-1)2]
    • Applying this recursively, we get βn E[(Xn-1)2]

Simulation Solution

What is being shown in the diagram? The diagrams are semi-self-explanatory

  1. The first one is the progression of the events, as in it shows the position of the person as the iterations progress
  2. The second collects the x0 from across various steps and shows them as distribution at each stage, the labels on the top of the chart element are the E[Xn] for that iterations
  3. The third also collects the x0 from across various steps and shows them as distribution at each stage, but the labels on the top of the chart element are the Var(Xn) for that iterations


Code

Module[
  {\[Beta] = 0.1, iterations = 25, simulation, iterationValues,
    linePlot, distributionMean, distributionVariance,
    aspectRatio = AspectRatio -> 0.3},

  simulation =
      Table[
        NestList[# + RandomVariate[NormalDistribution[0, \[Beta] Power[#, 2]]] &, 1, iterations], 100];
  iterationValues = Transpose@simulation;
  linePlot =
      Labeled[
        ListLinePlot[
          simulation, PlotRange -> {{0, iterations + 1}, All},
          PlotStyle -> {{Thickness[0], Opacity@0.2, Purple}},
          InterpolationOrder -> 2, Frame -> True,
          GridLines -> {Range[0, iterations], None},
          ImageSize -> 788, aspectRatio
        ],
        Rotate["Progression", Divide[Pi, 2]], Left];

  {distributionMean, distributionVariance} =
      Table[
        Labeled[
          DistributionChart[iterationValues, GridLines -> {None, {1}},
            ImageSize -> 788,
            ChartLabels ->
                Placed[Rotate["   " <> ToString[#],
                  Divide[Pi, 2]] & /@ (params[[1]] /@ iterationValues), Above],
            ChartElementFunction -> "PointDensity", aspectRatio],
          Rotate[params[[2]], Divide[Pi, 2]], Left],
        {params, {{Mean, "Mean"}, {Variance, "Variance"}}}];

  Framed@Column[{linePlot, distributionMean, distributionVariance}]
]

End of the post 😉


.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.