Closed jbytecode closed 3 years ago
@tantei3 we have
ols(X::Array{Float64,2}, y::Array{Float64,1})::OLS = OLS(X, y, inv(X' * X) * X' * y)
in /src/ols.jl and the method inv throws error in the case of singularity. How about changing the method as
/src/ols.jl
inv
ols(X::Array{Float64,2}, y::Array{Float64,1}; inversefunction = inv)::OLS = OLS(X, y, inversefunction(X' * X) * X' * y)
so some methods can call it using pinv from package LinearAlgebra using
pinv
ols(X, y, inversefunction = pinv)
by this change, you can remove the try catch block in ransac method.
ransac
@tantei3 we have
ols(X::Array{Float64,2}, y::Array{Float64,1})::OLS = OLS(X, y, inv(X' * X) * X' * y)
in
/src/ols.jl
and the methodinv
throws error in the case of singularity. How about changing the method asols(X::Array{Float64,2}, y::Array{Float64,1}; inversefunction = inv)::OLS = OLS(X, y, inversefunction(X' * X) * X' * y)
so some methods can call it using
pinv
from package LinearAlgebra usingols(X, y, inversefunction = pinv)
by this change, you can remove the try catch block in
ransac
method.