[R] Fitting parabolic function to data

Henri Mone henriMone at gmail.com
Thu Oct 6 18:14:53 CEST 2011


Hi Duncan,

Thanks for your reply. You saved my Day :)

Thanks,
Henri



On Thu, Oct 6, 2011 at 12:07 PM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
> On 11-10-06 4:59 AM, Henri Mone wrote:
>>
>> Dear R users and experts,
>>
>> I want to fit a shifted parabolic function with the following
>> functional form to my data:
>>
>> f(x)=a0*(x+a1)^2+a2
>>
>> (a0, a1 and a2 are scaling factors.)
>> What is standard approach to do this in R? I tried the "lm" function
>> in R but I got problems getting the above functional form.
>>
>> Any help is welcome :) .
>
> That can be expanded into a regular quadratic:
>
> (a0*a1^2 + a2) + 2*a0*a1*x + a0*x^2
>
> So fit a regular quadratic, and then solve for a0, a1, a2 from the resulting
> coefficients.  The only tricky bit will be computing errors on the a's.
>
> Duncan Murdoch
>



More information about the R-help mailing list