mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-18 08:53:42 +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:
|
for par in stan_fit.model_pars:
|
||||||
self.params[par] = stan_fit[par]
|
self.params[par] = stan_fit[par]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
params = model.optimizing(
|
params = model.optimizing(
|
||||||
|
|
@ -1103,8 +1102,12 @@ class Prophet(object):
|
||||||
dat, init=stan_init, iter=1e4, algorithm='Newton',
|
dat, init=stan_init, iter=1e4, algorithm='Newton',
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
for par in params:
|
self.params = params
|
||||||
self.params[par] = params[par].reshape((1, -1))
|
|
||||||
|
# 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 no changepoints were requested, replace delta with 0s
|
||||||
if len(self.changepoints) == 0:
|
if len(self.changepoints) == 0:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue