Path: news.mathworks.com!not-for-mail
From: "Daniel " <dan.merfeld@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: glm with probit model
Date: Tue, 11 Nov 2008 17:35:10 +0000 (UTC)
Organization: Harvard University
Lines: 27
Message-ID: <gfcfoe$4le$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> <gfcbo7$sfi$1@fred.mathworks.com>
Reply-To: "Daniel " <dan.merfeld@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226424910 4782 172.30.248.35 (11 Nov 2008 17:35:10 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 11 Nov 2008 17:35:10 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 45502
Xref: news.mathworks.com comp.soft-sys.matlab:500263


Peter Perkins <Peter.PerkinsRemoveThis@mathworks.com> wrote in message <gfcbo7$sfi$1@fred.mathworks.com>...
> > mydlink = @(mu) 1 ./ ((1-2*L).*normpdf(norminv((mu-L)./(1-L))));
> 
> I think you want 1-2*L in the denom of the last one.
> 


You are correct.  My mistake.


> > mylink = @(mu,L) norminv((mu-L)./(1-2*L));
> 
> Where did that link function come from?  It isn't the one you cited above, and it has L as an argument.  L should not be an input argument.  Let the anonomous function "captures" L by creating a new mylink at each iteration inside this loop:
> 
> > lambda=0:.01:.06;
> > for j=1:length(lambda)
> >     L = lambda(j);

You are correct.  I tried  using the function above after I had tried: 

mylink = @(mu) norminv((mu-L)./(1-2*L));

Both gave the same error message.

I think that it is working now.  When I am certain, would you like the "final" code.  I simply modified the example code that you had provided earlier with the updated model and model fit, etc.