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
2 answers

finding the interpolated intersection between two arrays in Python/Numpy/Scipy

I am looking for a simple approach to finding the interpolated intersection between two Numpy arrays. I know that this is simply achieved if we have two function handles, rather than two arrays, as shown in this link using Scipy or using Sympy. I…
splinter
  • 3,727
  • 8
  • 37
  • 82
0
votes
1 answer

Lagrange Interpolation Algorithm in C Diverges After Many Steps

I have a Lagrange interpolation algorithm that begins to diverge after many time steps and I can't seem to figure out why. As a quick review, if I had two arrays int x[11] = {0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100} int y[11] = {0, 2, 4, 6, …
Leigh K
  • 561
  • 6
  • 20
0
votes
1 answer

How can i set a variable to 0 gradually in p5.js (javascript)?

I'm trying to control an ellipse with the up,down,left,right keys. I want to make it smooth, so the ellipse doesn't stop immediately. Also when its moving to the left and you press the right arrow, it turns around faster. Minimal, Complete, and…
hodabi
  • 1
  • 1
0
votes
1 answer

Expanding a 2D Matrix in Matlab with Interpolation

Let's say I have a 4 pixel by 4 pixel image with values between 0 and 255 and I want to expand it to an 8-by-8 image, interpolating where necessary. I know how to interpolate a vector this way with interp1: interp1(linspace(0,1,numel(vector)),…
playitright
  • 174
  • 7
0
votes
1 answer

resamplig pandas (not as a timeseries)

I have a pandas dataframe like this: index x y 0.010 1 Nan 0.011 Nan 3 0.014 NaN 4 0.019 9 Nan 0.020 10 7 This matrix comes from a concatenation of 2 matrices I would like to resample the index at equally…
Mauro Gentile
  • 1,463
  • 6
  • 26
  • 37
0
votes
1 answer

Digital image processing bilinear interpolation

If in digital image processing, i use bilinear interpolation for image scaling and if the scaling factor is 1.5x then how do i represent 1.5th column in a physical matrix structure?
0
votes
1 answer

Better way of generating linear spline based on vertexes

I'm trying to calculate y values based on x values and a series of curves defined by a set of vertices. I'm pretty new to R, and couldn't find a direct way to do this. I've found a couple of methods, but I am looking for a better method to…
Brian Fisher
  • 1,305
  • 7
  • 17
0
votes
1 answer

Linear Interpolation - shrinking a line

Suppose we have a 1D array named that consists of 9 elements: Source[0 to 8]. Using "Linear Interpolation" we want to shrink it into a smaller 4 point array: Destination [0 to 3]. This is how I understand the Algorithm: Calculate the ratio between…
0
votes
1 answer

Most efficient linear interpolation using integer fraction

I’m playing around with Direct digital synthesis wavetables on an Atmega328. Given an 8-bit fractional value F, and two 8-bit values A, B, what would be the most efficient way to calculate the linear interpolated value between A and B? I can think…
0
votes
1 answer

Filling Missing Values in a Time Series with Next and Prev Values

I am trying to fill in the missing values of a time series like the one below. I am using Python3. Week Rainfall(cm) 1 1 2 NaN 3 9 4 10 5 11 6 NaN 7 NaN 8 14 I do not want to fill the missing values with the mean. If I…
0
votes
0 answers

what is the formula used in Querying the Interpolant in matlab

I am trying the understand the logic of what Querying the Interpolant does in matlab and write a logic in c#. The following code is in matlab. D = griddedInterpolant(A,B,'linear'); where A=[1;2;3;4;5] B=[6;7;8;9;10] T=[1;2;3;4;5] Now when execute…
Siva
  • 1,281
  • 2
  • 19
  • 41
0
votes
1 answer

Interpolate values in unbalanced panel data using SAS

Say we are confined to using SAS and have a panel/longitudinal dataset. We have indicators for cohort and time, as well as some measured variable y. data in; input cohort time y; datalines; 1 1 100 1 2 101 1 3 102 1 4 103 1 5 …
JPErwin
  • 223
  • 1
  • 10
0
votes
1 answer

Using interp2 - The grid must be created from grid vectors which are strictly monotonically increasing

I am using MATLAB_R2016b. I have data of this format Temperature = [310:10:800]; Pressure = [0.1 0 1.0 10.0 100.0 1000.0]; Cv = ... [ 73.6400 25.3290 73.5920 73.1260 69.4500 61.8600 72.8060 25.3810 72.7640 72.3450 68.9780 …
Ankit Mishra
  • 409
  • 2
  • 5
  • 17
0
votes
1 answer

Interpolate data buffers using OpenGL?

I am writing an application that loads the vertices of two meshes (which serve as keyframes) into two separate OpenGL float data buffers. The two meshes have the same number of vertices. I would like to compute intermediary frames by using linear…
MathuSum Mut
  • 2,765
  • 3
  • 27
  • 59
0
votes
1 answer

Any simple way to do VLOOKUP combine "linear interpolation" in excel?

I'm making an excel sheet for calculating z-score for infant weight/age (Input: "Baby Month Age", and "Baby weight"). To do that, I need get LMS parameters first for a specific month, from below table.…
Fang Dong
  • 33
  • 1
  • 7