Simple algorithm Exponential weighting
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Thijs Ruigrok
el 11 de Mayo de 2015
Comentada: Thijs Ruigrok
el 13 de Mayo de 2015
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!
0 comentarios
Respuesta aceptada
Christiaan
el 12 de Mayo de 2015
Editada: Christiaan
el 12 de Mayo de 2015
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
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!