Reputation: 859
I want to create several random walk variables in PyMC3, or rather, stack several random walks into a single variable. I know I can create a single random walk of 100 steps like this:
with pm.Model() as model():
z = pm.GaussianRandomWalk('z', mu=0, sd=1, shape=100)
But let's say I want to create 20 random walks, each of length 100. If I write this,
with pm.Model() as model():
z = pm.GaussianRandomWalk('z', mu=0, sd=1, shape=(20,100))
Does that make every row a random walk, so I have 20 instances of 100 steps each? Or does it make every column a random walk, so I have 100 instances of 20 steps each?
Upvotes: 1
Views: 690
Reputation: 424
You will have 100 instances of 20 steps each.
The time-series distributions in PyMC3 is not very rigour - it was designed with only 1D time series in mind, so do be careful when you are working with multiple time-series.
Upvotes: 0