Skip to content

Commit

Permalink
Looser gap tolerenace and don't use informationless observations en n…
Browse files Browse the repository at this point in the history
…pqreg. (#41)
  • Loading branch information
pkofod authored May 4, 2020
1 parent ecac6eb commit 0bf6bbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/InteriorPoint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ b = X'x

# Set some constants
beta = 0.99995
small = 1e-8
small = 1e-6
max_it = 500
n, m = size(X)
# Generate inital feasible point
Expand All @@ -56,7 +56,6 @@ if method.cholesky
else
y = -X\Y
end

dy = copy(y)
r = c - X*y
BLAS.axpy!(0.001, (r .== 0.0).*1.0, r)
Expand Down
9 changes: 5 additions & 4 deletions src/npqreg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ function npqreg(y, x, tau, method=IP(); m=50, h=2, xrange=nothing)
end
z = copy(x)
Z = hcat(fill(1, length(x)), z)

ghat = copy(xrange)
dghat = copy(xrange)
for i in 1:length(xrange)
z .= x .- xrange[i]
Z[:, 2] .= z

w = clamp.(pdf.(Normal(), z./h), eps(T), T(Inf))
wy = w.*y
wZ = w.*Z
w = pdf.(Normal(), z./h)
widx = findall(x-> x > eps(T), w)
w = w[widx]
wy = w.*y[widx]
wZ = w.*Z[widx, :]

r = qreg_coef(wy, wZ, tau, method)

Expand Down

0 comments on commit 0bf6bbd

Please sign in to comment.