Heejin
Posts:
2
Registered:
1/16/14


mle for custom function
Posted:
Jan 16, 2014 12:13 AM


Hi, I just started using Matlab for medical physics research and now have problem using mle function to fit a custom function to TCP model fitting.
My custom function is a TCP model of Poisson hypothesis.
exp = 2.71828182845904523536; %TCP TCP = @(x, a, b,k) exp(k*exp(a*xb*x^2)); %Custom Function (negative loglikelihood) custom = @ (x, n,t ,a,b,kl) (t*log(TCP(x,a,b,k)+(nt)*log(1TCP(x,a,b,k))
n = patients number of each group x = dose t = survival patients number of each group k,a,b are parameter of estimated by mle.
Using this custom function to fit my data (5x1 matrix), I used a syntax of;
[paramEsts,paramCIs] = mle(data,'nloglf',custom,'start',[0.01,0.001,10]);
However, it gives me the following error.
>>Error using mlecustom (line 150) Error evaluating the usersupplied nloglf function '@(dose,x,n,a,b)(sum(x.*p(dose,a,b)+(nx).*log(1p(dose,a,b))))'.
Error in mle (line 228) [phat, pci] = mlecustom(data,varargin{:});
Caused by: Error using @(dose,x,n,a,b)(sum(x.*p(dose,a,b)+(nx).*log(1p(dose,a,b)))) Not enough input arguments.
At this point, I have no clue to solve this... Could anybody please help me? Thank you so much...

