[SciPy-User] ODR fitting several equations to the same parameters

josef.pktd@gmai... josef.pktd@gmai...
Fri Nov 13 11:18:35 CST 2009


On Fri, Nov 13, 2009 at 11:44 AM, ms <devicerandom@gmail.com> wrote:
> josef.pktd@gmail.com ha scritto:
>> On Fri, Nov 13, 2009 at 10:28 AM, ms <devicerandom@gmail.com> wrote:
>>> josef.pktd@gmail.com ha scritto:
>>>> On Thu, Nov 12, 2009 at 10:04 AM, ms <devicerandom@gmail.com> wrote:
>>>>> josef.pktd@gmail.com ha scritto:
>>>> an example
>>>> (quickly written and not optimized, there are parts I don't remember
>>>> about curve_fit, fixed parameters could be better handled by a class)
>>> Hmm, it seems I don't have curve_fit -I am constrained to use
>>> scipy-0.6.0 and there's no chance to change that (it's an external server).
>>
>> You can just copy the function (plus 2 helper functions) from the
>> current trunk. You would need to add the imports. Alternatively you
>> can just use optimize.leastsq directly, using curve_fit as a recipe.
>
> A further question: It seems to me it works only if the data sets have
> the same size, because what gets minimized is then the matrix. What
> about datasets with different sizes?

In the example, I just did the stacking based on the 2d array to have
it quickly written, for unequal sized data groups it is easier to work
directly with the stacked array, and just index into it, or for
example create a `b` array that has the values repeated corresponding
to the group sizes. (Same story as with balanced versus unbalance
panels.)

Do you have a non-linear ODR example? I didn't even know ODR can do
non-linear parameter estimation.

Josef



>
> thanks,
> m.
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>


More information about the SciPy-User mailing list