[R] How to do global curve fitting in R

Bert Gunter bgunter.4567 at gmail.com
Wed Sep 9 19:25:27 CEST 2015


Well..

1) To add to Duncan's comments, if you create a new "dataset" discrete
factor column to indicate the dataset in the combined data, then you
would fit the model dataset/(corrected denominator).

2) However, there **is** a statistical issue here, for if you have
more than a "few" data sets, say more than 10 or a dozen or so, it
probably makes more sense to fit a mixed effects model where the
dataset factor is random. If so, my prior advice holds.

Cheers,
Bert


Bert Gunter

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
   -- Clifford Stoll


On Wed, Sep 9, 2015 at 9:37 AM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
> On 09/09/2015 12:28 PM, Jianling Fan wrote:
>> Hi, Bert
>>
>> Thanks for your reply.
>>
>> I am fitting a logistic does response model with 3 parameters as :
>> y=a/(1+(x/x0)b), I have many sets of data. I can fit each of them for
>> the model. but I want them shared the parameter x0 and b, but varied
>> for each a.
>
> You might have a typo:  x0 and b aren't separately identifiable in that
> model, only the ratio matters.
>
>>
>> I don't think it is a  statistics problem. It is a typical global
>> curve fitting problem with shared parameters. And I know how to do it
>> by many other software. But since I am trying to use R, I am wondering
>> is there any package or method to do it in R?
>
> The nls() function should do what you want.  Your model is partially
> linear ("a" enters linearly), so the "plinear" algorithm should work.
> There's also an example of a "self-starting" logistic regression model
> in ?selfStart.
>
> Duncan Murdoch
>
>
>>
>> Thanks!
>>
>> Jianling
>>
>>
>> On 9 September 2015 at 10:16, Bert Gunter <bgunter.4567 at gmail.com> wrote:
>>> Jianling:
>>>
>>> 1. What models are you trying to fit? Details matter, and it is
>>> impossible to give a good answer without specifics.
>>>
>>> 2. In general terms, to do this one combines all the data and allows
>>> for "appropriate" changes in the model parameters for the different
>>> groups. For example, different intercepts, rate constants, etc. This
>>> is where the specifics matter.
>>>
>>> 3. This is really more a statistics than an R question, and you would
>>> probably do better to pursue these issues either with a local
>>> statistical resource or on a statistics site, like
>>> stats.stackexchange.com.
>>>
>>> Cheers,
>>> Bert
>>> Bert Gunter
>>>
>>> "Data is not information. Information is not knowledge. And knowledge
>>> is certainly not wisdom."
>>>    -- Clifford Stoll
>>>
>>>
>>> On Wed, Sep 9, 2015 at 9:04 AM, Jianling Fan <fanjianling at gmail.com> wrote:
>>>> Hello all,
>>>>
>>>> I am trying to fit my data to a nls model. I have many sets of data
>>>> and each can fit well for the curve. but I want to fit them at once by
>>>> sharing 2 of 3 parameters of the model. I know it is a typical global
>>>> curve fitting problem, but I don't know how to do it by R?
>>>>
>>>> Does anyone know any package for this??
>>>>
>>>> Thanks a lot!
>>>>
>>>>
>>>> Julian
>>>>
>>>> ______________________________________________
>>>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>>
>



More information about the R-help mailing list