diff --git a/matlab/kalman/likelihood/univariate_kalman_filter.m b/matlab/kalman/likelihood/univariate_kalman_filter.m
index 43c86035902533fbf46ef58d1957e9ce55250b71..37ce2063114a2eebfa957548904698bf5ebdfccf 100644
--- a/matlab/kalman/likelihood/univariate_kalman_filter.m
+++ b/matlab/kalman/likelihood/univariate_kalman_filter.m
@@ -126,7 +126,6 @@ QQ   = R*Q*transpose(R);   % Variance of R times the vector of structural innova
 t    = start;              % Initialization of the time index.
 lik  = zeros(smpl,pp);     % Initialization of the matrix gathering the densities at each time and each observable
 LIK  = Inf;                % Default value of the log likelihood.
-oldP = Inf;
 l2pi = log(2*pi);
 notsteady = 1;
 
@@ -149,11 +148,9 @@ else
     else
         C=Z;
     end
-    dC = zeros(pp,mm,k);   % either selection matrix or schur have zero derivatives
     if analytic_derivation==2
         Hess  = zeros(k,k);                             % Initialization of the Hessian
         D2a    = zeros(mm,k,k);                             % State vector.
-        d2C = zeros(pp,mm,k,k);
     else
         asy_hess=D2T;
         Hess=[];
@@ -178,7 +175,6 @@ while notsteady && t<=last %loop over t
     else
         z = Z(d_index);
     end
-    oldP = P(:);
     for i=1:rows(z) %loop over i
         if Zflag
             prediction_error = Y(d_index(i),t) - z(i,:)*a;  % nu_{t,i} in 6.13 in DK (2012)