[R] Using NLS with a Kappa function

dave fournier davef at otter-rsch.com
Wed Oct 13 06:35:24 CEST 2010


Actually it just the parameterization that is causing trouble near k=0


let u = (x-z)/a

then the problematic part of your function is

       (1- k*u)^(1/k)

take the log to get

    log(1-k*u)/k

= -(k*u +k^2*u^2/2 + ...)/k

= -(u +k u^2/2 + ..)

so your function is  exp(-u - ku^2/2 - ...)

and use that for k<eps for some small eps. You can add the right number of terms and fix the size of eps
so that the function behaves well.



More information about the R-help mailing list