@@ -15,18 +15,16 @@ using Optimization: AbstractADType
15
15
Constructs `LikelihoodProblem` struct from given `DataModel`.
16
16
"""
17
17
function ProfileLikelihood. LikelihoodProblem (DM:: AbstractDataModel , Mle:: AbstractVector = MLE (DM);
18
- adtype:: AbstractADType = Optimization. AutoForwardDiff (), Domain:: Union{HyperCube,Nothing} = GetDomain (DM),
19
- syms:: AbstractVector{<:Symbol} = Pnames (DM), maxval :: Real = 1e5 ,
18
+ adtype:: AbstractADType = Optimization. AutoForwardDiff (), maxval :: Real = 1e5 , Domain:: Union{HyperCube,Nothing} = GetDomain (DM) ∩ FullDomain ( length (Mle),maxval ),
19
+ syms:: AbstractVector{<:Symbol} = Pnames (DM), LogLikelihooodFn :: Function = InformationGeometry . loglikelihood (DM) ,
20
20
lb= (! isnothing (Domain) ? Domain. L : fill (- maxval,length (Mle))), ub= (! isnothing (Domain) ? Domain. U : fill (maxval,length (Mle))),
21
21
cons= nothing , lcons= nothing , ucons= nothing , f_kwargs= NamedTuple (), prob_kwargs= NamedTuple (), kwargs... )
22
22
23
- L = InformationGeometry. loglikelihood (DM)
24
-
25
23
f_kwargs = (; adtype= adtype, cons= cons, f_kwargs... )
26
24
# any(isfinite, lb) && any(isfinite, lb) &&
27
25
prob_kwargs = (; lb= lb, ub= ub, prob_kwargs... )
28
26
29
- ProfileLikelihood. LikelihoodProblem ((p,x)-> L (p), Mle; syms, f_kwargs= f_kwargs, prob_kwargs= prob_kwargs, kwargs... )
27
+ ProfileLikelihood. LikelihoodProblem ((p,x)-> LogLikelihooodFn (p), Mle; syms, f_kwargs= f_kwargs, prob_kwargs= prob_kwargs, kwargs... )
30
28
end
31
29
32
30
35
33
Computes profiles for given `idxs` up to given confidence threshold `Confnum` in units of `σ` via the `ProfileLikelihood.jl` package.
36
34
"""
37
35
function ProfileLikelihood. profile (DM:: AbstractDataModel , Confnum:: Real = 1 ; idxs= 1 : pdim (DM), N:: Int = 31 , meth= Optim. LBFGS (), OptimMeth= meth, alg= OptimMeth,
38
- parallel:: Bool = true , resolution= N, Domain :: Union{HyperCube,Nothing} = GetDomain (DM), maxval:: Real = 1e5 , Mle:: AbstractVector = MLE (DM),
36
+ parallel:: Bool = true , resolution= N, maxval:: Real = 1e5 , Mle:: AbstractVector = MLE (DM), Domain :: Union{HyperCube,Nothing} = GetDomain (DM) ∩ FullDomain ( length (Mle),maxval),
39
37
lb= (! isnothing (Domain) ? Domain. L : fill (- maxval,length (Mle))), ub= (! isnothing (Domain) ? Domain. U : fill (maxval,length (Mle))), kwargs... )
40
38
prob = ProfileLikelihood. LikelihoodProblem (DM; Domain, maxval, lb, ub)
41
39
sol = ProfileLikelihood. mle (prob, alg)
49
47
Computes bivariate profiles for given `idxs` up to given confidence threshold `Confnum` in units of `σ`, where pairs of parameters are fixed at different values and the remaining parameters are re-optimized.
50
48
"""
51
49
function ProfileLikelihood. bivariate_profile (DM:: AbstractDataModel , Confnum:: Real = 1 ; idxs= nothing , N:: Int = 31 , meth= Optim. LBFGS (), OptimMeth= meth, alg= OptimMeth,
52
- parallel:: Bool = true , resolution= N, Domain :: Union{HyperCube,Nothing} = GetDomain (DM), maxval:: Real = 1e5 , Mle:: AbstractVector = MLE (DM),
50
+ parallel:: Bool = true , resolution= N, maxval:: Real = 1e5 , Mle:: AbstractVector = MLE (DM), Domain :: Union{HyperCube,Nothing} = GetDomain (DM) ∩ FullDomain ( length (Mle),maxval ),
53
51
lb= (! isnothing (Domain) ? Domain. L : fill (- maxval,length (Mle))), ub= (! isnothing (Domain) ? Domain. U : fill (maxval,length (Mle))), kwargs... )
54
52
prob = ProfileLikelihood. LikelihoodProblem (DM; Domain, maxval, lb, ub)
55
53
sol = ProfileLikelihood. mle (prob, alg)
0 commit comments