You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
calling fit(FactorAnalysis, x) sometimes would get:
ERROR: DomainError with -0.9999999999999778:
sqrt will only return a complex result if called with a complex argument. Try sqrt(Complex(x)).
Stacktrace:
[1] throw_complex_domainerror(f::Symbol, x::Float64)
@ Base.Math ./math.jl:33
[2] sqrt(x::Float64)
@ Base.Math ./math.jl:582
[3] facm(S::Matrix{Float64}, mv::Vector{Float64}, n::Int64; maxoutdim::Int64, tol::Float64, η::Float64, maxiter::Int64)
@ MultivariateStats ~/.julia/packages/MultivariateStats/HTpHt/src/fa.jl:119
[4] fit(::Type{MultivariateStats.FactorAnalysis}, X::Matrix{Float64}; method::Symbol, maxoutdim::Int64, mean::Int64, tol::Float64, η::Float64, maxiter::Int64)
@ MultivariateStats ~/.julia/packages/MultivariateStats/HTpHt/src/fa.jl:173
which should be caused by:
q′ = λ[q] > 0 ? q : findlast(λ .> 0)
λq = 0.0
@inbounds for i in 1:q′
λq += log(λ[i]) - λ[i] + 1.
V[i] = sqrt(λ[i] - 1.) # <--- λ is guaranteed to be > 0, but NOT >= 1
end
inside facm(). In fact, the λ can be smaller than 1, and an error would be triggered.
The text was updated successfully, but these errors were encountered:
wildart
added a commit
to wildart/MultivariateStats.jl
that referenced
this issue
Jan 25, 2022
calling
fit(FactorAnalysis, x)
sometimes would get:which should be caused by:
inside
facm()
. In fact, theλ
can be smaller than 1, and an error would be triggered.The text was updated successfully, but these errors were encountered: