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

Multiple independent random walks with differing innovation sds #4409

Closed
martiningram opened this issue Jan 8, 2021 · 3 comments
Closed

Comments

@martiningram
Copy link
Contributor

Hi all,

Following on from a post on discourse, Junpeng asked me to open an issue.

I am trying to declare a GaussianRandomWalk prior on multiple time series, each independent and with its own random walk standard deviation. I tried:

mean_sigma = pm.HalfNormal('mean_rw_sigma', 1., shape=n_tourneys)
prior_means = pm.GaussianRandomWalk('prior_means', sigma=mean_sigma, shape=(n_years-1, n_tourneys))

but this does not compile, giving the error:

ValueError: Input dimension mis-match. (input[0].shape[1] = 3, input[1].shape[1] = 4)

Junpeng mentioned that this likely used to work but was broken by a helper. He also mentioned a workaround with a diagonal covariance matrix, which should work but presumably this version would be more efficient.

Versions and main components

  • PyMC3 Version: 3.10.0
  • Theano Version: 1.0.14
  • Python Version: 3.7.9
  • Operating system: Ubuntu
  • How did you install PyMC3: pip
@junpenglao
Copy link
Member

To add some context, the helper function is assuming the first dimension is time dimension. One workaround is to check the shape and only execute if the mu.shape[0] == shape[0]

@Sayam753
Copy link
Member

Sayam753 commented Jan 8, 2021

I think the issue is similar to #4010

@junpenglao
Copy link
Member

You are right, mark as duplicate.

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

3 participants