Skip to main content

Questions tagged [curve-fitting]

Methods used to fit curves (as in linear or non-linear regression) to data.

Filter by
Sorted by
Tagged with
0 votes
1 answer
48 views

How do I calculate the error on the extrapolation of a double natural log fit? [duplicate]

I am writing software in Python that tries to fit a data set $t, y$ to the function $y = a \ln(pt) - b \ln(qt)$ and solve for the value of $y$ at $t=30$, denoted $y_0$, and its error $\sigma_{y_0}$. ...
ohshitgorillas's user avatar
0 votes
0 answers
28 views

How to measure the error on extrapolation from a double log fit? [duplicate]

I am writing residual gas analysis mass spectrometry software in Python. One of the functions of this software is to take the raw mass spec intensity data, $y$, and timestamps $t$, and fit them to the ...
ohshitgorillas's user avatar
-1 votes
1 answer
38 views

Calculating error on a double natural log fit

I am writing residual gas analysis mass spectrometry data reduction software in Python. The evolution of gas intensity $y$ over time $t$ in the mass spec is roughly a double natural logarithmic ...
ohshitgorillas's user avatar
4 votes
1 answer
227 views

Approximation function for MLP and LSTM

I have total of 6300 samples, 5800 of which are training data, and 500 of which are testing data. We compare the performance of LSTM and multilayer perceptron (MLP) with one hidden layer in terms of ...
D. S.'s user avatar
  • 69
0 votes
0 answers
17 views

Finding a function for the number of people on a bus

I've been trying to pin down the function that would describe the number of people on an ideal bus ( # of stops and passengers approaches infinity/ is large enough that the function is continuous), ...
Eda Toloch's user avatar
0 votes
3 answers
61 views

What is a good starting model for fitting a rotated sigmoidal curve?

I'm trying to make a model to fit a rotated sigmoidal curve in R but don't know where to start when looking for an appropriate equation for the model. Some example data and the type of fit I'm getting ...
jaysmith's user avatar
0 votes
0 answers
41 views

How to fit data to a parametric curve/model (x(t), y(t)?

I've got data of x and y pairs and I'd like to fit it to a model that is parametrized as f = (x(t), y(t)). Unfortunately, there is no way for me to analytically solve for t and get a direct ...
StatAnomaly123's user avatar
4 votes
1 answer
94 views

Help fitting doube-exponential curve to raw mass spec data, time

I am writing mass spec data reduction software in Python for a helium measurement system and could use a hand getting a double-exponential function to fit my data. Basically, the gas in the mass spec ...
ohshitgorillas's user avatar
0 votes
0 answers
23 views

Graphical analysis of residuals

For an electricity experiment, I have collected data on the charging and discharging of a capacitor. Using the data and scipy.curve_fit, I have fitted the theoretical models. Now, I need to validate ...
Iván Solich's user avatar
1 vote
1 answer
37 views

Parameter uncertainty in curve fitting

My real problem has a much more complexity and a different function than following. However, for the sake of simplicity assume I have a data that can be described as a one dimensional Gaussian ...
MOON's user avatar
  • 173
0 votes
1 answer
31 views

Fitting data to a Malthusian exponential model

I have some data from the exponential phase of yeast growth and I want to fit it to a exponential (Malthusian) growth model or curve, so the growth rate (with its error) and any metric of the goodness ...
Paolo Vallejo Janeta's user avatar
0 votes
0 answers
29 views

Fit on original data vs linear fit on transformed data

I asked a question yesterday (Better function to fit log-like data?) and the accepted answer got me thinking. For non-linear data, Is it better/more recommended to asses the goodness of fit on the ...
Gabriel's user avatar
  • 4,352
4 votes
3 answers
240 views

Better function to fit log-like data?

I'm trying to fit a two-parameter function to data that looks like this (black dots, x scale is logarithmic): The best fit I could find is an $arctan$, measured by the MSE. All the seven functions I ...
Gabriel's user avatar
  • 4,352
1 vote
0 answers
32 views

Help identifying a distribution

I'm seeing data whose rank-frequency curve is nearly log linear (b e^(a x)) but where the top few frequencies are higher than expected. The top fits a Bradford distribution well, and the middle is ...
Scott Deerwester's user avatar
0 votes
0 answers
19 views

How to numerically fit an adaptive composite bezier curve?

Given a set of points $X$ that define a smoothly varying curve $y$ that describe a highly sampled smoothly varying time series I would like to fit some bezier curve sections to the data to effectively ...
Goods's user avatar
  • 173
3 votes
0 answers
33 views

Confidence interval of least square estimator and dependence of parameters

I have data from a physics experiment, where we measure some quantity $y$ as a function of $x$ and $t$. In practice, I have access to $M$ values $x_i$ of $x$, $N$ values $t_j$ of $t$, and thus $M\...
Adam's user avatar
  • 203
2 votes
0 answers
77 views

Fitting curves with restricted relative orientations

Edited to focus on the math (thanks whuber): Given a sequence $z_1,…,z_n$ of complex numbers and a fixed real number $σ$, find a sequence $x_1,…,x_n$ from the set $\{0,\pm1,\pm2\}$ minimizing $$ \sum_{...
CrazyArm's user avatar
  • 121
2 votes
0 answers
63 views

Bayesian optimization for parametric curve fitting?

I am relatively new to Gaussian Processes and Bayesian Optimization. My question is very simple: Suppose I am trying to learn a function from a parametric family of curves which best describes the ...
chesslad's user avatar
1 vote
0 answers
41 views

How can I know if my data better fits a power or a log curve?

I have two arrays representing the independent and dependent variables in a certain experiment (1000 samples). I would like to know the functional relation between them. Specifically, I would like to ...
Erel Segal-Halevi's user avatar
1 vote
0 answers
44 views

Fitting a Gaussian function to Poisson noisy data

Let $A$, $\mu$, $\sigma$ be some positive, a priori unknown parameters. Define a Gaussian function $f$ as $$f(x) = A \mathrm{exp}\left(-\frac{1}{2} \left( \frac{x-\mu}{\sigma}\right)^2\right).$$ One ...
mathslover's user avatar
0 votes
1 answer
45 views

Functional Data Analysis - minimum points per curve?

I am embarking on a project for which I'd like to use functional Data Analysis (FDA). I have several thousand discrete curves objects on which I'd like to fit continuous time curves. These discrete ...
s5s's user avatar
  • 685
1 vote
0 answers
35 views

Fitting uncertainty vs. bootstrap uncertainty

I'm currently working with some power law data of the form: $Y_i = \beta \times X_i ^{-\gamma} $ Where $Y_i$ are my measurements at point $X_i$. The uncertainty on $X_i$ is vanishingly small and can ...
AnImageAnalyst's user avatar
0 votes
0 answers
27 views

If you drop the "1-" in the formula of R2 and calculate the adjusted R2, does that metric mean anything?

First off, sorry for the convoluted title, but I didn't manage to come up with a shorter one. Background: I have some 2D particle tracks that I would like to fit with polynomials. The tracks are ...
mapf's user avatar
  • 105
0 votes
0 answers
19 views

Time Series Prediction for Variable-Length Input with Fixed Sampling Period

I'm working on a time series prediction task where I need to predict the parameters (amp, phase, freq, offset) that best fit a variable-length input series. The samples are always at the same period. ...
Andrea Arlotta's user avatar
3 votes
3 answers
88 views

How to visualize trends

I am working on a paper where we plotted BMI trends as a function of age in the population. We plotted trends for six databases, then we plotted for each sex, then for race, in three categories. I ...
Stefano Staurini's user avatar
1 vote
0 answers
51 views

How can I fit my experimental curve using this equation using python? [closed]

The equation is $ Y = \left(a*\arctan\left(\frac{x \pm b}{b} * c\right)\right) + d x $ I tried fitting using scipy.optimize but could not include $\pm$ Here $ a , b,...
Dipankar Pokhrel's user avatar
1 vote
1 answer
122 views

Knots selection testing for Natural Cubic Splines model in R

I have a dataset of Japan's Mortality rate and want to fit a natural cubic spline to this mortality data. The choice of knots are subjectively chosen at 10, 20, 30,...,90. I want to know whether or ...
JaFranke's user avatar
1 vote
0 answers
24 views

Need guidance to fit logistic distributions to compare performances in multiple events

Ok, here's the thing. I'm trying to compare performances in different running events (i.e. all registered performances in each event from 1990 to 2023), to estimate equivalent performances. After ...
Daniel Westergren's user avatar
0 votes
0 answers
27 views

How to know errorbars on accuracy to nonlinear fit: $A(1-\cos(x+\phi))$ with poisson noise?

I am trying to write some code that accurately estimates the parameters for the following function: $$ Y = A(1-V \cos(X+\phi)) $$, where this output data is poisson distributed. To do this, I first ...
Steven Sagona's user avatar
1 vote
1 answer
26 views

Is it possible to have an Indicator-spesific Trait factor model within a multiple indicator second order growth model?

I am running a multiple-indicator growth curve model over 7 time points. One of my items has a large residual variance and seems to covary very well among themselves. Thus, I assumed that it has a ...
EmH's user avatar
  • 315
0 votes
0 answers
16 views

Cubic spline with circular predictor [duplicate]

I have a set of observations $y_i$ for a set of values of the independent variable $x_i$. $x_i$ takes values of angles, so it is a circular variable. Is there some method to perform cubic splines or ...
dherrera's user avatar
  • 1,328
1 vote
0 answers
22 views

Invariance coding for running a latent growth model running under partial (scalar or metric) invariance

I am running a second-order latent growth curve with 7 time points. The model has a four indicator latent variables at the measurement level so I ran a longitudinal invariance test. The model holds ...
EmH's user avatar
  • 315
0 votes
0 answers
294 views

Curve fitting: Scaling the sigmas so that the reduced chi-squared statistic = 1. Is this a good heuristic?

In the official documentation for the python function scipy.optimize.curve_fit, the following description is given for a boolean-typed parameter absolute_sigma. If False (default), only the relative ...
J. Doe's user avatar
  • 101
1 vote
1 answer
42 views

Double exponential decay with values going below the start point of the fitted curve

I have a small dataset with 5 points where x values are log(time) and y = obs. It is known that the behavior is an exponential increase for the first and second (x,y) values and then decreases ...
MaterialSci's user avatar
4 votes
1 answer
463 views

Uncertainty of the area of a Gaussian curve atop a linear background

I have some data from a counting-based spectroscopy experiment. Each data point is an (Energy, Rate) pair. One such data set looks like this: I choose to fit this data to a Gaussian curve plus a ...
BohemianTapestry's user avatar
1 vote
2 answers
53 views

Help with (what should be?) a simple exponential curve [closed]

I'm admittedly not a math expert. I'm in the process of reverse engineering a piece of software and am stuck on finding a curve. The curve is used to convert a value (0-1) into a real world value. The ...
John Conrad's user avatar
1 vote
0 answers
80 views

How to find the curvature of a noisy function with few evaluations?

I'm working on a project in computational solid state physics where I have to find the curvature of a smooth function $f \ : [0,\infty] \rightarrow \mathbb{R}$ around the minimum point $x_0 = 0$. The ...
Jakob KS's user avatar
  • 111
0 votes
0 answers
51 views

Learning Curve on two classifiers

I am using a logistic regression classifier and Gridsearch to optimize negative log loss. After generating its learning curve to test for overfitting/underfitting, my model seems to return this ...
user54565's user avatar
0 votes
1 answer
28 views

Consequences for not estimating autocorrelated residuals in a growth curve model

I am fitting a second order growth model with 7 time points on Mplus. When I estimate the model with autocorrelated residuals in it the model will not run because of identification issues. (when I ...
EmH's user avatar
  • 315
1 vote
0 answers
165 views

Test of good fitting on a sigmoid [closed]

as you can see on the figure i linked i am currently fitting my data (which looks like a sigmoid) using a function i defined with 5 parameters. ...
luigi123456's user avatar
0 votes
1 answer
73 views

Conditional Expectation of Multivariate Normal

I'm trying to calculate a good mean shrinkage parameter for a custom quadratic discriminant analysis (QDA), and I ran into a math problem. Suppose $X=(X_1, X_2, \ldots, X_k)^T\sim{\mathcal{N}(\textbf{...
Charles0349's user avatar
0 votes
1 answer
55 views

Estimating a censored distribution curve

I have a sample of only 142 numbers from a distribution of 3852 numbers ranging from 0 to 53, but it is censored below 35 (The values ​​exist, but I don't have access.), so I have only the values in ...
Silvio Duarte's user avatar
1 vote
0 answers
402 views

How to fit data with asymmetric error bars?

General question: How do I fit a model to data when the data points have asymmetric error bars? What is the cost function I use to calculate residuals, and from that, how do I calculate confidence ...
Jagerber48's user avatar
1 vote
0 answers
47 views

How to calculate heteroskedastic standard errors

I'm doing curve fitting, but my error is non-stationary. The variance decreases: I'm looking for a signal in the noise (In this case at x=90, y=50). I'd like to calculate the "standard error&...
Tom Huntington's user avatar
1 vote
1 answer
157 views

Testing goodness of fit for a Zipf distribution (in Matlab)

I have several ranking distributions and would, for each one, like to fit a [Zipf distribution][1], and estimate the goodness of fit relative to some standard benchmark. With the Matlab code below, I ...
z8080's user avatar
  • 2,362
2 votes
0 answers
99 views

Fitting data taking into account for the spread in data, which are zero for some data points

I'm trying to use scipy to fit a $\tanh$ function to some data. The data is of the form $(x_i, y_i)$ for $i=1,\cdots,N$, where $0\leq y_i \leq 1$. I choose $x_i$ to be linearly spaced, such that $x_0=...
sodiumnitrate's user avatar
0 votes
1 answer
178 views

Fitting a power law model with an additional linear term

A model of the form $y=a\cdot x^b$ can be linearly fitted by taking logs on both sides - giving $\ln(y)=\ln(a)+b\cdot\ln(x)$, where $\ln(y)$ is regressed against $\ln(x)$. This is a standard textbook ...
des224's user avatar
  • 1
0 votes
1 answer
38 views

Is it possible to use some form of curve identifcation algorithm or model in R to identify a curve based on data from three different treatments?

I was wondering if it is possible to train a model or algorithmn to identify a curve shape based on experimental data. Say we have 3 treatments 0 mM sugar, 1 mM sugar and 10 mM sugar and three ...
Cameron William Michael Murphy's user avatar
2 votes
1 answer
139 views

How to find the linearity of 5 points

I am currently developing a software in C. I have an array (matrix) that contains some coordinate points like this (125 points for now): \begin{bmatrix}x1&x2&x3&x4&x5&...&x125\\...
nomad's user avatar
  • 23
2 votes
0 answers
51 views

Measure of goodness of polynomial fit at specific points or weighted analysis?

I have some astrophysics data of "particle density vs orbital position" of a moon that emits a lot of particles. My research deals with the intensity of the scattered light which is ...
Claudia's user avatar
  • 21

1
2 3 4 5
14