6.7.10.1.6. statsmodels.sandbox.regression.tools.normgrad

statsmodels.sandbox.regression.tools.normgrad(y, x, params)[source]

Jacobian of normal loglikelihood wrt mean mu and variance sigma2

Parameters:

y : array, 1d

normally distributed random variable with mean x*beta, and variance sigma2

x : array, 2d

explanatory variables, observation in rows, variables in columns

params: array_like, (nvars + 1)

array of coefficients and variance (beta, sigma2)

Returns:

grad : array (nobs, 2)

derivative of loglikelihood for each observation wrt mean in first column, and wrt scale (sigma) in second column

assume params = (beta, sigma2)

Notes

TODO: for heteroscedasticity need sigma to be a 1d array