필터 지우기
필터 지우기

Simple algorithm Exponential weighting

조회 수: 1 (최근 30일)
Thijs Ruigrok
Thijs Ruigrok 2015년 5월 11일
댓글: Thijs Ruigrok 2015년 5월 13일
Hello,
I need to write an algortihm for the formula:
x=[d(t-1)+A*d(t-2)+(A^2)*d(t-3)+(A^3)*d(t-4)+.....]
with:
for t=1:T d = poissrnd(constant,1,T) A = constant
Every loop I am adding a value to the matrix. The older the value the lower the weighing.
Thanks in advance!

채택된 답변

Christiaan
Christiaan 2015년 5월 12일
편집: Christiaan 2015년 5월 12일
Dear Thijs,
This code may help you on your way:
A=1;
for i=1:10
if i==1
x(i) = 1;
end
if i>1
x(i) = x(i-1) + A^(i-1)*x(i-1)
end
end
Good luck! Christiaan
  댓글 수: 1
Thijs Ruigrok
Thijs Ruigrok 2015년 5월 13일
Hey Christiaan, Thanks for the answer! There is only one problem left. Older values have to get a lower weighting so. The older the value gets the higher the exponent. Cheers

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by