Iterative Maximization

조회 수: 4 (최근 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에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by