Skip to content

Commit

Permalink
Update ccf.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytecode authored Oct 19, 2020
1 parent 275b74f commit 565279a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ccf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Dict{Any,Any} with 4 entries:
```
# References
Barratt, S., Angeris, G. & Boyd, S. Minimizing a sum of clipped convex functions. Optim Lett 14, 2443–2459 (2020). https://doi.org/10.1007/s11590-020-01565-4
"""
function ccf(setting::RegressionSetting; starting_lambdas=nothing, alpha=nothing, p=3, max_iter=100, gamma=.1, tol=1e-4)
X = designMatrix(setting)
Expand All @@ -49,6 +52,9 @@ Perform signed gradient descent for clipped convex functions for a given regress
- `beta::Float64`: Step size parameter.
- `tol::Float64`: Tolerance below which convergence is declared.
# References
Barratt, S., Angeris, G. & Boyd, S. Minimizing a sum of clipped convex functions. Optim Lett 14, 2443–2459 (2020). https://doi.org/10.1007/s11590-020-01565-4
"""
function ccf(X::Array{Float64,2}, y::Array{Float64,1}; starting_lambdas=nothing, alpha=nothing, p=3, max_iter=100, gamma=.1, tol=1e-4)
n, p = size(X)
Expand Down Expand Up @@ -87,4 +93,4 @@ function ccf(X::Array{Float64,2}, y::Array{Float64,1}; starting_lambdas=nothing,
result["outliers"] = findall(residuals .^ 2 .> alpha)

return result
end
end

0 comments on commit 565279a

Please sign in to comment.