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

Matlab reversed 2d interpolation interp2

I have a function V that is computed from two inputs (X,Y). Since the computation is quite demanding I just perform it on a grid of points and would like to rely on 2d linear interpolation. I now want to inverse that function for fixed Y. So…
3
votes
1 answer

Using MATLAB linspace between every element in an array

Using MATLAB, I would like to linearly interpolate between every point in an array. Using interpolate will do it in a non-linear fashion. What I want to do is similar to producing low-pass filter coefficients. I have come up with a solution, but I…
user263485
  • 215
  • 3
  • 8
3
votes
1 answer

Performing interpolation on a table, grouping by a 3rd field

I have a SQL Server 2008+ table with three columns: Delta (float) Rate (float) and Date (datetime) I need to be able to generate a table of rates for all delta for a given date, interpolating if necessary. I can do this fine for single values of…
Matt Allwood
  • 1,448
  • 12
  • 25
3
votes
1 answer

d3 line smoothing (stronger than monotone)

var valueline = d3.svg.line() .interpolate("monotone") .x(function(d) { return x(d.t); }) .y(function(d) { return y(d.r); }); This causes the line to be little smoother. is there a way to control the strength of the smoothing? Other string values…
Aladdin Mhemed
  • 3,817
  • 9
  • 41
  • 56
3
votes
2 answers

How to reduce the speed of RotateAnimation in Android

How can I reduce the rotation speed of RotateAnimation instance. I'm using following code snippet to do animation. rotateAnimation = new RotateAnimation(currentRotation, currentRotation + (360 * 5), Animation.RELATIVE_TO_SELF, 0.5f,…
3
votes
1 answer

n-dimensional interpolation c++ algorithm

How can I implement n-dimensional interpolation in C++? In ideal case I would like to have it generic on actual kernel so that I can switch between e.g., linear and polynomial interpolation (perhaps as a start: linear interpolation). This article (…
usman
  • 1,285
  • 1
  • 14
  • 25
3
votes
1 answer

LinearInterpolator not working well when ViewPager Scrolls Right to Left

I am using v4 ViewPager and following the below link able to set the scrolling speed and scrolling animation using interpolator. Slowing speed of Viewpager controller in android I had used a linear interpolator when asked in the construtor like…
Rohit Sharma
  • 13,787
  • 8
  • 57
  • 72
3
votes
2 answers

scipy.interpolate.LinearNDInterpolator not producing desired functionality

I am not getting the desired 2D linear interpolation functionality with LinearNDInterpolator. The following piece of code is trying to do an interpolation between the 4 knot points (0,0), (1,0), (0,1), (1,1). interp2d gives me the expected…
2
votes
1 answer

SQL linear interpolation based on lookup table

I need to build linear interpolation into an SQL query, using a joined table containing lookup values (more like lookup thresholds, in fact). As I am relatively new to SQL scripting, I have searched for an example code to point me in the right…
Jon
  • 21
  • 3
2
votes
2 answers

Resampling data from 6 min to 5min with nan

I have a linear interpolation problem with nans in my data. I have instantaneous measurements that I want to resample from 6 min intervals to 5 min intervals. df = pd.DataFrame(zip(['10:00','10:06','10:12','10:18','10:24'], [1,…
pyaj
  • 545
  • 5
  • 15
2
votes
1 answer

Optimal way to take a network of nodes and interpolate missing values

I have an example data frame below: data = [ [1, 2, 100, 4342], [3, 4, 100, 999], [5, 6, 500, 4339], [4, 5, 300, 999], [12, 13, 100, 4390], [6, 7, 600, 4335], [2, 3, 200, 4341], [10,11, 100, 4400], [11,12, 200,…
rweber
  • 132
  • 7
2
votes
1 answer

Time series interpolation: monthly data to certain day frequency data

I have time series data containing monthly observations. I now want the given interpolate monthly values (preferred linear, cubic is fine) according to a data sequence (for eg. 15-day sequence). The intermediate goal should be to create a data frame…
kl40
  • 53
  • 7
2
votes
1 answer

What's the relationship between the barycentric coordinates of triangle in clip space and the one in screen space

Suppose I have a triangle say(PC0,PC1,PC2), and its barycentric coordinates is((1,0),(0,1),(0,0)), they are all in clip space. And now I want calculate the interpolated barycentric coordinates in screen space, how can I do that so it could be…
Mirocos
  • 43
  • 6
2
votes
3 answers

How to Interpolate Lat/Long Points (Route) between Two Lat Long Points

Lets say we have two addresses that are provided. I grabbed two random ones from the web below: # Google headquarters: google_lat = 37.422131 google_lon = -122.084801 # Apple headquarters apple_lat = 37.33467267707233 apple_lon =…
2
votes
1 answer

How to fill missing field values with linear interpolation?

I have a collection of documents representing values at specific dates. Some of those dates don't have a value (the field can be missing or set to null). I'd like to fill in those missing or undefined values by linearly interpolating with the…