Skip to content

Commit

Permalink
Merge pull request #31 from PharmCat/dev14
Browse files Browse the repository at this point in the history
double func
  • Loading branch information
PharmCat authored Dec 29, 2022
2 parents 70b675d + f1d3f27 commit c475b5c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/fit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ function fit!(lmm::LMM{T}; kwargs...) where T
varlinkrvecapply!(θ, lmm.covstr.ct; varlinkf = varlinkf, rholinkf = rholinkf)

# Twice differentiable object / reml_sweep_β_nlopt
vloptf(x) = reml_sweep_β(lmm, lmm.dv, varlinkvecapply(x, lmm.covstr.ct; varlinkf = varlinkf, rholinkf = rholinkf); maxthreads = maxthreads)[1]
vloptfd(x) = reml_sweep_β_nlopt(lmm, lmm.dv, varlinkvecapply(x, lmm.covstr.ct; varlinkf = varlinkf, rholinkf = rholinkf); maxthreads = maxthreads)[1]
vloptf(x) = reml_sweep_β(lmm, lmm.dv, varlinkvecapply!(x, lmm.covstr.ct; varlinkf = varlinkf, rholinkf = rholinkf); maxthreads = maxthreads)[1]
vloptfd(x) = reml_sweep_β_nlopt(lmm, lmm.dv, varlinkvecapply!(x, lmm.covstr.ct; varlinkf = varlinkf, rholinkf = rholinkf); maxthreads = maxthreads)[1]

gcfg = ForwardDiff.GradientConfig(vloptf, θ, chunk)
hcfg = ForwardDiff.HessianConfig(vloptf, θ, chunk)
Expand Down
13 changes: 0 additions & 13 deletions src/lmm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,6 @@ function coefn(lmm)
length(lmm.result.beta)
end

tname(t::AbstractTerm) = "$(t.sym)"
tname(t::InteractionTerm) = join(tname.(t.terms), " & ")
tname(t::InterceptTerm) = "(Intercept)"
function tname(t::FunctionTerm)
args = string(t.args_parsed[1])
if length(t.args_parsed) > 1
for i = 2:length(t.args_parsed)
args *= ", "*string(t.args_parsed[i])
end
end
string(t.forig)*"("*args*")"
end

"""
theta(lmm::LMM)
Expand Down
15 changes: 15 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,24 @@ function nterms(rhs::Union{Tuple{Vararg{AbstractTerm}}, Nothing, AbstractTerm})
end
p
end

"""
Rerm name.
"""
tname(t::AbstractTerm) = "$(t.sym)"
tname(t::InteractionTerm) = join(tname.(t.terms), " & ")
tname(t::InterceptTerm) = "(Intercept)"
function tname(t::FunctionTerm)
args = string(t.args_parsed[1])
if length(t.args_parsed) > 1
for i = 2:length(t.args_parsed)
args *= ", "*string(t.args_parsed[i])
end
end
string(t.forig)*"("*args*")"
end


"""
lcontrast(lmm::LMM, i::Int)
Expand Down

2 comments on commit c475b5c

@PharmCat
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/74788

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.14.4 -m "<description of version>" c475b5c835d1a4f30d4ab40449874b30b6f67cf4
git push origin v0.14.4

Please sign in to comment.