IM given a question on matlab programming.(adsbygoogle = window.adsbygoogle || []).push({});

It ask to construct a numerical generative model for autoregressive model of order two;

xt -xt-1 + 0.5t-2 = et. generate and plot 256 time series samples.

then numerically obtain the spectrum of this time series and plot them.

assuming noise process has variance equal to one.

I have done something but I does look right. what i have computed is it numerical generative ?

et = 1;

n = 257;

x = zeros(n-1,1);

x(1) = rand(1)*4

x(2) = rand(1)*8

for t = 3:n-1;

x(t) = x(t-1) - 0.5*x(t-2) + et

end

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab programming

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**