mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-07-30 20:18:11 +00:00
Handle parameter shaping with MCMC and one changepoint (#608)
This commit is contained in:
parent
fe677f290b
commit
91917df8f0
1 changed files with 6 additions and 3 deletions
|
|
@ -1092,7 +1092,6 @@ class Prophet(object):
|
|||
)
|
||||
for par in stan_fit.model_pars:
|
||||
self.params[par] = stan_fit[par]
|
||||
|
||||
else:
|
||||
try:
|
||||
params = model.optimizing(
|
||||
|
|
@ -1103,8 +1102,12 @@ class Prophet(object):
|
|||
dat, init=stan_init, iter=1e4, algorithm='Newton',
|
||||
**kwargs
|
||||
)
|
||||
for par in params:
|
||||
self.params[par] = params[par].reshape((1, -1))
|
||||
self.params = params
|
||||
|
||||
# Reshape all parameters to matrix shape
|
||||
for p, v in self.params.items():
|
||||
if len(v.shape) == 1:
|
||||
self.params[p] = v.reshape((-1, 1))
|
||||
|
||||
# If no changepoints were requested, replace delta with 0s
|
||||
if len(self.changepoints) == 0:
|
||||
|
|
|
|||
Loading…
Reference in a new issue