필터 지우기
필터 지우기

how to generate moving average time series data? in detalies

조회 수: 2 (최근 30일)
arkedia
arkedia 2013년 6월 5일
I want to generate a data from a moving average time series model of order 1and 2 and 3 with different theta =0.8, 0.5, 0.9 i'v tried the following code... function z = armasim(phi,theta,n) % ARMASIM(PHI,THETA,N) generates N observations from the % ARMA model specified by PHI, THETA % It "burns in" with the 1st 200 observations [p m] = size(phi); [q m] = size(theta); n1 = 200+n; a = normrnd(0,1,n1+q,1); z = zeros(p,1); for i=1:n1 zt = z(i:(i+p-1))'*phi(p:-1:1)+a(i+q)-a(i:(i+q-1))'*theta(q:-1:1); z = [ z ; zt ]; end z = z((201+p):(n1+p)); But when i plot the data it's not moving average plot so i'm asking if their is another avelable code to use it

답변 (0개)

카테고리

Help CenterFile Exchange에서 Conditional Mean Models에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by