Iterative Maximization

1 次查看(过去 30 天)
Amin
Amin 2011-12-18
I have a function like P(t) in the form of:
P(t)= 1/ (1+exp(-ai*(t-bi)))
in which "ai" and "bi" are characteristics of item i and p(t) is probability of a correct answer to item i by a person with ability equal to "t". In practice we have a response pattern like "1101" in answering four items in which 1 means correct answer and 0 means incorrect answer. Then for finding person's ability who possesses such response pattern we use likelihood function in the form of:
L(t)= Ʃ (x*log(p(t)) * ((1-x)*log(1-p(t))) i=1,2,3,4,...
In which "x" is 1 or 0 with respect to the given response pattern. for the above example, likelihood function is:
L(t)= log (P1(t)) + log(P2(t)) +log(1-P3(t)) + log (P4(t))
(i.e. P1(t) stands for probability of item 1 and so on) The value of "t" which maximizes this equation is the person's ability who answered those four items. In practice the number items and persons are different. I want to know how I can write a program to do this procedure in MATALB. Suppose that I have four items (a 4 by 2 matrix so that the first column is "a" for each item and the second column is "b") and 61 different response patterns (a 61 by 4 matrix of 1 and 0).So, I should compute likelihood function for each response pattern then maximize it to find corresponding "t". This process should be done for each person.
I really appreciate any help.
Amin.
  1 个评论
Walter Roberson
Walter Roberson 2011-12-18
61 different response patterns, or 16 ? There are only 16 different 4-bit values.

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2011-12-18
A start would be
R = dec2bin(0:15,4) - '0' + 1;
syms t
P = 1 ./ (1+exp(-ab(:,1)*(t-ab(:,2))));
Plog = log([P, 1-P]);
L = sum(Plog[R],2);
%and one would want to optimize each L separately
Unfortunately at the moment I cannot find a non-linear numeric maximizer in the Symbolic Toolkit.
You could use matlabFunction() on the negative each element of L and use one of the MATLAB minimizers on that.

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by