Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/tece-lab/DAISIEutils int…
Browse files Browse the repository at this point in the history
…o develop
  • Loading branch information
Neves-P committed May 3, 2023
2 parents c335a51 + 0097e08 commit 91b7bb4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
6 changes: 2 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
URL: https://github.com/tece-lab/DAISIEutils
BugReports: https://github.com/tece-lab/DAISIEutils/issues
Depends: R (>= 4.0.0)
Depends: R (>= 4.2.0)
Suggests:
testthat (>= 3.0.0),
covr,
Expand All @@ -47,8 +47,6 @@ Config/testthat/edition: 3
Imports:
sessioninfo,
testit,
DAISIE (>= 4.3.1),
DAISIE (>= 4.4.0),
ggplot2,
cowplot
Remotes:
rsetienne/DAISIE@v4.3.1
28 changes: 28 additions & 0 deletions R/run_daisie_ml.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,34 @@ run_daisie_ml <- function(daisie_data,
ddmodel <- model_arguments$ddmodel
cs_version <- model_arguments$cs_version

# for relaxed model run initial optimisation for initial parameters
if (grepl("rr", model)) {

# setup diversity-dependent DAISIE model
init_model_arguments <- setup_model(
model = "cr_dd",
low_rates = low_rates,
par_upper_bound = Inf
)
lik_res <- DAISIE::DAISIE_ML(
datalist = daisie_data,
initparsopt = init_model_arguments$initparsopt,
idparsnoshift = init_model_arguments$idparsnoshift,
idparsopt = init_model_arguments$idparsopt,
parsfix = init_model_arguments$parsfix,
idparsfix = init_model_arguments$idparsfix,
res = res,
ddmodel = init_model_arguments$ddmodel,
cond = cond,
methode = methode,
optimmethod = optimmethod,
CS_version = init_model_arguments$cs_version
)

# extract DAISIE parameters for initial parameters
initparsopt[1:5] <- unlist(lik_res)[1:5]
}

##### ML Optimization ####
lik_res <- DAISIE::DAISIE_ML(
datalist = daisie_data,
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
The goal of DAISIEutils is to collect useful utility functions that are used recurrently in DAISIE projects. DAISIEutils is a companion package of the R package [DAISIE](https://github.com/rsetienne/DAISIE).
This includes pipelines for typical analyses using DAISIE's maximum likelihood inference.

**Note**: DAISIEutils depends on the latest CRAN release of DAISIE. It cannot be used with older versions of the DAISIE package.

## Installation

You can install the released version of DAISIEutils from [GitHub](https://github.com/tece-lab/DAISIEutils) with:
Expand Down

0 comments on commit 91b7bb4

Please sign in to comment.