I’m seeking help with setting up a maximum likelihood estimation with -ml- in a situation that (to me) seems unusual but in principle workable. What’s unusual is 1) there is a large number of parameters (one per subject); 2) the likelihood depends on observations made on *pairs* of subjects; 3) no regression model is involved.
Detail:
Here’s the situation, which happens to involve estimating parameters relating to a nonstandard model for agreement among N subjects who each respond to K categorical questionnaire items. The relevant data set involves the N(N-1)/2 distinct pairs of subjects, for which a variable M is observed, where Mij,, is the number of times subject i and subject j have matching answers across the set of K questions.
Under the formal response model of interest, an unknown parameter, say bi, characterizes each of the i = 1, ..., N subjects, and it's that vector of parameters that is to be estimated. It's straightforward to write an expression for the contribution to the likelihood LL(Mij ) for each pair of subjects, and the overall log-likelihood is the sum of these. The LL(Mij ) expression is just a polynomial in the parameters bi and bj and some constants
To my understanding, this meets the linear form restriction of -ml-, so I'd like to think this should be easy in -ml-
My problem:
Being a neophyte user of -ml-, I’m trying to find some kind of relevant example to follow in the Stata -ml- book or documentation, but I’m not getting there. . I don’t for example, know how to communicate to -ml- that there is a list of N parameters which are not part of anything like Y = XB, but rather b1 = ?, b2 = ? ... bN = ? Can someone point me in the direction of an example for something like this? Or, perhaps this is something easy to sketch out for an experienced -ml- user?
I have implemented this estimation problem with Mata’s -optimize()-, but that’s messy in numerous ways, and I suspect slower than using -ml-. (This is a very compute-intensive problem, so speed is of the essence.)
Detail:
Here’s the situation, which happens to involve estimating parameters relating to a nonstandard model for agreement among N subjects who each respond to K categorical questionnaire items. The relevant data set involves the N(N-1)/2 distinct pairs of subjects, for which a variable M is observed, where Mij,, is the number of times subject i and subject j have matching answers across the set of K questions.
Code:
idi idj M 1 2 M12 1 3 M13 ... 1 N M1N 2 3 M23 ... (N-1) N M(N-1)N
To my understanding, this meets the linear form restriction of -ml-, so I'd like to think this should be easy in -ml-
My problem:
Being a neophyte user of -ml-, I’m trying to find some kind of relevant example to follow in the Stata -ml- book or documentation, but I’m not getting there. . I don’t for example, know how to communicate to -ml- that there is a list of N parameters which are not part of anything like Y = XB, but rather b1 = ?, b2 = ? ... bN = ? Can someone point me in the direction of an example for something like this? Or, perhaps this is something easy to sketch out for an experienced -ml- user?
I have implemented this estimation problem with Mata’s -optimize()-, but that’s messy in numerous ways, and I suspect slower than using -ml-. (This is a very compute-intensive problem, so speed is of the essence.)