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

Error for example stockmarketfluctuations.ipynb #45

Open
ricnov opened this issue Sep 2, 2024 · 0 comments
Open

Error for example stockmarketfluctuations.ipynb #45

ricnov opened this issue Sep 2, 2024 · 0 comments

Comments

@ricnov
Copy link

ricnov commented Sep 2, 2024

Hi, I have the following error: ValueError: operands could not be broadcast together with shapes (388,100,400) (0,)
Here's the traceback
``ValueError Traceback (most recent call last)
Cell In[18], line 15
13 # parameter plot
14 plt.subplot(212)
---> 15 S.plot('sigma', color='r')
17 plt.xticks([28, 88, 148, 208, 268, 328, 388],
18 ['10am', '11am', '12pm', '1pm', '2pm', '3pm', '4pm'])
19 plt.xlabel('Nov 28, 2016')

File ~\PycharmProjects\StocklMarketFluctuations\venv\lib\site-packages\bayesloop\core.py:2946, in OnlineStudy.plot(self, name, **kwargs)
2944 color = kwargs.pop('color', 'b')
2945 gamma = kwargs.pop('gamma', 0.5)
-> 2946 self.plotParameterEvolution(name, color=color, gamma=gamma, **kwargs)
2948 # parameter distribution plot
2949 elif t is not None and self.storeHistory:

File ~\PycharmProjects\StocklMarketFluctuations\venv\lib\site-packages\bayesloop\core.py:2375, in OnlineStudy.plotParameterEvolution(self, name, color, gamma, **kwargs)
2372 self.posteriorMeanValues = np.array(self.posteriorMeanValues).T
2373 self.posteriorSequence = np.array(self.posteriorSequence)
-> 2375 Study.plotParameterEvolution(self, name, color=color, gamma=gamma, **kwargs)
2377 # re-transform arrays to lists, so online study may continue to append values
2378 self.formattedTimestamps = list(self.formattedTimestamps)

File ~\PycharmProjects\StocklMarketFluctuations\venv\lib\site-packages\bayesloop\core.py:1015, in Study.plotParameterEvolution(self, name, color, gamma, **kwargs)
1003 def plotParameterEvolution(self, name, color='b', gamma=0.5, **kwargs):
1004 """
1005 Extended plot method to display a series of marginal posterior distributions corresponding to a single model
1006 parameter. In contrast to getMarginalParameterDistributions(), this method includes the removal of plotting
(...)
1013 kwargs: all further keyword-arguments are passed to the plot of the posterior mean values
1014 """
-> 1015 if self.posteriorSequence == []:
1016 raise PostProcessingError('Cannot plot posterior sequence as it has not yet been computed. '
1017 'Run complete fit.')
1019 dt = self.formattedTimestamps[1:] - self.formattedTimestamps[:-1]

ValueError: operands could not be broadcast together with shapes (388,100,400) (0,)``

@ricnov ricnov changed the title Error for example stockmarketfluctuations Error for example stockmarketfluctuations.ipynb Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant