s-news
[Top] [All Lists]

[S] NonLinear Least Squares Regression

To: <S-news@wubios.wustl.edu>
Subject: [S] NonLinear Least Squares Regression
From: "Suzanne Szak" <szak@ncbi.nlm.nih.gov>
Date: Thu, 21 Sep 2000 12:49:28 -0400
Importance: Normal
Sender: owner-s-news@wubios.wustl.edu
Hello All,

I would greatly appreciate any help or input on the following:

With the data shown below, I'm trying to find a least squares fit (using the
function nls) using the formula:

CV = sqrt(S^2/U2 + F^2)

using the starting parameters S=0.03 and F=6e-008.

I continue to get the error "singular gradient matrix".  What does this
error indicate?  I've tried changing the starting parameters w/o any luck.
In fact, the S and F values above were determined using Excel.

I'm using S-PLUS 2000 Professional Edition Release 1 for Windows NT

Thank you very much,
Suzanne Szak

> TheData <- data.frame(U2 = U2, CV = CV)
> TheData
             U2          CV
 1 4.0000000000 0.000000000
 2 2.8864990756 0.000000000
 3 2.3191596728 0.000000000
 4 1.9542362678 0.000000000
 5 1.6926790496 0.000000000
 6 1.4929143669 0.000000000
 7 1.2676642904 0.029737533
 8 1.0420303112 0.023409186
 9 0.8500522373 0.035924040
10 0.6968043415 0.022356420
11 0.5468683851 0.036420148
12 0.3930255760 0.056975945
13 0.2775081059 0.054036323
14 0.1848277152 0.063131101
15 0.1092518965 0.089628582
16 0.0516482976 0.120721021
17 0.0160707671 0.236334533
18 0.0005628174 1.193502668
19 0.0068441606 0.373962198
20 0.0337415922 0.165358168
21 0.0813884906 0.101640787
22 0.1482632696 0.073770192
23 0.2388915548 0.058397801
24 0.3485608235 0.049865076
25 0.4760776141 0.042939356
26 0.6271451461 0.036981246
27 0.7976613095 0.033291376
28 0.9891736555 0.029232002
29 1.1997152672 0.026534255
30 1.4271015812 0.024381877
31 1.6760154850 0.022545709
32 1.9465676200 0.020847938
33 2.2373753115 0.019666488
34 2.5540305162 0.018271604
35 2.8792236032 0.016837675
36 3.2322286532 0.016261901
37 3.6116494348 0.015074672
38 4.0177458152 0.014903107
39 4.4384158009 0.014372714
40 4.8649871319 0.012801022
41 5.3464711082 0.012642734
42 5.7808976217 0.011460398
43 6.2377760299 0.011076518
44 6.8182861640 0.011974298
45 7.3452947426 0.010442179
46 7.8763391412 0.009687807
47 8.5078843891 0.011040851
48 9.1285113900 0.009426115
> Starting
    S      F
 0.03 6e-008
> test.fit <- nls(CV ~ sqrt(S^2/U2 + F^2), data = TheData, start = Starting)
Error in nls(CV ~ sqrt(S^2/U2 + F^2), data = TheData, start = Starting):
singular gradient matrix
>

-----------------------------------------------------------------------
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>