Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved optimx default args #278

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
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
12 changes: 11 additions & 1 deletion R/class_clv_model_bgnbd.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ clv.model.bgnbd.no.cov <- function(){
fn.model.generic = bgnbd,
names.original.params.model = c(r="r", alpha="alpha", a="a", b="b"),
names.prefixed.params.model = c("log.r", "log.alpha", "log.a", "log.b"),
start.params.model = c(r=1, alpha = 3, a = 1, b = 3)))
start.params.model = c(r=1, alpha = 3, a = 1, b = 3),
optimx.defaults = list(
method = "L-BFGS-B",
itnmax = 5000,
control = list(
kkt = TRUE,
save.failures = TRUE,
# Do not perform start tests because it checks the scales with max(logpar)-min(logpar)
# but all standard start parameters are <= 0, hence there are no logpars what
# produces a warning
starttests = FALSE))))
}

# Methods --------------------------------------------------------------------------------------------------------------------------------
Expand Down
21 changes: 10 additions & 11 deletions R/class_clv_model_gg.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ clv.model.gg <- function(){
names.original.params.model = c(p="p", q="q", gamma="gamma"),
names.prefixed.params.model = c(log.p="log.p", log.q="log.q", log.gamma="log.gamma"),
start.params.model = c(p=1, q=1, gamma=1),
optimx.defaults = list(method = "L-BFGS-B",
itnmax = 3000,
# upper = c(log(10000),log(10000),log(10000)),
# lower = c(log(0),log(0),log(0)),
control = list(
kkt = TRUE,
save.failures = TRUE,
# Do not perform starttests because it checks the scales with max(logpar)-min(logpar)
# but all standard start parameters are <= 0, hence there are no logpars what
# produces a warning
starttests = FALSE))))
optimx.defaults = list(
method = "L-BFGS-B",
itnmax = 5000,
control = list(
kkt = TRUE,
save.failures = TRUE,
# Do not perform start tests because it checks the scales with max(logpar)-min(logpar)
# but all standard start parameters are <= 0, hence there are no logpars what
# produces a warning
starttests = FALSE))))
}

# Methods --------------------------------------------------------------------------------------------------------------------------------
Expand Down
20 changes: 10 additions & 10 deletions R/class_clv_model_ggomnbd_nocov.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ clv.model.ggomnbd.no.cov <- function(){
names.original.params.model = c(r="r", alpha="alpha", b="b", s="s", beta="beta"),
names.prefixed.params.model = c("log.r","log.alpha", "log.b", "log.s", "log.beta"),
start.params.model = c(r=0.5, alpha=2, b=0.1, s=1, beta=0.1),
optimx.defaults = list(method = "L-BFGS-B",
itnmax = 5000,
control = list(
kkt = TRUE,
all.methods = FALSE,
save.failures = TRUE,
# Do not perform starttests because it checks the scales with max(logpar)-min(logpar)
# but all standard start parameters are <= 0, hence there are no logpars what
# produces a warning
starttests = FALSE))))
optimx.defaults = list(
method = "L-BFGS-B",
itnmax = 5000,
control = list(
kkt = TRUE,
save.failures = TRUE,
# Do not perform start tests because it checks the scales with max(logpar)-min(logpar)
# but all standard start parameters are <= 0, hence there are no logpars what
# produces a warning
starttests = FALSE))))
}

# Methods --------------------------------------------------------------------------------------------------------------------------------
Expand Down
21 changes: 10 additions & 11 deletions R/class_clv_model_pnbd.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ clv.model.pnbd.no.cov <- function(){
names.original.params.model = c(r="r", alpha="alpha", s="s", beta="beta"),
names.prefixed.params.model = c("log.r","log.alpha", "log.s", "log.beta"),
start.params.model = c(r=0.5, alpha=15, s=0.5, beta=10),
optimx.defaults = list(method = "L-BFGS-B",
# lower = c(log(1*10^(-5)),log(1*10^(-5)),log(1*10^(-5)),log(1*10^(-5))),
# upper = c(log(300),log(2000),log(300),log(2000)),
itnmax = 3000,
control = list(
kkt = TRUE,
save.failures = TRUE,
# Do not perform starttests because it checks the scales with max(logpar)-min(logpar)
# but all standard start parameters are <= 0, hence there are no logpars what
# produces a warning
starttests = FALSE))))
optimx.defaults = list(
method = "L-BFGS-B",
itnmax = 5000,
control = list(
kkt = TRUE,
save.failures = TRUE,
# Do not perform start tests because it checks the scales with max(logpar)-min(logpar)
# but all standard start parameters are <= 0, hence there are no logpars what
# produces a warning
starttests = FALSE))))
}


Expand Down
2 changes: 1 addition & 1 deletion R/class_clv_model_pnbd_dynamiccov.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ clv.model.pnbd.dynamic.cov <- function(){
name.model = "Pareto/NBD with Dynamic Covariates",
# Overwrite optimx default args
optimx.defaults = list(method = "Nelder-Mead",
itnmax = 3000,
itnmax = 50000,
control = list(
kkt = TRUE,
save.failures = TRUE,
Expand Down
Loading