# How to Predict Random Numbers

The previous post “Random Numbers Predict Future Temperatures” used random numbers for prediction of climate. Random numbers may also be predicted. This is a major difference between models and natural phenomena. Random numbers generated by computer can always be predicted exactly given knowledge of the code, and so have a deterministic generating mechanism, or model.

The above series of numbers appears to be a temperature trend such as 20th century warming, composed of random fluctuations with a slight upward trend. One might find on fitting a linear regression the coefficients are significant, and then use the model to predict the trend in upward temperatures to continue.

It is actually possible to predict all subsequent numbers in the series exactly with the following deterministic code for generating pseudo-random numbers in R.

```dkrand< -function(n) {
x<-1:n
q<-1:n+1
q[1] <-1426594706
k<-7^5
m<-2^31-1

for (i in x) {
q[i+1]<- (k * q[i]) %% m
x [i]<- q[i+1]/ m
}
return(x)
}
```

This examples shows you should be very concerned if you find a paper in which the authors use a model building technique such as regression and then use it for prediction, treating the resulting models and coefficients as though the model were true.

The confusion is very well described in the essay by Gerard Dallal “The Most Important Lesson You’ll Ever Learn About Multiple Linear Regression Analysis“.
It is well-stated by Chris Chatfield 1995.

It is “well known” to be “logically unsound and practically misleading” to make inference as if a model is known to be true when it has, in fact, been selected from the same data to be used for estimation purposes.

## References

Chris Chatfield in “Model Uncertainty, Data Mining and Statistical Inference”, Journal of the Royal Statistical Society, Series A, 158 (1995), 419-486 (p 421).

## 0 thoughts on “How to Predict Random Numbers”

1. Farrukh says:

Hi,
I wonder that if this formula can be applied on these nubers randomly genrated by computer programme????
869860
422601
900774
115557
695977
860502

and if yes How it is Posible???

2. Farrukh says:

Hi,I wonder that if this formula can be applied on these nubers randomly genrated by computer programme????869860422601900774115557695977860502and if yes How it is Posible???

3. Farrukh says:

Hi,I wonder that if this formula can be applied on these nubers randomly genrated by computer programme????869860422601900774115557695977860502and if yes How it is Posible???

4. Pingback: wynajem samochodow

5. Pingback: warsztaty kulinarne

6. Pingback: in this

7. Pingback: makeanygirlwanttofuck

8. Pingback: visit the website

10. Pingback: how to get your baby to sleep

11. Pingback: testosterone booster

12. Pingback: christian music

13. Pingback: sheet music

15. Pingback: Josh Zipkin

17. Pingback: massage paris

18. Pingback: pomoc pielegniarska wroclaw

19. Pingback: strona www

20. Pingback: polecane masaze

21. Pingback: Party Rentals