s-news
[Top] [All Lists]

Re: [S] confint / Error in profile.nls

To: "Wright, Kevin" <WRIGHTKEVI@phibred.com>
Subject: Re: [S] confint / Error in profile.nls
From: Bill Venables <William.Venables@cmis.CSIRO.AU>
Date: Wed, 26 Jan 2000 09:29:56 +1000
Cc: s-news@wubios.wustl.edu
In-reply-to: Your message of "Tue, 25 Jan 2000 16:43:27 CST." <C71CB7425639D311A7A40008C7286AB015B899@carina.phibred.com>
Sender: owner-s-news@wubios.wustl.edu
Kevin Wright asks:

> I'm using the MASS library function confint to extract confidence intervals
> from an nls object.  In some circumstances (model fit?, shape of
> likelihood?) the function confint(nls.fit) returns the following error
> message:
> 
> Error in profile.nls: Missing value where logical needed: if(abs(.pars[par]
> - base)/std.err[par] > 10 * cutoff) break
> 
> There's nothing about this in the s-news archive or V&R2 (that I can see).

profile.nls is not part of the MASS library, of course, it is
part of S-PLUS.  profile.glm is part of the MASS library and it
has a trace= argument that allows the profiling to be tracked as
it proceeds.  (This is going to be more difficult with
profile.nls as the profiling itself is done in C-code, but I
think it would be a useful thing to do.)

> Does anybody know
> 1. What this message really means

When it has happened to me, it has meant that the non-linear
regression has such high parameter effects curvature that the
simple assumptions underlying the profiling algorithm are
violated and the calculation blows up.  This is a fact of life
with non-linear models: all sorts of things can go wrong and do,
regularly, and if you tried to protect the software against it
completely you would slow things down enormously.

> 2. What (if anything) can be done about it or

I have found it useful to explore the profiles themselves, first,
in a more cautionary way, for example by setting alphamax as 0.1
or even 0.25, looking at the profiles and just checking how they
look.  You may find you have effectively a one-sided confidence
interval, for example.  confint() is really just a convenient
front-end to profile().

> 3. Is there an alternative method?  I tried using 
> sqrt(diag(vcov(nls.fit))), but this produced unsatisfactory results

The quantities sqrt(diag(vcov(nls.fit))) are the estimated large
sample standard errors so the "Wald's test" confidence interval
would use twice these quantities on either side of the estimates.

If you think the results are "unsatisfactory" it suggests to me
that you are dealing with an asymmetric likelihood profile near
the maximum and you expect an asymmetric confidence interval
would be appropriate.  In turn this suggests you are dealing with
high parameter effects curvature and the potential for numerical
trouble is there.  (It would be easier if we didn't have to guess
all this, though...)

Bill Venables.

-- 
-----------------------------------------------------------------
Bill Venables, Statistician, CMIS Environmetrics Project.

Physical address:                            Postal address:
CSIRO Marine Laboratories,                   PO Box 120,       
233 Middle St, Cleveland, Qld, 4163          Cleveland, Qld, 4163
AUSTRALIA                                    AUSTRALIA

Tel: +61 7 3826 7251           Email: Bill.Venables@cmis.csiro.au     
Fax: +61 7 3826 7304      http://www.cmis.csiro.au/bill.venables/
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>