Skip to content

Commit 72739c2

Browse files
committed
old code rm
1 parent 61dd607 commit 72739c2

File tree

4 files changed

+1
-109
lines changed

4 files changed

+1
-109
lines changed

test/optprob_fix.jl

Lines changed: 0 additions & 29 deletions
This file was deleted.

test/problems/jak-stat_model.jl

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,3 @@ function jakstat_obj_component(sim,data,σ)
117117
end
118118
return loss_i
119119
end
120-
121-
#=
122-
optf = OptimizationFunction(loss_func, Optimization.AutoForwardDiff())
123-
#optf = OptimizationFunction(lsq_func, Optimization.AutoFiniteDiff())
124-
_prob = OptimizationProblem(optf, p_best, lb=fill(-Inf,p_len), ub=fill(Inf,p_len))
125-
126-
127-
maxiters = 1000
128-
scan_bounds = (1e-4, 1e4)
129-
Δθ = 0.2
130-
131-
identity_profiler = IntegrationProfiler(integrator=FBDF(autodiff=false), matrix_type=:identity, integrator_opts=(reltol=1e-3, abstol=1e-6, adaptive=false, dt=0.1), gamma = 100.)
132-
hess_profiler = IntegrationProfiler(integrator=FBDF(autodiff=false), matrix_type=:hessian, integrator_opts=(reltol=1e-3, abstol=1e-6, adaptive=false, dt=0.1), gamma = 1.)
133-
opt_profiler = OptimizationProfiler(NLopt.LN_NELDERMEAD, (reltol=1e-3,), :fixed, Δθ, maxiters)
134-
135-
@time opt_prof = profile_parameter(_prob, opt_profiler, 1; scan_bounds, verbose=true)
136-
@time hess_prof = profile_parameter(_prob, hess_profiler, 1; scan_bounds, threashold=threshold, verbose=true)
137-
@time identity_prof = profile_parameter(_prob, identity_profiler, 1; scan_bounds, threashold=threshold, verbose=true)
138-
=#

test/problems/taxol_model.jl

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -121,63 +121,3 @@ end
121121
# https://github.com/marisae/cancer-chemo-identifiability/blob/master/Profile%20Likelihood/testa0_fit.m#L40-L41
122122
sigmasq = (mean([(Cerr005/C005); (Cerr010/C010); (Cerr040/C040); (Cerr100/C100)]))^2
123123

124-
#=
125-
pid = 2
126-
maxiters = 1000
127-
scan_bounds = ((1 - 0.05*14)*p0[pid], (1 + 0.05*60)*p0[pid])
128-
Δθ = 0.2
129-
130-
identity_profiler = IntegrationProfiler(integrator=Rodas4(autodiff=false), matrix_type=:identity, integrator_opts=(reltol=1e-3, abstol=1e-6), gamma = 1.)
131-
hess_profiler = IntegrationProfiler(integrator=Rodas4(autodiff=false), matrix_type=:hessian, integrator_opts=(reltol=1e-3, abstol=1e-6), gamma = 1.)
132-
133-
opt_profiler0 = OptimizationProfiler(NLopt.LN_NELDERMEAD, (reltol=1e-3,), :fixed, Δθ, maxiters)
134-
opt_profiler1 = OptimizationProfiler(NLopt.LN_NELDERMEAD, (reltol=1e-3,), :linear, Δθ, maxiters)
135-
136-
@time opt_prof0 = profile_parameter(_prob, opt_profiler0, pid; scan_bounds, threashold=threshold, verbose=true)
137-
@time opt_prof1 = profile_parameter(_prob, opt_profiler1, pid; scan_bounds, threashold=threshold, verbose=true)
138-
139-
@time hess_prof = profile_parameter(_prob, hess_profiler, pid; scan_bounds, threashold=threshold, verbose=true)
140-
@time identity_prof = profile_parameter(_prob, identity_profiler, pid; scan_bounds, threashold=threshold, verbose=true)
141-
142-
plot(identity_prof, dpi=400, legend=:top, xlabel="ka", ylabel="L(θ)")
143-
plot!(hess_prof, alpha=0, conf_level=false, steps=false)
144-
145-
plot(opt_prof0, dpi=400, legend = :bottomleft, xlabel="ka", ylabel="L(θ)")
146-
plot(opt_prof1, dpi=400, legend=:bottomleft, xlabel="ka", ylabel="L(θ)")
147-
148-
endp = LikelihoodProfiler.ProfileSolution(
149-
nothing,
150-
nothing,
151-
hess_prof.θopt,
152-
[[0., 4.92292246374492, 0., 0., 0.], [0., 10.778706398866387, 0., 0., 0.]],
153-
[hess_prof.flevel, hess_prof.flevel],
154-
2,
155-
#syms::
156-
hess_prof.flevel,
157-
nothing,
158-
nothing
159-
160-
)
161-
162-
df = CSV.read("./lp_ka.csv", DataFrame)
163-
rename!(df, :f=>:obj)
164-
165-
ka_full = LikelihoodProfiler.ProfileSolution(
166-
nothing,
167-
nothing,
168-
hess_prof.θopt,
169-
[[df.ka[i]] for i in 1:64],
170-
[df.obj[i] for i in 1:64],
171-
1,
172-
#syms::
173-
hess_prof.flevel,
174-
nothing,
175-
nothing
176-
177-
)
178-
179-
plot(endp, xticks=[4, 6,7,8,9,10, 4.99, 10.73, 12], xlims=(4.5,11),
180-
dpi=400, legend=:top, xlabel="ka", ylabel="L(θ)", endpoints=true)
181-
scatter!((8.0959,0.538146855), label="optim")
182-
plot!(ka_full, alpha=0.2, conf_level=false)
183-
=#

test/test_jak-stat_model.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ end
6969

7070
# TODO Fix
7171

72-
@testset "JAK2-STAT5 model. Fixed-step OptimizationProfiler with derivative-free optimizer" begin
72+
@testset "JAK2-STAT5 model. Fixed-step OptimizationProfiler with gradient-based optimizer" begin
7373

7474
idxs = 1:9
7575
profile_step(p0, i) = abs(p0[i]) * 0.05

0 commit comments

Comments
 (0)