Message Boards Message Boards

0
|
1220 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Advanced Interpolation Function

Posted 10 years ago
Hello,

Is there an interpolation function that can accept a 2-dimensional array of data (in my case, it will be comprised of a series of dates and corresponding dollar values) and return the interpolated values in between, along with a graphical rendering of the output?  For example:

Input:
(1/1/14, $2.50),(1/5/14, $2.53),(3/7/14, $3.75),etc...

Output:
1/1/14, $2.50
1/2/14, $2.51
1/3/14, $2.52
1/4/14, $2.52

1/5/14, $2.53
1/6/14, $2.55
....
3/6/14, $3.73
3/7/14, $3.75
etc...

Thank You,
Jesse
POSTED BY: Jesse Aufiero
First, the data would have to be in Mathematica's syntax:

my data = { {{2014,1,1}, 2.50}, {{2014,1,2}, 2.51}... etc }
This can be plotted with DateListPlot, but ...
the function Interpolation won't take that date specification however, so we have to convert it to a simple number. There's a number of ways to do this.
One way is to apply AbsoluteTime to the list which represents the date. 

If you're new to programming with Mathematica, take a look at the Virtual Book for an introduction: http://reference.wolfram.com/mathematica/howto/UseTheVirtualBook.html
POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract