We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fed5e1 commit 79b56a6Copy full SHA for 79b56a6
1 file changed
src/lts.jl
@@ -4,6 +4,7 @@ export lts
4
export iterateCSteps
5
6
import ..Basis: RegressionSetting, @extractRegressionSetting, designMatrix, responseVector
7
+import ..OrdinaryLeastSquares: ols, residuals, coef
8
9
import Distributions: sample, mean
10
@@ -49,8 +50,10 @@ function iterateCSteps(
49
50
objective::Float64 = Inf64
51
iter::Int = 0
52
while iter < maxiter
- betas = X[subsetindices, :] \ y[subsetindices]
53
- res = y - X * betas
+ #betas = X[subsetindices, :] \ y[subsetindices]
54
+ #res = y - X * betas
55
+ tempols = ols(X[subsetindices, :], y[subsetindices])
56
+ res = y - X * coef(tempols)
57
sortedresindices = sortperm(abs.(res))
58
subsetindices = sortedresindices[1:h]
59
objective = sum(sort(res .^ 2.0)[1:h])
0 commit comments