# how to estimate a variable's upper limit with 95% confidence level?

Suppose I have a variable, $S(t)$, for stock price. So always have $S(t) > 0$.

$S(t)$ is a random variable, with some volatility $\sigma$ and trend.

Now the requirement is to estimate $\hat S(t+1)$ with at 95% confidence level, or: estimate $\hat S(t+1)$ based on $S(0)$, $S(1)$, ..., $S(t)$, so that 95% of the time $S(t+1) < \hat S(t+1)$.

If it's not for the 95% confidence level, it's easy, I could just use regression to genereate a formula something like $$S(t+1) = a_0 + a_1 S(t) + a_2 S(t-1) ... + a_m S(t-m+1)$$ .

But such estimation is only predicting the "trend", not considering the volatility and 95% confidence level.

If it's not for the trend, it's also easy, I could just get the 95% percentile value from history S:

$\hat S(t+1) = 95 %$ percentile value of $S(t), S(t-1), ... S(t-m)$

, maybe could choose $m = 36%$, using 3 years' data.

But such prediction would not cater the trend -- if there is a trend in the market that the Stock price rises, the estimation will always be lower than the future realized.

How could I have a $\hat S(t+1)$ that could cater both "trend" and "95% confidence level"?

Please notice here we didn't assume any parametric model about Stock price's distribution.

-

## 1 Answer

The standard Kalman filter can be used for this. It makes some assumptions about Gaussianity of observations and updates, but it easily gives you a prediction for the next step expressed as a mean and variance. If you want to go beyond Gaussianity, there are some extensions ("unscented" Kalman filter etc) which you could go into.

EDIT: actually, not sure if it's easy to incorporate the "trend" aspect here. The basic application of Kalman filter would not do this, you simply specify the update matrix in advance. However, it might well be possible to use the framework with an unknown trend as one element in the update matrix, and fit that.

-
thanks, after reading the wiki page i guess it works! –  athos Feb 26 '13 at 1:53