prof brian ripley ripleystatsoxacuk example works rpatched consequence investigations different problem see comments posting guide updating r trying latest versions windows binaries rpatched available cran tue 5 aug 2008 keith jewell wrote hi ive hit problem using nls think may restriction applicability nls may found fix ive wrong example simplified essentials real application much complicated take function matrix x additional arguments matrix amat whose values _not_ determined nls vector coeffs whose vales _are_ determined simplicity isnt selfstart function initial attribute doesnt change things myfuncfunctionx amat coeffs result quadratic response x terms selected amat amatamat0 coeffs rowsumsxamattx amat passed name eg amat bmat nls fails eg data frame noise df dataframex1 runif20 1 20 x2runif20 1 20 dfy 1 dfx1 dfx2 dfx1dfx2 dfx12 dfx22 rnorm20 matrix pass amat bmat matrixc1100 2 2 nls fails nlsy myfunccbindx1 x2 bmat avec df startlistavecc12 pass matrix name works nlsy myfunccbindx1 x2 matrixc1100 2 2 avec df startlistavecc12 think problem lies line nls var varnamesvarindex mfvar evalasnamevar data env adds values named arguments bmat columns data frame problem generally dont number rows ive made work example replacing line line adds values arguments data frame parameters rather column attributesmfparameters cattributesmfparameterslapplyvarnamesvarindex functionvar evalasnamevar data env problem really dont know nls internals enough sure havent broken something anyway really improvement ought share dont know could totally wrong end stick comments corrections advice welcome thanks advance keith jewell sessioninfo r version 270 20080422 i386pcmingw32 locale lc_collateenglish_united kingdom1252lc_ctypeenglish_united kingdom1252lc_monetaryenglish_united kingdom1252lc_numericclc_timeenglish_united kingdom1252 attached base packages 1 stats graphics grdevices datasets tcltk utils methods base attached packages 1 xlsreadwrite_132 svsocket_095 svio_095 r2html_158 5 svmisc_095 svide_095 loaded via namespace attached 1 tools_270 vgam_077 ______________________________________________ rhelprprojectorg mailing list httpsstatethzchmailmanlistinforhelp please read posting guide httpwwwrprojectorgpostingguidehtml provide commented minimal selfcontained reproducible code brian ripley ripleystatsoxacuk professor applied statistics httpwwwstatsoxacukripley university oxford tel 44 1865 272861 self 1 south parks road 44 1865 272866 pa oxford ox1 3tg uk fax 44 1865 272595 ______________________________________________ rhelprprojectorg mailing list httpsstatethzchmailmanlistinforhelp please read posting guide httpwwwrprojectorgpostingguidehtml provide commented minimal selfcontained reproducible code thu 07 aug 2008 065545 0100 r fix nls bug