outside-edge / python-espncricinfo

Python wrapper for the ESPNCricInfo JSON API
MIT License
146 stars 64 forks source link

Error: Float objet cannot be interpreted as integer #22

Closed Laurelborggreve closed 6 years ago

Laurelborggreve commented 6 years ago

Hi, I am trying to simulate data from the DCC model and I have to create matrices with some formulas. I am trying to create the first matrix, mQ, but I am getting the same error all the time. This is (part of) my code:

iN = 10000 dOmega = 0.1 dAlpha = 0.05 dBeta = 0.94 vEps = np.random.normal(size=iN);

def computeMQ(iN, dAlpha, dBeta, mS, vEps, mQ): """ Purpose: Compute mQ

Inputs:
    ...

Return value:
    mQ     correlation driving process
"""

# Define mQ
mQ = np.zeros(shape=(iN,iN))

# Compute mQ 

for i in range(iN): for i in range(iN): mQ[i,i] = np.ndarray(1 - dAlpha - dBeta) mS + np.ndarray(dAlpha (vEps[i-1] np.transpose(vEps[i-1]))) + (np.ndarray(dBeta) mQ[i-1])

I hope someone can help me, because I have no idea what to do!! And I also tried to calculate mQ without using np.ndarray but then sometimes I get the error: setting an array element with a sequence.

I can also upload my whole code if someone would like to see that in order to help me.

Thanks!!