Hello there!
I am currently modifying Facebook’s Prophet to my needs. In contrast to Prophet I use the Pathfinder algorithm which works in most cases. However, I encounter an error on some occasions. The error doesn’t tell much about what went wrong and a Google search didn’t yield anything as well. First, the complete log as produced by cmdstanpy, further down I give some more details about my setup:
method = pathfinder
pathfinder
init_alpha = 0.001 (Default)
tol_obj = 1e-12 (Default)
tol_rel_obj = 10000 (Default)
tol_grad = 1e-08 (Default)
tol_rel_grad = 1e+07 (Default)
tol_param = 1e-08 (Default)
history_size = 5 (Default)
num_psis_draws = 1000 (Default)
num_paths = 4 (Default)
save_single_paths = false (Default)
psis_resample = true (Default)
calculate_lp = true (Default)
max_lbfgs_iters = 1000 (Default)
num_draws = 1000 (Default)
num_elbo_draws = 25 (Default)
id = 1 (Default)
data
file = C:\Users\bkambs\AppData\Local\Temp\tmp2vsplre3\q5jib5wn.json
init = C:\Users\bkambs\AppData\Local\Temp\tmp2vsplre3\5dqex9x2.json
random
seed = 37534
output
file = C:\Users\bkambs\AppData\Local\Temp\tmp2vsplre3\poissongdlmhx6a\poisson-20241113140824.csv
diagnostic_file = (Default)
refresh = 100 (Default)
sig_figs = -1 (Default)
profile_file = profile.csv (Default)
save_cmdstan_config = false (Default)
num_threads = 1 (Default)
Path [1] :Initial log joint density = 288294.244959
Path [1] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
1 2.883e+05 8.325e-07 1.645e+02 7.732e-09 1.000e-03 26 -inf -inf
Path [1] :Failure: None of the LBFGS iterations completed successfully
Pathfinder iteration: 0 failed.
Path [2] :Initial log joint density = 288294.244959
Path [2] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
1 2.883e+05 8.325e-07 1.645e+02 7.732e-09 1.000e-03 26 -inf -inf
Path [2] :Failure: None of the LBFGS iterations completed successfully
Pathfinder iteration: 1 failed.
Path [3] :Initial log joint density = 288294.244959
Path [3] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
1 2.883e+05 8.325e-07 1.645e+02 7.732e-09 1.000e-03 26 -inf -inf
Path [3] :Failure: None of the LBFGS iterations completed successfully
Pathfinder iteration: 2 failed.
Path [4] :Initial log joint density = 288294.244959
Path [4] : Iter log prob ||dx|| ||grad|| alpha alpha0 # evals ELBO Best ELBO Notes
1 2.883e+05 8.325e-07 1.645e+02 7.732e-09 1.000e-03 26 -inf -inf
Path [4] :Failure: None of the LBFGS iterations completed successfully
Pathfinder iteration: 3 failed.
No pathfinders ran successfully
- Prophet’s Stan file is mostly untouched so far. I simply use the poisson glm model instead of the normal distribution one. Plus I changed the prior widths to fit better to the nonlinear link function.
- Prophet doesn’t use Pathfinder but (unless the user wishes otherwise) only MAPE. I use MAPE to initialize the Pathfinder. The MAPE part of my implementation runs error free. The error occurs only in the subsequent pathfinder
- For my toy data set, the error occurs as soon as I reduce the number of possible change points below a certain threshold. For those who are not familiar with Prophet: it uses a piecewise linear model to fit a trend to time series data. Change points are the times at which rate changes occur. In Stan, the trend enters the glm via the offset parameter alpha. The rate changes delta are model parameters with a Laplace prior. Bottom line is: reducing the number of change points is equivalent to reducing the number of model parameters, ie. it may be a rigid model causing the algorithm to fail (though by visual inspection of the fit right above the threshold I wouldn’t say it’s too rigid)
Does anyone by any chance know what can cause this error and give me some hints how to debug it?
Thanks!