From ab078a99d19b049dc72ae83a9d998689ed5ca039 Mon Sep 17 00:00:00 2001 From: Quint Wiersma Date: Thu, 1 Aug 2024 22:42:40 +0200 Subject: [PATCH] Bugfix in objective function --- src/fit/utilities.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fit/utilities.jl b/src/fit/utilities.jl index 317cb91..e3a5ebc 100644 --- a/src/fit/utilities.jl +++ b/src/fit/utilities.jl @@ -411,9 +411,9 @@ end function objective(model::DynamicFactorModel, regularizer::NamedTuple) f = loglikelihood(model) - isnothing(regularizer.factors) || (f += regularizer.factors(loadings(model))) - isnothing(regularizer.mean) || (f += regularizer.mean(slopes(mean(model)))) - isnothing(regularizer.error) || (f += regularizer.error(cov(errors(model)))) + isnothing(regularizer.factors) || (f -= regularizer.factors(loadings(model))) + isnothing(regularizer.mean) || (f -= regularizer.mean(slopes(mean(model)))) + isnothing(regularizer.error) || (f -= regularizer.error(cov(errors(model)))) return f end