Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
montyvesselinov committed Aug 7, 2024
1 parent b0f4089 commit 0aa57fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/MadsLevenbergMarquardt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ function levenberg_marquardt(f::Function, g::Function, x0, o::Function=x->(x'*x)
# Solving for the minimum gives:
# (J'*J + lambda*DtD) * delta_x == -J^T * f(x), where DtD = diagm(sum(J.^2,1))
# Where we use the equivalence: diagm(J'*J) = diagm(sum(J.^2, 1))
# It is additionally useful to bound the elements of DtD below to help prevent "parameter evaporation".
# It is additionally useful to bind the elements of DtD below to help prevent "parameter evaporation".
# DtD = diagm(Float64[max(x, MIN_DIAGONAL) for x in sum( J.^2, 1 )])
# DtDidentity used instead; seems to work better; LM in Mads.c uses DtDidentity
JpJ = J' * J
Expand Down
5 changes: 2 additions & 3 deletions src/MadsPlot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ function plotobsSAresults(madsdata::AbstractDict, result::AbstractDict; filter::
else
d[1,i] = i
no_time_field = true

end
d[2,i] = haskey(obsdict[obskey], "target") ? obsdict[obskey]["target"] : NaN
for (j, paramkey) in enumerate(paramkeys)
Expand All @@ -665,12 +664,12 @@ function plotobsSAresults(madsdata::AbstractDict, result::AbstractDict; filter::
if mintes < 0
tes = tes .- mintes
end
tes ./= maximumnan(tes)
tes ./= maximumnan(tes)
minmes = minimumnan(mes)
if minmes < 0
mes = mes .- minmes
end
mes ./= maximumnan(mes)
mes ./= maximumnan(mes)
smags = order ? sortperm(vec(sum(tes; dims=1)); rev=true) : collect(1:nP)
pp = Array{Any}(undef, 0)
if ytitle != ""
Expand Down
4 changes: 1 addition & 3 deletions src/MadsSensitivityAnalysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ function computeparametersensitities(madsdata::AbstractDict, saresults::Abstract
var = saresults["var"]
pvar = OrderedCollections.OrderedDict{Union{String,Symbol},Float64}() # parameter variance
pmes = OrderedCollections.OrderedDict{Union{String,Symbol},Float64}() # parameter main effect (first order) sensitivities
ptes = OrderedCollections.OrderedDict{Union{String,Symbol},Float64}() # parameter total effect sensitivities
ptes = OrderedCollections.OrderedDict{Union{String,Symbol},Float64}() # parameter total effect sensitivities
for i = eachindex(paramkeys)
pv = pm = pt = 0
for j = eachindex(obskeys)
Expand Down Expand Up @@ -951,7 +951,6 @@ argtext=Dict("madsdata"=>"MADS problem dictionary",
function printSAresults(madsdata::AbstractDict, results::AbstractDict)
mes = results["mes"]
tes = results["tes"]
N = results["samplesize"]
#=
madsoutput("Mean\n")
madsoutput("\t")
Expand Down Expand Up @@ -1033,7 +1032,6 @@ argtext=Dict("madsdata"=>"MADS problem dictionary",
function printSAresults2(madsdata::AbstractDict, results::AbstractDict)
mes = results["mes"]
tes = results["tes"]
N = results["samplesize"]
print("Main Effect Indices")
print("\t")
obskeys = getobskeys(madsdata)
Expand Down

0 comments on commit 0aa57fa

Please sign in to comment.