Default to Newton optimizer if less than 100 datapoints (#842, #870, #888)

This commit is contained in:
Ben Letham 2019-05-07 11:47:36 -07:00
parent 16b0166518
commit e9c017ba01
2 changed files with 2 additions and 0 deletions

View file

@ -1257,6 +1257,7 @@ fit.prophet <- function(m, df, ...) {
object = model,
data = dat,
init = stan_init,
algorithm = if(dat$T < 100) {'Newton'} else {'LBFGS'},
iter = 1e4,
as_vector = FALSE
)

View file

@ -1114,6 +1114,7 @@ class Prophet(object):
args = dict(
data=dat,
init=stan_init,
algorithm='Newton' if dat['T'] < 100 else 'LBFGS',
iter=1e4,
)
args.update(kwargs)