Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: mle for custom function
Replies: 1   Last Post: Jan 16, 2014 9:47 AM

 Search Thread: Advanced Search

 Messages: [ Previous | Next ]
 Heejin Posts: 2 Registered: 1/16/14
mle for custom function
Posted: Jan 16, 2014 12:13 AM
 Plain Text Reply

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*x-b*x^2));

%Custom Function (negative loglikelihood)
custom = @ (x, n,t ,a,b,kl) -(t*log(TCP(x,a,b,k)+(n-t)*log(1-TCP(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 user-supplied nloglf
function
'@(dose,x,n,a,b)-(sum(x.*p(dose,a,b)+(n-x).*log(1-p(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)+(n-x).*log(1-p(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...

Date Subject Author
1/16/14 Heejin
1/16/14 Casper

© The Math Forum at NCTM 1994-2018. All Rights Reserved.