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 Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by