Questions tagged [best-fit]

75 questions
15
votes
4 answers

Algorithm for best fit rectangle

I'm looking for an algorithm to do a best fit of an arbitrary rectangle to an unordered set of points. Specifically, I'm looking for a rectangle where the sum of the distances of the points to any one of the rectangle edges is minimised. I've…
SmacL
  • 22,555
  • 12
  • 95
  • 149
8
votes
1 answer

Why does my linear regression fit line look wrong?

I have plotted a 2-D histogram in a way that I can add to the plot with lines, points etc. Now I seek to apply a linear regression fit at the region of dense points, however my linear regression line seems totally off where it should be? To…
7
votes
1 answer

ImageMagick best fit text within rectangle?

I have an image like this, with a rectangle at specific coordinates: (for illustratory purposes I put the coordinates of the rectangle and its size and center in there) Now I want to render some text with ImageMagick, so that it fits exactly within…
RocketNuts
  • 9,958
  • 11
  • 47
  • 88
5
votes
1 answer

Best fit of point cloud to another point cloud in python

I have the following problem: From a txt-file I have two arrays with x,y,z coordinates of each point cloud and a temperature value. I extracted the coordinate lists out of two fem-files. Both describe a similar part but the distance from point to…
Abartis
  • 51
  • 3
4
votes
1 answer

Finding the average intersection line for multiple planes

I have some planes in 3D space, which in theory should all intersect at the same line. Each plane is calculated by taking 3 measured points. However there is some error in the measurement of these points. So in practice, the planes do not all…
HugoRune
  • 13,157
  • 7
  • 69
  • 144
4
votes
1 answer

Find the rectangle with the smallest area that can hold another rectangle

Assume that I have a set of rectangles (with different or same dimensions). The task is to find (and remove) the rectangle from the set that is larger or equal to a given rectangle. It should also be the smallest rectangle in the set than can…
3
votes
1 answer

Which polynomial regression degree is significant ? depends of number of points or other parameters?

I am studying the stability of numerical derivatives as a function of the step I take to compute these derivatives. With a derivative with 15 points (obtained by the finite difference method), I get the following plot (each multipole "l" corresponds…
user1773603
3
votes
1 answer

is it right to use dapper and MongoDb in one application

I'm developing BPM (business process management system) in asp.net C# and workflow foundation 4.5. bpm systems usually have allot of process and each process has many forms. i made that easy by using JSON data so i will store all forms data in one…
Nour Berro
  • 550
  • 5
  • 14
3
votes
4 answers

Javascript Speed: Scope or Variable

is there a difference between the following two code examples (speedwise, best practice, etc)? This: function() { var me = this; me.doSomething(); me.doAnotherThing(); }; Or this: function() { this.doSomething(); …
Dinkheller
  • 4,631
  • 5
  • 39
  • 67
2
votes
1 answer

Deduce center of circle from portion of circumference

I have sequences of points forming arcs(?). I would like to deduce the best fit circular (or even ellipsoid) curve for these points. Each arc has a relatively consistent change of angle across its length (that is partly how I isolate them). An…
DrPhill
  • 614
  • 5
  • 16
2
votes
3 answers

Test for coplanar points, and comparing best planar fit of many sets of points?

Perhaps best asked in three parts: Given five not necessarily coplanar points (in 3 dimensions), what is a good measure of how close to coplanar they are? Given another set of five not necessarily coplanar points, how can we assess which of these…
2
votes
2 answers

How to set Axes limits on OpenTurns Viewer?

I'm using openturns to find the best fit distribution for my data. I got to plot it alright, but the X limit is far bigger than I'd like. My code is: import statsmodels.api as sm import openturns as ot import openturns.viewer as otv data =…
vaughan is god
  • 162
  • 1
  • 13
2
votes
2 answers

Python Linear regression : plt.plot() not showing straight line. Instead it connects every point on scatter plot

I am relatively new to python. I am trying to do a multivariate linear regression and plot scatter plots and the line of best fit using one feature at a time. This is my code: Train=df.loc[:650]…
2
votes
3 answers

Producing a "best fit" slope gradient from pandas df and populating new columnb

I'm trying to add a slope calculation on individual subsets of two fields in a dataframe and have that value of slope applied to all rows in each subset. (I've used the "slope" function in excel previously, although I'm not married to the exact…
Benson Burns
  • 31
  • 1
  • 6
2
votes
0 answers

best fit memory allocation block size

I'm trying to simulate an OS. Say I'm given x bytes of memory. How would I go about designing a best fit memory allocation system? I am planning to create an array to store multiple memory block objects, each containing some amount of the total…
Nych
  • 78
  • 1
  • 3
  • 10
1
2 3 4 5