[S] : nls() convergence criteria

sinclair, andrew (asinclair@edfman.co.uk)
Thu, 23 Jul 1998 13:17:00 +0100

Dear S-newsers,

I am having trouble with obtaining convergence
of the nls() routine .

The routine appears to reach a solution
(or rather it looks good enough for me....)
but its converence criteria does not register
this fact. The output is included at the end
of this mail.

My question is twofold :-

(1) how can I get the nls() routine to stop without
falling over ( e.g. instead of producing error
message it just finishes, so that _I_ can decide if
convergence is reached. I need to do this for
100 data sets, so manual options are not on. ) ?

(2) what is the current convergence criterion
( I can find no mention of details in any of the

Thank you for any advice or suggestions,

Andrew

[ example output :

### note : expn1 includes 1st & 2nd derivative terms as calculated using
### deriv3() supplied by V&R and written by David Smith.

> sl.nls _ nls(yy ~ expn1(xx,alpha, cpar, x0, y0),
+ start = list(alpha=-sqrt(0.1), cpar=sqrt(0.01), x0=mean(xx),
y0=mean(yy)),
+ trace=T,
+ control = nls.control(maxiter=200, tolerance=0.01,
minscale=1E-14, trace = T))
16258 : -0.316228 0.1 2 2.08082
7543.9 : -0.465762 -0.592826 2.04237 -2.13647
4563.37 : -0.689797 0.543933 2.09086 -3.1023
3980.77 : -0.866492 -0.418423 2.07144 -3.37473
3870.93 : -1.08559 0.696814 2.07667 -3.49325
3791.56 : -1.16188 0.240659 1.95948 -3.73819
3610.03 : -1.21356 -0.0467162 2.04643 -3.68372
3421.76 : -1.26754 0.482932 2.13735 -3.31468
3375.02 : -1.3486 0.119107 2.03038 -3.44843
3269.44 : -1.37603 -0.109291 2.10072 -3.33179
3156.85 : -1.43304 0.331312 2.16758 -3.09574
3128.6 : -1.50664 0.0494818 2.08601 -3.16114
3085.54 : -1.51225 -0.216894 2.13119 -3.03948
3078.95 : -1.60059 0.180002 2.09263 -3.06349
3070.77 : -1.66805 -0.197304 2.10825 -3.06457
3049.94 : -1.71478 0.0238409 2.09755 -3.07874
3039 : -1.7019 -0.17634 2.11814 -3.01717
3019.81 : -1.74101 0.0284455 2.10956 -3.02177
3009.32 : -1.70848 -0.306462 2.14947 -2.90434
2999.13 : -1.76819 -0.115259 2.08244 -2.95729
2980.84 : -1.7745 0.0454441 2.11329 -2.93729
2964.15 : -1.73958 -0.23081 2.1605 -2.83903
2959.79 : -1.81739 0.0461382 2.086 -2.88881
2952.43 : -1.77674 -0.259706 2.154 -2.80385
2944.34 : -1.82865 -0.0919585 2.10081 -2.84391
2931.08 : -1.82277 0.0576244 2.12876 -2.81964
2919.21 : -1.78416 -0.203096 2.17157 -2.74132
2915.86 : -1.85106 0.0482059 2.10471 -2.77946
2911.56 : -1.80431 -0.24183 2.16248 -2.70578
2905.18 : -1.85285 -0.0838135 2.112 -2.74227
2895.51 : -1.84225 0.0618283 2.13695 -2.72021
2888.72 : -1.80281 -0.197063 2.17534 -2.6561
2887.37 : -1.86821 0.0508565 2.10792 -2.69628
2886.32 : -1.81929 -0.235512 2.16534 -2.63423
2881.1 : -1.86701 -0.0799875 2.11526 -2.67094
2873.66 : -1.8538 0.064414 2.13978 -2.65165
2870.26 : -1.81449 -0.195989 2.17618 -2.59779
2865.01 : -1.84758 -0.0711956 2.14168 -2.61971
2858.02 : -1.83149 0.0607994 2.15794 -2.59716
2853.96 : -1.79027 -0.180111 2.18628 -2.54314
2852.35 : -1.84366 0.0412888 2.12758 -2.57675
2847.93 : -1.81739 -0.0946209 2.14963 -2.54761
2842.53 : -1.81516 0.0476561 2.15625 -2.53833
2839.44 : -1.76523 -0.183133 2.19009 -2.48202
2838.22 : -1.81855 0.0353874 2.13051 -2.51926
2835.17 : -1.79266 -0.100996 2.15109 -2.49125
2830.78 : -1.79479 0.0431008 2.15513 -2.4877
2828.99 : -1.74509 -0.184479 2.19012 -2.43438
2828 : -1.79739 0.0307825 2.13242 -2.47412
2826 : -1.77198 -0.107212 2.15199 -2.44704
2822.33 : -1.77797 0.0391761 2.1537 -2.44853
2821.6 : -1.72868 -0.187366 2.18955 -2.39742
2820.86 : -1.78114 0.0273543 2.13245 -2.44024
2819.8 : -1.75646 -0.114568 2.15133 -2.41408
2816.7 : -1.76654 0.0359732 2.1508 -2.42077
2813.59 : -1.74222 -0.0789158 2.16908 -2.39609
2809.84 : -1.73553 0.040491 2.17555 -2.38627
2807.24 : -1.68839 -0.151458 2.2082 -2.33851
2804.88 : -1.71989 0.0151437 2.1696 -2.36051
2799.71 : -1.648 -0.140906 2.22471 -2.29806
2797.03 : -1.67385 0.00742679 2.18946 -2.3142
2787.3 : -1.59295 -0.0486528 2.2622 -2.2503
2783.02 : -1.52631 0.181305 2.30375 -2.17055
2781.01 : -1.56782 0.0281043 2.23296 -2.20068
2776.69 : -1.52897 -0.0736073 2.26953 -2.15937
2774.86 : -1.52451 0.0724482 2.26559 -2.14384
2773.27 : -1.51977 -0.072287 2.26382 -2.12975
2771.9 : -1.51547 0.0720308 2.26276 -2.11736
2770.7 : -1.51146 -0.0715461 2.26234 -2.10633
2769.62 : -1.50748 0.070738 2.26264 -2.0963
2768.61 : -1.50323 -0.0694691 2.26387 -2.08686
2767.6 : -1.49834 0.0675302 2.26632 -2.07757
2766.53 : -1.49226 -0.0645999 2.2705 -2.06788
2765.34 : -1.48426 0.0601741 2.2772 -2.0571
2763.92 : -1.47327 -0.0534417 2.28772 -2.04433
2763.82 : -1.44214 0.139483 2.32046 -2.01254
2762.67 : -1.4668 0.0310363 2.27915 -2.03182
2760.57 : -1.44138 -0.0360909 2.30915 -2.0083
2757.68 : -1.39269 0.0691444 2.3686 -1.96558
2757.01 : -1.39559 -0.033526 2.3589 -1.96347
2753.75 : -1.33813 -0.00588944 2.43935 -1.92295
2753.46 : -1.25189 0.0894833 2.61502 -1.90967
2752.61 : -1.28151 0.0193156 2.55086 -1.91483
2752.5 : -1.28505 -0.00337204 2.54284 -1.91416
2752.49 : -1.28532 0.00250843 2.54201 -1.91391
2752.49 : -1.2856 -0.00567189 2.54117 -1.91366
2752.47 : -1.28625 0.00405632 2.5394 -1.91325
2752.46 : -1.28659 -0.00291471 2.53849 -1.91305
2752.45 : -1.28677 0.00201428 2.53802 -1.91295
2752.45 : -1.28685 -0.00157416 2.53779 -1.9129
2752.45 : -1.2869 0.000738639 2.53767 -1.91287
2752.45 : -1.28691 -0.000489531 2.53764 -1.91286
2752.45 : -1.28692 0.000437298 2.53763 -1.91286
2752.45 : -1.28692 -0.000601052 2.53761 -1.91286
2752.45 : -1.28693 0.000913081 2.53758 -1.91285
2752.45 : -1.28696 -0.0010904 2.53752 -1.91284
2752.45 : -1.28698 0.000598064 2.53747 -1.91283
2752.45 : -1.28699 -0.000940005 2.53744 -1.91282
2752.45 : -1.28701 0.00102748 2.53738 -1.91281
2752.45 : -1.28703 -0.000781928 2.53732 -1.9128
2752.45 : -1.28705 0.000408759 2.53729 -1.91279
2752.45 : -1.28705 -0.000160372 2.53728 -1.91279
2752.45 : -1.28705 0.000202169 2.53728 -1.91279
2752.45 : -1.28705 -8.54832e-05 2.53728 -1.91279
2752.45 : -1.28705 8.45812e-05 2.53728 -1.91279
2752.45 : -1.28705 -8.73025e-05 2.53728 -1.91279
2752.45 : -1.28705 7.92293e-05 2.53728 -1.91279
2752.45 : -1.28705 -0.000104276 2.53728 -1.91279
2752.45 : -1.28705 3.51604e-05 2.53727 -1.91279
2752.45 : -1.28705 -1.65295e-05 2.53727 -1.91279
2752.45 : -1.28705 1.09582e-05 2.53727 -1.91279
2752.45 : -1.28705 -9.77324e-06 2.53727 -1.91279
2752.45 : -1.28705 1.34719e-05 2.53727 -1.91279
2752.45 : -1.28705 -2.02547e-05 2.53727 -1.91279
2752.45 : -1.28705 2.461e-05 2.53727 -1.91279
2752.45 : -1.28705 -1.2315e-05 2.53727 -1.91279
2752.45 : -1.28705 6.13244e-06 2.53727 -1.91279
2752.45 : -1.28705 -3.12902e-06 2.53727 -1.91279
2752.45 : -1.28705 1.40877e-06 2.53727 -1.91279
2752.45 : -1.28705 -1.11094e-06 2.53727 -1.91279
2752.45 : -1.28705 4.86677e-07 2.53727 -1.91279
2752.45 : -1.28705 -4.25042e-07 2.53727 -1.91279
2752.45 : -1.28705 6.18886e-07 2.53727 -1.91279
2752.45 : -1.28705 -8.15025e-07 2.53727 -1.91279
2752.45 : -1.28705 2.73809e-07 2.53727 -1.91279
2752.45 : -1.28705 -1.31321e-07 2.53727 -1.91279
2752.45 : -1.28705 7.98578e-08 2.53727 -1.91279
2752.45 : -1.28705 -9.37763e-08 2.53727 -1.91279
2752.45 : -1.28705 5.40867e-08 2.53727 -1.91279
2752.45 : -1.28705 -1.00051e-08 2.53727 -1.91279
2752.45 : -1.28705 3.33042e-08 2.53727 -1.91279
Error in nls(yy ~ expn1(xx, alpha, cpar, ..: step factor reduced below
minimum
Dumped
>

]

____________________

Andrew Sinclair
ED & F Man Investment Products
Sugar Quay
Lower Thames Street
London EC3R 6DU

tel : 0171 285 2089
fax : 0171 285 2001
email : asinclair@edfman.co.uk
-----------------------------------------------------------------------
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