Path: news.mathworks.com!not-for-mail
From: "Tom Lane" <tlane@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: glm with probit model
Date: Tue, 11 Nov 2008 11:23:29 -0500
Organization: The MathWorks, Inc
Lines: 18
Message-ID: <gfcbi1$8k$1@fred.mathworks.com>
References: <geapba$62l$1@fred.mathworks.com> <gecis6$hje$1@fred.mathworks.com> <gf6c79$87j$1@fred.mathworks.com> <gf9k8o$e3s$1@fred.mathworks.com> <gf9oam$jvi$1@fred.mathworks.com> <gface8$ka3$1@fred.mathworks.com> <gfc0ct$cnl$1@fred.mathworks.com>
Reply-To: "Tom Lane" <tlane@mathworks.com>
NNTP-Posting-Host: lanet.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1226420609 276 172.31.57.151 (11 Nov 2008 16:23:29 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 11 Nov 2008 16:23:29 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:500248


> myilink = @(eta) L + (1-2*L).*normcdf(min(max(eta,lowerBnd),upperBnd));
> mylink = @(mu) norminv((mu-L)./(1-2*L));
> mydlink = @(mu) 1 ./ ((1-2*L).*normpdf(norminv((mu-L)./(1-L))));
...
> I get the following error message:
>
> ??? Input argument "L" is undefined.

Dan, you should set L before you define the functions above.  Its value is 
then incorporated into the function definitions.

It sounds like you're setting L in a loop.  Then re-define these functions 
each time through the loop, so they pick up the new value of L.  I don't 
think there will be a lot of overhead in doing that.

-- Tom