Questions tagged [linear-interpolation]

Linear interpolation is the process of approximating intermediate values given an assumption that the ranges of missing data look roughly like straight lines.

Linear interpolation is largely used for its simplicity and is typically more effective given a greater density of data. The more complex the underlying relationship of the quantities involved, the less likely linear interpolation is to provide a good value estimates.

In scientific software for statistical computing and graphics, function approx performs 1D linear interpolation.

437 questions
0
votes
1 answer

Interpolate WITHOUT using a well-known function

I have two arrays with the same dimension, lets name it x and y. When I plot them, plt.plot(x,y) the plot itself gives me back a continuous interpolation of my discrete data x and y. How can I recover these interpolation from the plot? Is there any…
0
votes
0 answers

Linearly Interpolating a function not on a grid, but on a convex set of points in R

Suppose I have the set of points x1 = c(0,3,6) x2 = c(0,3,6) and I want to interpolate the function y <- function(x){x[1]^2 + x[2]^2} On set the set of points such that x1 + x2 <= 6. That is... z = x1 x2 0 0 0 3 3 0 …
0
votes
1 answer

Can OpenCV cv::resize() change the min and max values of the image? (Using INTER_LINEAR method)

Let us say I have a greyscale image(640 × 480 size) with min pixel intensity = 23 and max intensity = 245. If I resize it using cv::resize() with INTER_LINEAR to 1920×1080, can the min and max intensities change? My min intensity has become 25 and…
0
votes
1 answer

How to get monthly totals from linearly interpolated data

I am working with a data set of 10,000s of variables which have been repeatedly measured since the 1980s. The first meassurements for each variable are not on the same date and the variables are irregularly measured - sometimes measurements are only…
Abijah
  • 512
  • 4
  • 17
0
votes
1 answer

Fastest approach to interpolate between several lines

I have intercepts and slopes of 14 different lines where y = Slope * x + Intercept. The lines are more or less parallel as follows. Each line represent a certain class. Intercept Slope 1 8.787611 -3.435561 2 6.853230 -2.662021 3 …
ahoosh
  • 1,340
  • 3
  • 17
  • 31
0
votes
1 answer

How to solve a linear interpolation data by time step in R : (list) object can not be coerced to type 'double'

I have data of instantaneous water discharge under a file data.txt (data below) (list) object can not be coerced to type 'double'   I think the problem is due to the format of the dates, please how to solve this problem? write.table(TAB4,…
tazrart
  • 167
  • 1
  • 15
0
votes
2 answers

Using linear interpolation to predict value in matlab

I have a set of data and would like to use linear interpolation in Matlab to find the corresponding value of a specific point. x = [1 2 3 4 5 6 7 8 9]; y = [1 2 3 4 5 4 2 6 8]; xq = [1:0.25:9]; vq1 =…
TYL
  • 1,577
  • 20
  • 33
0
votes
1 answer

numpy.interpd -returning only the last value after interpolation

I have a set of data points in pressure(p) and vmr. I want to find the vmr values for another pressure grid(pressure_grid).I used np.interp, for lines in itertools.islice(input_file, i, l): lines=lines.split() p.append(float(lines[0])) …
caty
  • 81
  • 2
  • 13
0
votes
1 answer

Interpolation function in processing

I am new new to processing and I am trying to experiment with the lerp function in processing. Basically what I am trying to do is, click on different point on the screen, these positions are being stored in an array. when the user clicks enter, the…
0
votes
1 answer

How to do value interpolations in a visual basic array?

HI If there is a uniform terrain with a specific degree of roughness (know contour interval), how an interpolation can be performed if the grid around a specific point is known? For example, if the starting elevation is 105m and the contour interval…
Aharoun Baalan
  • 169
  • 4
  • 13
0
votes
0 answers

Function to linearly interpolate bearing data in radians with time?

I have a dataset of compass bearing in radians taken at random time…
0
votes
2 answers

Ruby Interpolation Search on 2nd Element of a Two Dimensional Array

What I have below is a simple interpolation search on a single dimensional array $employee_list. The list is an ordered list of employees' id that might have gaps due to retirements. def exist?(id) lower = 0 upper = $employee_list.length - 1 …
0
votes
1 answer

Interpolation Search Implementation on Ruby Infinite Loop

I have just learnt how to do an interpolation search but am having issues with its implementation on Ruby. I keep having infinite loops with either the lower bound or the upper bound being close to the searched number but the lower bound doesn't…
Benjamin
  • 343
  • 1
  • 2
  • 9
0
votes
1 answer

How could one efficiently find the missing timestamps from a given time series compared to all other available time series?

Suppose that we have the following time series: X1 = {(0, 3), (1, 4), (3, 5)} X2 = {(0, 3), (1, 4), (2, 6) (3, 5), (4, 8)} X3 = {(0, 3), (1, 4), (2, 6) (3, 5), (4, 8), (5, 9)} where the first element of the tuple represents the time, and the…
user5794813
0
votes
1 answer

returns an error

I need to substitute or interpolate the NA in a vector of each cell from a rasterstack data. I have two functions fun_sub for substituting NA and fun_interp for interpolating NA. I found fun_sub works very well. But fun_interp does not work but I…