3,582 questions
-4
votes
1
answer
76
views
How to compute an optimal enclosing segment of a circle from a 2D point set?
I am looking for some advice on how to fit a circular segment to a set of 2D points. My dataset looks like this: 2d data to fit segment to
For clarity, my definition of an "optimal" segment ...
0
votes
1
answer
49
views
Logistic regression, print several curves on the same graph
I'm working on a project, and I need to do a graph where there is two curves of logistic regression. I'd like to display the curve of the disease status (encoded by 0 and 1), along with the Age (...
7
votes
2
answers
179
views
When using scipy.optimize.curve_fit what is the optimal formulation of the function being fitted?
I noticed that the formulation matters when trying to fit a non-linear equation of the form y = a + b * x ** c and I wonder which formulation in general results in the best fit?
Formulation 1
y = a + ...
1
vote
2
answers
106
views
Fitting sigmoid functions
I have some data I am trying to fit to a sigmoid function (several parameters for several species), however apparently some of them don't look fitted in a good way, I don't understand where the ...
3
votes
1
answer
161
views
scipy curve_fit fails on specified function
I am trying to find the optimal projection parameters when transforming spherical coordinates into Cartesian ones for a given projection. The mathematical description of the projection is presented in ...
0
votes
1
answer
56
views
Smooth curve through points with prepar1d
I am trying to get a smooth curve through the data points, but the curve is not smooth and it just connects the scatter points with a straight line or it shows weird bumps in the area between the ...
0
votes
1
answer
69
views
add geom_label and geom_density to barplot distribution
I'm working on a plot showing the length distribution of some events in the human genome. I'm pretty OK with the end result but wish to add a geom_label for the highest count reporting the ...
2
votes
1
answer
119
views
Gauss Fitting data with scipy and getting strange answers on Fit Quality
I have Gamma-Spectra and I am doing Gauss fit to the peaks using Python with scipy. Works well, but trying to get a number on fit quality (for the intent on some automation) returns very odd numbers.
...
0
votes
2
answers
119
views
Function with two variables - Polynomial fit Python
I have various pump performance data, and I am trying to fit curves as a combination of them.
In below image, different curves are at different pump speeds (RPM), and the Y axis is Pressure head, and ...
4
votes
2
answers
206
views
Curve-fitting a non linear equation
I'm trying to fit my thermal conductivity into the Debye-Callaway equation. However, one of my parameters is coming back negative. I've tried different initial guesses. So I'm attaching a code with ...
3
votes
2
answers
107
views
Estimating non-monotonic bi-exponential curve fit
I am doing some pharmacokinetic analyses and am fine with non-compartmental methods. But I trying to also learn some non-linear curve-fitting techniques.
If we have the following data:
df <- data....
0
votes
1
answer
132
views
Differential evolution fails when worker argument is added
To set up my differential_evolve curve-fit function, I borrowed heavily from https://bitbucket.org/zunzuncode/ramanspectroscopyfit/src/master/RamanSpectroscopyFit.py. My implemented function works ...
1
vote
1
answer
80
views
good r2 score but huge parameter uncertainty
I'm using a quadratic function to fit my data. I have good R2 score but huge uncertainty in my fitting parameters
Here is the graph and the results:
R2 score: 0.9698143924536671
uncertainty in a, b, ...
0
votes
1
answer
200
views
What does sigma mean in scipy.optimize.curve_fit?
Assume that I have a very simple model that measures some quantity by repetitive sampling. As I understood from statistics, there's the error of mean which can be computed as
$u = \frac{\hat\sigma}{\...
0
votes
1
answer
96
views
Why does curve fit sometimes work and not work in an interactive Python simulation?
I'm relatively new to Python GUI and have been working on a simple project relating to my physics classes.
I've been trying to simulate the Rutherford Scattering experimental data using Monte Carlo ...
3
votes
3
answers
206
views
Scipy Curve_fit: how would I go about improving this fit?
I've been working on a standard potential which I am trying to fit with a given model:
ax2 - bx3 + lx4
The x and y values for the fit are generated from the code as well, the x values are generated by ...
0
votes
1
answer
68
views
Need a smooth curve from lmfit at more datapoints
I am fitting a Lorenztian to the following data. If I plot the best fit, it only plots the results at particular values of x where I had data. I tried to get a smooth curve that is a better ...
0
votes
0
answers
68
views
Matlab Warning: Equation is badly conditioned. Remove repeated data points or try centering and scaling
I have a data set, FR. I am trying to plot the confidence levels for the same but I am encountering a warning message :"Warning: Equation is badly conditioned. Remove repeated data points or try ...
3
votes
1
answer
59
views
Matlab fittype of a logged power law, with a y-intercept
In Matlab, I am doing a curve fitting of a set of points, which follow a power law. If I use the 'log(a*x^n)' power law as the main argument of the fittype function, everything works well:
% input
x = ...
0
votes
0
answers
130
views
Interrupt expensive SciPy calculations
Is there a way to programmatically interrupt expensive operations like curve_fit from SciPy? In the application I’m developing for a client, I need to perform expensive calculations with maxfev set (...
1
vote
2
answers
164
views
Proper Curve fitting for Intensity Plots
I am doing image analysis by analysing the histogram of intensity values.
I get similar plots (2 sharp peaks and one flat peak in specific order).
I tried to model it using mixture of Gaussian but the ...
1
vote
1
answer
463
views
How to get errors on a cubic spline interpolation (Python; splrep, splev)
I am performing a weighted cubic spline fit to some data x, y, and errors on y. I then want to interpolate other values and their errors along that curve. I am having a very difficult time figuring ...
0
votes
1
answer
80
views
how do fit probolic on data with python [duplicate]
sorry for asking low level questions. I'm a physicist and I don't know much about programming
I have data want to do fit probolic on it and I have no solution to solve it
example file data
x
y
z
t
-2....
0
votes
0
answers
68
views
While True loop stuck at a certain iteration while trying to optimize for the best curve fit given a data set in python
So basically I wanted to make my own function to fit a curve given a dataset. I generally applied the least square method for the types polynomial, exponential and logarithmic but I noticed that this ...
1
vote
0
answers
36
views
strange Polyfit behaviour in python
I have a dataset as in seen blue plot, the orange line is the trend line generated by poly fit. it seems like fit curve needs to be flipped on Y axis and rotated 90 degree clockwise. When I rotate my ...