UC-MACSS / persp-model_W18

Course site for MACS 30100 (Winter 2018) - Perspectives on Computational Modeling
7 stars 54 forks source link

Calculate VCV from the results of minimize function #55

Open FuZhiyu opened 6 years ago

FuZhiyu commented 6 years ago

In the notebook MLest, we use vcv_mle = results.hess_inv * OffDiagNeg to obtain the VCV. However, results.hess_inv is not a ndarray but a scipy.optimize.LbfgsInvHessProduct object, which will interpret '' as dot multiplication instead of pointwise multiplication, thus generating irregular VCV result. Instead, we should use: `vcv_mle = results.hess_inv.todense() OffDiagNeg` i.e., transform it to a dense matrix, and then do the pointwise multiplication.

rickecon commented 6 years ago

@FuZhiyu . That is correct. The .todense() method will extract a sparse matrix from the results output. Then do the pointwise transformation.