Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion DDD.Rproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Version: 1.0
ProjectId: cbff7951-4a06-4670-bbdf-df0ae63c05bf

RestoreWorkspace: Default
SaveWorkspace: Default
Expand Down
7 changes: 7 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ dd_integrate_bw_odeint <- function(ry, times, pars, atol, rtol, stepper) {
#' @useDynLib DDD
NULL

dd_integrate_log_odeint <- function(ry, times, pars, atol, rtol, stepper) {
.Call('_DDD_dd_integrate_log_odeint', PACKAGE = 'DDD', ry, times, pars, atol, rtol, stepper)
}

#' @useDynLib DDD
NULL

dd_integrate_odeint <- function(ry, times, pars, atol, rtol, stepper) {
.Call('_DDD_dd_integrate_odeint', PACKAGE = 'DDD', ry, times, pars, atol, rtol, stepper)
}
Expand Down
5 changes: 4 additions & 1 deletion R/dd_ML.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ parsfixdefault = function(ddmodel,brts,missnumspec,idparsopt)
#' tolerance of parameter values in optimization
#' @param tolint Sets the tolerance of the numerical integration. COnsists of:
#' \cr absoltint = absolute tolerance and \cr reltolint = relative tolerance.
#' @param k_threshold Sets the threshold of number of species above which
#' logarithmic integration must be used. Default is Inf.
#' @param maxiter Sets the maximum number of iterations in the optimization
#' @param changeloglikifnoconv if TRUE the loglik will be set to -Inf if ML
#' does not converge
Expand Down Expand Up @@ -148,6 +150,7 @@ dd_ML = function(
soc = 2,
tol = c(1E-3, 1E-4, 1E-6),
tolint = c(1E-10,1E-8),
k_threshold = 3,
maxiter = 1000 * round((1.25)^length(idparsopt)),
changeloglikifnoconv = FALSE,
optimmethod = 'simplex',
Expand Down Expand Up @@ -186,7 +189,7 @@ dd_ML = function(
trparsopt[which(initparsopt == Inf)] = 1
trparsfix = parsfix/(1 + parsfix)
trparsfix[which(parsfix == Inf)] = 1
pars2 = c(res,ddmodel,cond,btorph,verbose,soc,tol,maxiter,abstolint = tolint[1],reltolint = tolint[2])
pars2 = c(res,ddmodel,cond,btorph,verbose,soc,tol,maxiter,abstolint = tolint[1],reltolint = tolint[2],k_threshold = k_threshold)
optimpars = c(tol,maxiter)
initloglik = dd_loglik_choosepar(trparsopt = trparsopt,trparsfix = trparsfix,idparsopt = idparsopt,idparsfix = idparsfix,pars2 = pars2,brts = brts,missnumspec = missnumspec, methode = methode)
cat("The loglikelihood for the initial parameter values is",initloglik,"\n")
Expand Down
Loading
Loading