Commit 919c2f8f authored by MichelJuillard's avatar MichelJuillard
Browse files

correcting bug with presample and diffuse filter + simplified logic

for computation of likelihood with presample
parent 636cd1ba
......@@ -169,9 +169,8 @@ if t<last
end
% Compute minus the log-likelihood.
if presample
if presample>=diffuse_periods
likk = likk(1+(presample-diffuse_periods):end);
end
end
LIK = sum(likk);
\ No newline at end of file
if presample > diffuse_periods
LIK = sum(likk(1+presample-diffuse_periods:end);
else
LIK = sum(likk);
end
\ No newline at end of file
......@@ -111,14 +111,4 @@ end
dlik = dlik(1:s);
dlik = .5*(dlik + pp*log(2*pi));
if presample
if presample>=length(dlik)
dLIK = 0;
dlik = [];
else
dlik = dlik(1+presample:end);
dLIK = sum(dlik);% Minus the log-likelihood (for the initial periods).
end
else
dLIK = sum(dlik);
end
\ No newline at end of file
dLIK = sum(dlik(1+presample:end);
......@@ -139,9 +139,8 @@ if t<last
end
% Compute minus the log-likelihood.
if presample
if presample>=diffuse_periods
lik = lik(1+(presample-diffuse_periods):end);
end
end
LIK = sum(lik);
\ No newline at end of file
if presample>=diffuse_periods
LIK = sum(lik(1+presample-diffuse_periods:end));
else
LIK = sum(lik);
end
\ No newline at end of file
......@@ -125,14 +125,4 @@ end
dlik = .5*dlik(1:s);
if presample
if presample>=length(dlik)
dLIK = 0;
dlik = [];
else
dlik = dlik(1+presample:end);
dLIK = sum(dlik);% Minus the log-likelihood (for the initial periods).
end
else
dLIK = sum(dlik);
end
\ No newline at end of file
dLIK = sum(dlik(1+presample:end));
......@@ -167,9 +167,8 @@ if t<last
end
% Compute minus the log-likelihood.
if presample
if presample>=diffuse_periods
lik = lik(1+(presample-diffuse_periods):end);
end
end
LIK = sum(lik);
\ No newline at end of file
if presample > diffuse_periods
LIK = sum(lik(1+presample-diffuse_periods:end));
else
LIK = sum(lik);
end
\ No newline at end of file
......@@ -164,16 +164,4 @@ end
dlikk = .5*dlikk(1:s);
llik = .5*llik(1:s,:);
if presample
if presample>=length(dlikk)
dLIK = 0;
dlikk= [];
llik = [];
else
dlikk= dlikk(1+presample:end);
llik = llik(1+presample:end,:);
dLIK = sum(dlikk);% Minus the log-likelihood (for the initial periods).
end
else
dLIK = sum(dlikk);
end
\ No newline at end of file
dLIK = sum(dlikk(1+presample:end));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment