Implementing Cross Product in Theano

Hi all,

I could use some help implementing a cross product in Theano. I’m porting over a model from Jackman and am stuck on finding the pymc3 equivalent of:

Sigma = crossprod(diag_pre_multiply(Sigma_scale, Sigma_corr_L))

I can implement in numpy easily enough but Theano doesn’t seem to have the equivalent. Many thanks!

It looks like this is implemented as the product of a matrix with its own transpose. Maybe you could try the following?

import theano as T
X = diag_pre_multiply(Sigma_scale, Sigma_corr_L)
Sigma =, X)

Ah - I handn’t seen that Stan reference; very helpful, thanks so much! I’ll post the result once I give it a go.