Hello all,
I am writing a -gmm- moment-evaluator program. I want to supply Stata with the analytical derivatives through the -hasderivatives- option. Letting xi denote the transposed row vector of variables for observation i and Ci some individual-specific scalar, the derivatives I want are just the elements of some K×L matrix ΣiCixixi', where element (k,l) corresponds to the k-th moment function and the derivative w.r.t. the l-th parameter. To the best of my knowledge, to specify the derivatives for Stata, I just need to put the elements of Cixixi' (in the correct order) in the macro `derivatives'.
My problem: I am unsure of the best way to get the matrix xixi'. Do I have to just directly use the names of the variables or is there some easier way?
I am writing a -gmm- moment-evaluator program. I want to supply Stata with the analytical derivatives through the -hasderivatives- option. Letting xi denote the transposed row vector of variables for observation i and Ci some individual-specific scalar, the derivatives I want are just the elements of some K×L matrix ΣiCixixi', where element (k,l) corresponds to the k-th moment function and the derivative w.r.t. the l-th parameter. To the best of my knowledge, to specify the derivatives for Stata, I just need to put the elements of Cixixi' (in the correct order) in the macro `derivatives'.
My problem: I am unsure of the best way to get the matrix xixi'. Do I have to just directly use the names of the variables or is there some easier way?