Back in the university I was working on a program that generates a sequence of random autocorrelated numbers. Autocorrelated meaning that each next value is close to the previous one and depends on it but still is random. The sequence was meant to represent a real road surface profile to be used in models of vehicle movement.

Here are the steps of the algorithm:

  1. Measure the real profile $H(l)$.
  2. Find profile's correlation function $R$.
  3. Find approximation for the normalized correlation function:
  4. Calculate coefficients $a$, $b$ for the algorithm based on approximation coefficients $A$, $alpha$, $beta$ and original profile variance $sigma$.

  1. Generate a sequence $x$ of normally distributed random (not autocorrelated) numbers.
  2. Generate points $q$ of the artificial profile in a loop using the algorithm:

Here is the example of the generated profile: enter image description here

As you can tell it looks nice and really smooth and if you could look at it in a larger scale than it would look like a straight horizontal line just like it should.

I have the source code for this project but it is really messy and written in Delphi. It also has a really nasty bug I was unable to fix: the deviation of the resulting sequence (somewhat randomly) doesn't match the deviation of the original sequence so the sequence has to be rescaled. This bug is the main reason for this question. It considerably restricts possible applications of the algorithm.

I don't expect anyone to go deep into my code and the math behind it (it is here in hope that someone remembers seeing something similar), but I would like to use this algorithm now.


  1. Does anyone know what is this algorithm or what's its name?
  2. Are there any libraries that implement it?
  3. Any ideas on where I should look for its implementation?

Here is a screenshot of the program to give you a better idea:

enter image description here

  • $\begingroup$ This is an ARMA(2,1) model. But I do not understand the question. If you wrote the code in one language, you should have no issue with its implementation! $\endgroup$ – Xi'an Mar 25 '18 at 20:18
  • $\begingroup$ @Xi'an The problem is that I have a bug that I am unable to fix and I don't have a clue how to google it and I don't have access to the literature that I took it from. I'll look into ARMA - seems like this might be it. Thanks a lot. $\endgroup$ – grabantot Mar 25 '18 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.