Skip to content

Commit

Permalink
Remove Hankel for now and update sindy iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCap23 committed Feb 4, 2020
1 parent 1bbb88c commit ea0d9f5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
1 change: 1 addition & 0 deletions src/sindy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ end
function SInDy(X::AbstractArray, Ẋ::AbstractArray, Ψ::Basis, thresholds::AbstractArray ; p::AbstractArray = [], maxiter::Int64 = 10, opt::T = Optimise.STRRidge()) where T <: Optimise.AbstractOptimiser
basis = Basis[]
for threshold in thresholds
set_threshold!(opt, threshold)
try
push!(basis, SInDy(X, Ẋ, Ψ, p = p, maxiter = maxiter, opt = opt))
catch
Expand Down
14 changes: 0 additions & 14 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@ function BIC(k::Int64, X::AbstractArray, Y::AbstractArray; likelyhood = (X,Y) ->
return - 2*log(likelyhood(X, Y)) + k*log(size(X)[2])
end

# Data transformation
function hankel(a::AbstractArray, b::AbstractArray) where T <: Number
p = vcat([a; b[2:end]])
n = length(b)-1
m = length(p)-n+1
H = Array{eltype(p)}(undef, n, m)
@inbounds for i in 1:n
@inbounds for j in 1:m
H[i,j] = p[i+j-1]
end
end
return H
end


# Optimal Shrinkage for data in presence of white noise
# See D. L. Donoho and M. Gavish, "The Optimal Hard Threshold for Singular
Expand Down

0 comments on commit ea0d9f5

Please sign in to comment.