Hello,
I have found the following Matlab Code for generating autocorrelated random values, with a defined autocorrelation on lag 1.
Source: http://www.mathworks.com/matlabcentral/newsreader/view_thread/102939
But I do not know how to reproduce the Matlab Funktion filter.
I have found the following Matlab Code for generating autocorrelated random values, with a defined autocorrelation on lag 1.
Source: http://www.mathworks.com/matlabcentral/newsreader/view_thread/102939
I understand your question such that you want to generate
a time series whose autocorrelation series has certain
properties. The simplest way to do that, is to use
a filter and apply it to a pseudorandom sequence.
In the case of an AR(1) process, this becomes
a time series whose autocorrelation series has certain
properties. The simplest way to do that, is to use
a filter and apply it to a pseudorandom sequence.
In the case of an AR(1) process, this becomes
Code:
a1=0.5;
A=[1,-a1]; # A=[1,-a1] <=> A= c(1, -a1)
x=filter(A,1,randn(1000,1)); # randn(1000,1)) <=> rnorm(1000)
Last edited: