diff --git a/matlab/+var_expectation/update_parameters.m b/matlab/+var_expectation/update_parameters.m index f6f638b805c6cbc9f1ddc0c93d9531e1e36f415f..df6aed8659ad43ecdbd43ad026e7dbb106abb822 100644 --- a/matlab/+var_expectation/update_parameters.m +++ b/matlab/+var_expectation/update_parameters.m @@ -179,8 +179,8 @@ else % Define the discounted companion matrix DiscountedCompanionMatrix = discountfactor*CompanionMatrix; % First compute the parameters implied by the discounted sum from h=0 to h=horizon(1)-1 - tmp1 = eye(n); - for h=1:horizon(1) + tmp1 = zeros(n); + for h=0:horizon(1)-1 tmp1 = tmp1 + mpower(DiscountedCompanionMatrix, h); end tmp1 = alpha*tmp1;