Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
386 views
in Technique[技术] by (71.8m points)

arrays - Predict a value outside a 2d matrix - (2d regression?)

Not quite sure what the name for this problem is which makes it hard to find a solution.

I have 2 values like [ 0, 2.5 ] each describing an index for 2 dimensional array. X/Y-Axis has a scale of [0, 0.2, 0.3, 0.4 ... 2.5] - so for the example i get indexX: 0 indexY: N.

Now i can pic the resulting value at position [0, N] from the 2D-Array. My Problem is - i can now get values outside of the 2D-Array, like [ 2.6, 2.6 ]. How can i predict a value for this coordinates.

Any hints on this - i used simple linear regressions for predicting simple pair of values but don't know what the name for this mathematical problem is and how to solve it?

question from:https://stackoverflow.com/questions/65848869/predict-a-value-outside-a-2d-matrix-2d-regression

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You could use some form of interpolating polynomial, e.g. Lagrange interpolation or Newtonian interpolation. You have a function described by the values in your array [0, 0.2, 0.3, ..., 2.5]. You can then use one of the interpolation methods to basically map the indexes of your array [0, 1, 2, ..., N] to the values. See Lagrange polynomial and Newton polynomial for details. Be aware that using these to interpolate values outside the defined range of the function can be problematic, and that linear interpolation may provide better results if your values are, in fact, linear.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...