Help calculating variance of a random variable

139 Views Asked by At

This is related to this question Average end point of 1-dimensional random walk?

Given several discrete random variables such that $p(Z_i=1-2k)=p$, where $k$ is a small real number, and $p(Z_i=-1)=1-p$, a random walk is the sum $X_t = \sum\limits_{i=1}^t Z_i$.

The expectation is given by: $$\mathbb{E}[X_t] = \sum\limits_{i=1}^t\mathbb{E}[Z_i] = \sum\limits_{i=1}^tp(1-2k) -(1-p) = (p(1-2k)+p-1)t$$

1- I would like to calculate the standard deviation of the random walk and also the standard deviation of the mean.

For the first one I need to calculate the variance of $X_t$ and for the second one I need the variance of $E[X_t]$.

2- Also I would like to do these calculations using Mathematica but I don't know how to define the distribution.

Trying to do the first calculation by hand and using the definition of variance: $$Var[X_t]=E[X_t^2]-(E[X_t])^2$$

How do I calculate $E[X_t^2]$?

Thanks.

1

There are 1 best solutions below

1
On

By definition, $E[z(X)]=\sum z(x)*f(x)$, where $f(x)$ is the density. So,

$$ E[X_t^2] = p*(1-2k)^2 + (1-p)*(-1)^2 = p-4kp+4pk^2+1-p=4pk^2+1-4pk$$