![]() ![]() The example contains your posted data with Python code for fitting and graphing, with automatic initial parameter estimation using the _evolution genetic algorithm. This example code uses an equation that has two shape parameters, a and b, and an offset term (that does not affect curvature). I converted this using pandas into T by calculating 40 - x). (Somewhat important note to avoid confusion, although it won't change the actual regression, the temperature column in this data set is Tc - T, where Tc is the transition temperature (40C). I can provide code, coefficients of the polynomial, etc, if it's helpful. My question is: How can I fit this data better? What libraries should I use, what kind of function might approximate this data better than a polynomial, etc? This is experimental data, but in theory S should tends towards 0 as temperature increases and reach 1 as temperature decreases. The x axis is temperature (in C) and the y axis is the parameter, which we'll call S. S vs Temperature blue dots are experimental data, black line is the model I have included the scatter plot and the model provided by numpy: ![]() I used numpy.polyfit for a quadratic model, but the fit isn't quite as nice as I'd like it to be and I don't have much experience with regression. I have some data that I want to fit so I can make some estimations for the value of a physical parameter given a certain temperature. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |