# Error term in Random walk with drift

In random walk model the error term is generally modelled using normal distribution.

I have two questions.

Q1. How to calculate the parameters of error term in case of Random walk with drift.

Q2. For a data set which follows Weibull distribution. Is it correct if I model the error term of my random walk model with Weibull distribution. If it's correct what is the justification for the same.

• Use consistent terminology. Error vs. Noise. This looks like a homework problem. If so, it might need to be labelled "self-study". – EngrStudent Jun 22 '17 at 16:02
• Edited the question, to make terminology consistent. I recently learned random walk model by myself. I know how to estimate error term parameters of simple random walk, but with drift I didn't got a clear answer. I would appreciate if you can help. – Amit Kumar Jain Jun 22 '17 at 16:15

### How to calculate the parameters of error term in case of Random walk with drift.

The random walk is a sequence of random variables $$X_0=0, X_1, X_2, \ldots, X_n, \ldots$$ for which the differences $$B_i = X_{i}-X_{i-1}$$ have a common distribution $$F$$ and are independent. It is said to have a "drift" equal to the expectation of $$F$$ whenever that expectation is nonzero. Thus, use any reasonable procedure to estimate the parameters of $$F$$ based on the observed differences of the walk.

### Weibull random walks.

When $$F$$ is a Weibull distribution with shape parameter $$a$$ and scale parameter $$b,$$ its expectation is

$$\mu_F = b\,\Gamma\left(1 + \frac{1}{a}\right).$$

To accommodate an arbitrary drift, then, we need to introduce a location parameter $$\mu.$$ In these terms the density function of $$F$$ is that of a "three-parameter Weibull,"

$$f(x;a,b,\mu) = \frac{a}{b}\left(\frac{x-\mu}{b}\right)^{1-a} \exp\left(-\left(\frac{x-\mu}{b}\right)^a\right)$$

and its drift is $$b\,\Gamma(1+1/a) - \mu.$$

You could employ, say, a Maximum Likelihood estimate (MLE) of the three parameters.

Here, for example, are realizations of 100 independent Weibull random walks with drift out to time step $$100.$$ Each is distinguished by color:

The black line is their common drift.

Here is a histogram of their differences with an estimated Weibull density superimposed:

For each realization, the MLE produced estimates of all three parameters. All realizations were generated with a shape parameter of $$2,$$ scale parameter of $$1$$, and $$\mu=-0.1.$$ In the following scatterplot matrix you can see that these estimates are centered around the true values, showing that this procedure works.

Error means "measure of estimate versus target". The target is what? It is the origin.

They say that the distribution of the random walker from the starting point looks like a Gaussian distribution centered on that point. In the limit of infinite steps, the walker can travel extreme distance from the center with very small but nonzero likelihood.

Think about it like a Generalized extreme value distribution. You are trying to find the expectation or the max of your cumulative normal distribution given "n" samples. As "n" increases, what happens to the GEV? It's center moves farther out.

Here is code to model a 1d random walk:

set.seed(164952)

N_test <- 300

max_samples <- 1000
store <- numeric(length = max_samples)

for (i in 2:max_samples){

mystat <- numeric(length = N_test)
for (j in 1:N_test){
y <- cumsum(rnorm(n = i))
mystat[j] <- mean(abs(y))
}

store[i] <- mean(mystat)
}

est <- smooth.spline(x=1:max_samples, y=store)

plot(x=1:max_samples,
y=store,
xlab = "number of samples",
ylab = "typical distance from mean")
lines(est,col="Red")
grid()


(The seed for the random number should look familiar to you. It is your user number.)

Which gives this:

You can see there is consistent progression away from zero as a function of number of samples in the random walk.

If you like you can change line #18 for this:

store[i] <- max(mystat)


It will tell you about the extreme value case.

If you were interested in fun, you might see what equation is fit by the center of the distance as a function of sample count. If you were really interested in fun, you might then find out why, and prove it rigorously.

• First of all thanks for the answer. I am still struggling to find the exact answer of my questions. Will you please answer it more clearly and specifically. – Amit Kumar Jain Jun 22 '17 at 18:25
• Do you have a Weibull distribution in mind? Are shape=5 and scale=1 okay? You know that Weibull has nonzero mean; is that okay, or do you want the data centered? – EngrStudent Jun 22 '17 at 18:39
• Yes. is this Technically wrong? – Amit Kumar Jain Jun 22 '17 at 18:45
• Part of the fun with this, you are asking the question. You can ask any question you like. If your random walker starts at $x_0$ is the same as if they start at $x_1$. If they walk Weibull or normal is up to you. – EngrStudent Jun 22 '17 at 18:52
• So if I want I can model it with WD. Fine. As you said it's mean is not zero. The same is with my noise data it's mean is not zero. Is this ok? – Amit Kumar Jain Jun 22 '17 at 19:02