Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab programming

  1. Dec 10, 2007 #1
    IM given a question on matlab programming.

    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
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted