jmbejara / comp-econ-sp18

Main Course Repository for Computational Methods in Economics (Econ 21410, Spring 2018)
16 stars 23 forks source link

Different results depending on order of variables for covariance matrix? #72

Closed benpicker closed 6 years ago

benpicker commented 6 years ago

I tried both of these

cov = np.array([[1,0,0],
                [0,1,0.5],
                [0,0.5,1]])
df = pd.DataFrame(X, columns=['z1', 'u','epsilon'])
cov2 = np.array([[1,0,0.5],
                [0,1,0],
                [0.5,0,1]])
df = pd.DataFrame(X, columns=[ 'u','z1','epsilon'])

and found they yield different results.

Shouldn't this not matter? Why would the order I put the variables influence the output?

jmbejara commented 6 years ago

This is a point that I hadn't thought of. It should indeed make a difference. I'm not sure how to best explain... The random seed sets the random number generators, but doesn't care about the ordering.