884 questions
-3
votes
1
answer
100
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 ...
6
votes
1
answer
151
views
Scipy OptimizeWarning: Covariance of the parameters could not be estimated when trying to fit function to data
I'm trying to plot some data with a non-linear fit using the function:
kB and Bv being a constant while J'' is the independent variable and T is a parameter.
I tried to do this in Python:
#Constants
...
0
votes
2
answers
71
views
AUC by integration using Gnuplot results '0'
I am trying to find AUC after fitting a peak and integrating the fit. Following is the code (I am a newbie gnuplot user !^_^!).
FILE = 'rdf_1.dat'
f(x) = (a/2/d*exp(c**2/2./d**2 + (b - x)/d) * (erf((...
0
votes
0
answers
119
views
How to fit an Erlang mixture to a sample?
How can I fit an Erlang mixture to such data via R?
set.seed(123)
n <- 500
data1 <- rgamma(n / 2, shape = 9, rate = 10)
data2 <- mean(data1) + rgamma(n / 2, shape = 5, rate = 5)
sample <- ...
0
votes
0
answers
38
views
How to fit truncated distributions to truncated data? [duplicate]
I am familiar with the fitdistrplus package, which offers relevant tool for statistical inferences.
Meanwhile, I have trouble to understand what needs to be done when facing a sample that is left and/...
0
votes
2
answers
168
views
fitting theory with experimental data
I want to do fitting on experimental data and my theory I want to try to find the parameters that fit the same as the theory and experiment
do I have to make an algorithm? what algorithm do I use to ...
0
votes
1
answer
106
views
Nonlinear model fitting with several ifelse conditions
I am trying to fit a nonlinear model to empirical data and estimate the model parameters using the minpack.lm::nlsLM function. However, I am encountering difficulty in fitting the model with two ...
2
votes
1
answer
71
views
Fitting a function to exponentially decreasing numbers: Ensuring equal weight for each data point
So this question is based on a biochemical experiment. For those who know a bit about biochemistry it is an enzyme kinetics experiment. I have a dilution series of an activator (a or x) and am ...
0
votes
1
answer
75
views
Removing Noise (Jumps and Drops) from Sensor Data for Fuel Consumption
I am working with fuel consumption data received from a sensor, but sometimes the data contains noise (sudden jumps or drops) that makes it inconsistent. My goal is to identify and remove these ...
0
votes
1
answer
97
views
Determine most accurate best-fit algorithm for scattered points
I'm currently working with the skspatial package in Python3. I currently have two functions:
skspatial.objects.Cylinder.best_fit to try to best fit the points into a cylinder
A function that returns ...
2
votes
0
answers
117
views
R GAMLSS : How to fit a log-logistic distribution (truncated)?
I'm trying to fit a log-logistic distribution (truncated) with GAMLSS and can't find how to do it.
In the documentation, it says that for Generalized Beta 2 (GB2) :
Setting ν = 1 and τ = 1 in (15.20) ...
0
votes
1
answer
99
views
Sinusoidal Fit to Data in R [closed]
I have 45 years of daily temperature data parsed from a csv file. I was already able to convert the data in terms of years instead of days, and plotted the yearly maximum temperature, yearly minimum ...
1
vote
1
answer
66
views
Given the distribution of the data, how to infer the parameters?
I have data, only discrete data points, and know how the data is distributed, i.e:
y = w * gamma.pdf(x, alpha1, scale=scale1) + (1-w) * gamma.pdf(x, alpha2, scale=scale2)
How do you accurately infer ...
0
votes
1
answer
88
views
Gamma function fitting OptimizeWarning: Covariance of the parameters could not be estimated in Python
I am trying to fit functions to histograms using curve_fit from scipy, however a warning occurs when running the program:
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import ...
0
votes
0
answers
117
views
Improving speed and robustnes for opencv HoughCircles for only single circle
There are many threads on how to detect multiple circles via OpenCV's HoughCircles function, and I understand that this is a complex task with no single good answer. However, maybe someone can give ...
1
vote
0
answers
144
views
how fit a polynomial function in gnuplot?
I've been stuck for one week in this problem and I don't know what function fits better with my data. I've used gnuplot to fit a function to my data. I've tried a lot of combinations of functions, for ...
2
votes
1
answer
280
views
How to fit rectangles over a point cloud distributed in a plane?
We have a point cloud which has points which lie in the same plane. They are distributed similar to the red dots in the image below, we want to fit rectangles denoted by the yellow boxes. These ...
1
vote
1
answer
130
views
Python - Have two datasets which are measuring the same thing, how can I fit them together? [closed]
I have two datasets, both measures of sea level at a particular location. Although these are both measuring sea level, they are measured with different devices and different methods, and thus have ...
0
votes
0
answers
233
views
Curve Fit for interpolated data
I need to fit data where the data points are not equally distributed. However, the fit uses a convolution. From my understanding for the convolution to work, the arrays need to have the same spacing. ...
7
votes
2
answers
471
views
How to choose the best fitting method?
I want to fit non-negative parameters (xs in the code) to a function fp, given by
where v and L are fixed, given parameters. Computing fp can be done relatively quickly by vectorizing it and using ...
4
votes
3
answers
438
views
Data fit to a circle using python
I am trying to fit a set of data to an off-center-circle using python. However, the displacement of the center of the circle (to the center of the axis) is evaluated negative, when it should be ...
3
votes
0
answers
324
views
Scipy odr fails when Errors are given as Array - Problem is not full rank at solution
When trying to do orthogonal distance regression for a linear model, the scipy.odr package fails whenever I hand it errors (in x and y) in array shape (as opposed to scalar). The Error is "...
0
votes
1
answer
47
views
R model fit for a decay curve
I am trying to get a decay curve fitted to this data to get the values for other distances in R.
I have tried a few self-starting models (SSmicem, SSsymp), but these dont seem to appreciate that I ...
0
votes
0
answers
127
views
Fit ode in R with multiple time series simultaneously
I am a biology student and I am recently learning how to fit ode with observed data in R. I cultivate a microbe under a given condition but with two different initial densities (N0=5 and N0=100), I ...
0
votes
0
answers
128
views
How can I prevent NaN error when fitting data, and what is the best way to do so without skewing data?
#Load weather data
data = pd.read_csv(r"C:\Users\slick\Downloads\weather_dataset.csv")
#Hot encode data, for columns with information that is not
df_weather_processed = pd.get_dummies(data,...
0
votes
1
answer
282
views
Fit a model with multiple inputs, multiple outputs, multiple parameters, and covariance matrices for each data point using Python
Note: A similar question has been asked at the Cross Validated site for the mathematical/theoretical part, as suggested by the community. The question here is mostly about the implementation of the ...
0
votes
1
answer
89
views
add r-squared and equation of multiple fits (linear, power, logarithmic, exponential) in ggplot2
In this question (exponential fit with ggplot, showing regression line and R^2), there is a nice answer showing how to add multiple models/fits to the data. I would like to add the r-squared and the ...
0
votes
2
answers
84
views
How to fit exponential data in Gnuplot?
I'm working on a project where I need to fit some experimental data to an exponential function using Gnuplot. However, I'm new to Gnuplot and not sure how to do this efficiently.
I've been searching ...
1
vote
2
answers
88
views
I must fit sigmoid functions to two types of datasets (6 datasets each) with r^2 values, then plot derivatives of the fit functions. I get errors
The code worked for one of the datasets but not the other. I receive errors (shown at the bottom of my provided code).
You can see that I have two commented out data sections by type: One for work ...
0
votes
2
answers
521
views
Fitting 2D histograms with 2D gaussians
My problem seems very simple but I have been stuck on it for a while now.
I am simply trying to fit a 2D histogram with a sum of 2D gaussians.
As nothing seems to work I went back to basics and am ...
0
votes
1
answer
114
views
Exponential decay fitting in Scipy
I have two NumPy arrays x_data and y_data. When I try to fit my data using exponential decay function and scipy.optimize.curve_fit with this simple code:
import numpy as np
from scipy.optimize import ...
1
vote
1
answer
142
views
How do I fit a complex function to an array of values?
I have collected experimental data and have been instructed to perform a fit using a complex chirp function of the following form:
def func_M(x, a, x0, tau_p,b):
return a*np.exp(-2*np.log(2)*(x-x0)...
0
votes
2
answers
530
views
I am trying to fit a logistic sigmoid function to data. The data in the y-axis is reversed to show length change over x-axis progression. T
I have many datasets which start at a higher y-axis value, then decrease. This happens in traditional S-curve fashion, so it actually looks like a reverse sigmoid. I successfully flipped the y-data so ...
1
vote
2
answers
301
views
Why does SciPy minimize return different solutions when minimizing sum of squared error versus root mean squared error?
I am in the process of fitting a curve to data using scipy.optimize.minimize. To do this, I have defined an objective function which returns either the sum of squared error or the root mean squared ...
1
vote
1
answer
36
views
In R, how to fit variables (A,B and C) in the same column such as A and B and also A and C in the same panel?
I have one dataset.
df=tibble::tibble(
cultivar=rep(c("cv1", "cv2", "cv3"), each = 5L),
treatment=rep(c("Control", "Type 1", "Type 2", ...
4
votes
2
answers
88
views
How can I find the date for which a model from family = poisson(link = "log") predicts a specified value?
I have data that consists of values on dates, here represented as timestamps:
json <- structure(list(creation_date = c(1689356840L, 1689366017L, 1689376446L,
1689504809L, 1690366268L, 1690472012L, ...
0
votes
2
answers
130
views
How can I find the date for which a model predicts a specified value?
I have data that consists of values on dates, e.g.
Date Value
2024-02-12 7
2024-02-13 8
2024-02-14 9
I have fit a model to that data and can now calculate the predicted values for a future date:...
0
votes
0
answers
173
views
Find best fit common probability density function, if already have a probability density function (Python's Fitter does not suffice)
There are questions about finding best-fit p.d.f.s given some data: How to find probability distribution and parameters for real data? (Python 3), https://medium.com/the-researchers-guide/finding-the-...
1
vote
2
answers
93
views
Fit two constrained circular caps to data
I'm trying to make a rather complex fit to a set of data points in python, and after much googling and reading I still have no idea where to start.
The data points are
datagrey = array([[-260.02020661,...
0
votes
1
answer
894
views
Fitting data with a three-parameter Weibull distribution function
In my data, the first column is the x values, and the second column is the y values. I want to fit the data with a three-parameter Weibull function to describe the distribution.
I tried to find ...
0
votes
1
answer
189
views
Fitting data for an implicit function with 2 parameters
I have an implicit function of independent variable sB and dependent variable H with two parameters kV and km, describing an chemical experiment. I tried to fit the experimentally obtained logarithmic ...
0
votes
1
answer
209
views
Combined fit of two distributions
I have two separate distributions given by the functions P_multiple and P_single. I would like to combine the two and into one combined fit function which has a natural "transition" between ...
1
vote
0
answers
112
views
How to centre observational data onto predicted isochrone data in Python
Edit: The observational data can be found here. The isochrone or predicted data can be found here.
So I'm trying to best fit observational astronomy data to a predicted 'patttern' callen an isochrone. ...
0
votes
0
answers
210
views
Math.NET 6th order polynomial fit returns infinity and NaN as parameters
I'm trying to fit 100 data point using 6th order polynomial with Math.NET.
I've noticed that the fit results are very much dependant on the chosen method and so I've decided to stick with the Svd ...
-1
votes
2
answers
171
views
ImageJ: How to adjust color of plotted ellipses based on pre-defined RGB values?
I plot ellipses using a txt file which consists all parameters (x,y coordinates, major/minor axes, angle of the major axis) and RGB values for each ellipse. Plotting ellipses is the easy part, however ...
1
vote
2
answers
3k
views
Fitting an ellipse in python
I am very new to coding and I basically only use it for physics related stuff. I have recently been trying to fit an ellipses with data that I have but I have not gotten any result that resembles the ...
1
vote
1
answer
314
views
How do I find the uncertainties on a fit with correlated parameters in python?
I have found the parameters that get the best fit to the data using chi squared and the scipy fmin function. I am trying to get the uncertainties on these parameters by finding the values on the chi ...
0
votes
1
answer
245
views
MATLAB Invalid use of operator error message
The error lies in the line of
myfittype = fittype("A*cos(omega_0*t+phi)",dependent="A" "omega_0" "phi",independent="t",coefficients=["A" &...
0
votes
1
answer
159
views
Method to calculate complex residuals between a complex function and data containing real and imaginary parts
I am working on building a script in RStudio which can fit Complex Impedance data of the form Z = a + ib, to model formulas which aim to describe how Z changes with frequency. I have seen for other ...
3
votes
1
answer
424
views
Split Pseudo Voigt Profile
I am currently dealing with some X-Ray data analysis, which in principle could be in principle done with the package PyMca https://www.silx.org/doc/PyMca/dev/index.html. However, I am trying to do ...