Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Heejin

Posts: 2
Registered: 1/16/14
mle for custom function
Posted: Jan 16, 2014 12:13 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic 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...



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.