Skip to content

Commit

Permalink
Bugfix in objective function
Browse files Browse the repository at this point in the history
  • Loading branch information
qntwrsm committed Aug 1, 2024
1 parent 3d1ace3 commit ab078a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fit/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab078a9

Please sign in to comment.