Skip to main content
. 2020 Dec 30;13(1):42. doi: 10.3390/pharmaceutics13010042
Algorithm 1 Nonparametric adaptive grid (NPAG) algorithm. Input: (Y,ϕ0,a,b,ΔD,ΔL,ΔF,Δe,Δλ), a and b are the lists of lower and upper bounds, respectively, of Θ; ΔD is the minimum distance allowable between points in the estimated FML. Δx see Section 2.7. Output: (ϕ,λ,l(λ,ϕ))
1: procedureNPAG(Y, ϕ0,a,b,ΔD) ▹ Estimate FML given Y
2:       Initialization: ϕ=ϕ0, LogLike=1030, F0=1030, F1=2F0, eps=0.2, Δe=104, ΔF=102, ΔL=104, Δλ=103, n=0
3:       while epsΔe or |F1F0|ΔF do
4:         Calculate Ψ(ϕ) N×K matrix {p(Yi|ϕk)}
5:         [λ^(ϕ),l(λ^(ϕ),ϕ)]PDIP(Ψ(ϕ)) Appendix A
6:         if MAXCYCLES==0 then
7:            FestMLl(λ^(ϕ),ϕ)
8:            λλ^(ϕ)
9:            return [ϕ,λ,FestML]
10:         end if
11:         nn+1
12:         ϕcCONDENSE(ϕ,λ^(ϕ),Δλ) ▹ Algorithm 3
13:         [λ^(ϕc),l(λ^(ϕc),ϕc)]PDIP(Ψ(ϕc)) PDIPreturnsGn
14:         NewLogLike=l(λ^(ϕc),ϕc)
15:         if n>MAXCYCLES then
16:            FestMLl(λ^(ϕc),ϕc)
17:            λλ^(ϕc)
18:            return [ϕ,λ,FestML]
19:         end if
20:         if |NewLogLikeLogLike|ΔL and eps>Δe then
21:            eps=eps/2 ▹ Adjust precision
22:         end if
23:         if epsΔethen ▹ check EXIT conditions
24:            F1=NewLogLike
25:            if |F1F0|ΔF then
26:                FestMLF1
27:                ϕϕc;λλ^(ϕc)
28:                return [ϕ,λ,FestML]
29:            else
30:                F0=F1; eps=0.2 ▹ Reset Algorithm
31:            end if
32:         end if
33:         ϕϕeEXPAND(ϕc,eps,a,b,ΔD) ▹ Algorithm 2
34:         LogLikeNewLogLike
35:     end while
36: end procedure