least-squares Questions

3

Solved

I'm having a bit of trouble with fitting a curve to some data, but can't work out where I am going wrong. In the past I have done this with numpy.linalg.lstsq for exponential functions and scipy.op...
Dismiss asked 16/1, 2013 at 0:57

7

I'm looking for an algorithm to find the best fit between a cloud of points and a sphere. That is, I want to minimise where C is the centre of the sphere, r its radius, and each P a point in my s...
Granule asked 27/4, 2012 at 2:45

4

Solved

I know how to solve A.X = B by least squares using Python: Example: A=[[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,0,0]] B=[1,1,1,1,1] X=numpy.linalg.lstsq(A, B) print X[0] # [ 5.00000000e-01 5....
Agrarian asked 25/11, 2014 at 13:58

3

Solved

I have these values: T_values = (222, 284, 308.5, 333, 358, 411, 477, 518, 880, 1080, 1259) (x values) C/(3Nk)_values = (0.1282, 0.2308, 0.2650, 0.3120 , 0.3547, 0.4530, 0.5556, 0.6154, 0.8932...
Idel asked 25/4, 2017 at 17:9

2

I'm trying to fit a sigmoid curve onto a small set of points, basically generating a probability curve from a set of observations. I'm using scipy.optimize.curve_fit, with a slightly modified logis...
Nordic asked 22/8, 2019 at 18:30

2

Solved

Dear fellow stackoverflow users, I am trying to calculate the normal vectors over an arbitrary (but smooth) surface defined by a set of 3D points. For this, I am using a plane fitting algorithm th...
Scroop asked 3/12, 2018 at 10:1

4

I'm trying to perform a constrained least-squares estimation using Scipy such that all of the coefficients are in the range (0,1) and sum to 1 (this functionality is implemented in Matlab's LSQLIN ...
Lareine asked 13/2, 2012 at 23:6

2

Solved

Both the RMSE and the MAE are ways to measure the distance between two vectors: the vector of predictions and the vector of target values. Various distance measures, or norms, are possible. General...

4

Solved

The leastsq method in scipy lib fits a curve to some data. And this method implies that in this data Y values depends on some X argument. And calculates the minimal distance between curve and the d...
Lissie asked 21/2, 2012 at 11:36

2

Solved

I am trying to use circle fitting code for 3D data set. I have modified it for 3D points just adding z-coordinate where necessary. My modification works fine for one set of points and works bad for...
Psychogenesis asked 18/3, 2013 at 15:57

5

I've been trying to implement this algorithm in Python for a few days now. I keep coming back to it and just giving up and getting frustrated. I don't know what's going on. I don't have anyone to a...

4

Solved

When I run something like import numpy from sklearn import linear_model A= #something b= #something clf=linear_model.Lasso(alpha=0.015, fit_intercept=False, tol=0.00000000000001, max_iter=1000000...
Tallman asked 19/12, 2013 at 12:30

2

I compare fitting with optimize.curve_fit and optimize.least_squares. With curve_fit I get the covariance matrix pcov as an output and I can calculate the standard deviation errors for my fitted va...
Diagenesis asked 22/2, 2017 at 9:53

6

Solved

I have 4 points, which are very near to be at the one plane - it is the 1,4-Dihydropyridine cycle. I need to calculate distance from C3 and N1 to the plane, which is made of C1-C2-C4-C5. Calculatin...
Kepler asked 6/9, 2012 at 11:54

3

Solved

I have a set of points (x,y) and I need to find the line of best-fit that passes through the origin using MATLAB.

2

Solved

I want to use a linear regression model, but I want to use ordinary least squares, which I think it is a type of linear regression. The software I use is SPSS. It only has linear regression, partia...
Aureus asked 22/11, 2009 at 21:57

8

Solved

I am trying to implement a linear least squares fit onto 2 arrays of data: time vs amplitude. The only technique I know so far is to test all of the possible m and b points in (y = m*x+b) and then ...
Zoogeography asked 22/2, 2011 at 20:20

4

Solved

I am doing a computer simulation for some physical system of finite size, and after this I am doing extrapolation to the infinity (Thermodynamic limit). Some theory says that data should scale line...
Turnedon asked 30/1, 2014 at 23:26

3

Solved

So I've read the two related questions for calculating a trend line for a graph, but I'm still lost. I have an array of xy coordinates, and I want to come up with another array of xy coordinates ...
Ungainly asked 4/5, 2010 at 20:48

1

Solved

I would like to know how to define a complex objective function using or-tools (if it is possible). The basic example below shows how to have basic linear problem with Or-tools in python: solver ...

1

I have measurement points from a laser scanner coming from the inside of a tube. Now I want to fit a circle with the known radius of the tube. In principle similar to this post. But I work with R a...
Waves asked 26/8, 2019 at 15:42

3

Solved

I am fitting data points using a logistic model. As I sometimes have data with a ydata error, I first used curve_fit and its sigma argument to include my individual standard deviations in the fit. ...
Whiney asked 12/5, 2013 at 17:36

3

How would i fit a straight line and a quadratic to the data set below using the leastsq function from scipy.optimize? I know how to use polyfit to do it. But i need to use leastsq function. Here a...
Unlawful asked 5/11, 2013 at 14:41

2

I was wondering if there's a function in Python that would do the same job as scipy.linalg.lstsq but uses “least absolute deviations” regression instead of “least squares” regression (OLS). I want ...
Prepare asked 16/8, 2018 at 18:12

9

Solved

I have a large set of 3D data points to which I want to fit to an ellipsoid. My maths is pretty poor, so I'm having trouble implementing the least squares method without any math libraries. Does ...
Sturtevant asked 1/9, 2011 at 15:0

© 2022 - 2025 — McMap. All rights reserved.