I am using a function to calculate a likelihood density.
I am running through two xs which are vectors of length 7.
def lhd(x0, x1, dt): #Define a function to calculate the likelihood density given two values.
d = len(x0) #Save the length of the inputs for the below pdf input.
print(d)
print(len(x1))
lh = multivariate_normal.pdf(x1, mean=(1-dt)*x0, cov=2*dt*np.identity(d)) #Take the pdf from a multivariate normal built from x0, given x1.
return lh #Return this pdf value.
The mean here is a vector of length 7, and the covariance is a (7,7) array.
When I run this, I get the error
ValueError: Array 'mean' must be a vector of length 49.
but looking at the formula of the pdf I do not think this is correct. Any idea what is going wrong here?