# commons-issues mailing list archives

##### Site index · List index
Message view
Top
From "Gilles (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-562) "UnivariateRealPeriodicInterpolator"
Date Fri, 22 Apr 2011 22:22:05 GMT
```
[ https://issues.apache.org/jira/browse/MATH-562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13023431#comment-13023431
]

Gilles commented on MATH-562:
-----------------------------

{quote}
Is the idea that the data are assumed to be coming from a periodic function with known period?
{quote}
Yes.

{quote}
Is there any constraint on the number of periods that the sample data is supposed to represent,
or are we assuming that it represents just one period with some points extending before and
after?
{quote}
No, it is just assumed that the underlying time series is periodic with the given period.
However, there might be a problem if more than one period is covered by the sample data: If
there are 2 samples exactly one period apart, they will be mapped to the same point and the
interpolator will throw an exception because "xval" is not strictly increasing...

{quote}
[...] the application is to extend the domain of the interpolating function outside of the
domain determined by the data?
{quote}
Yes.

{quote}
Don't you maybe need two parameters for "extend" (number before beginning of function period
and number after) [...]
{quote}
Why? The "extend" points are there only to avoid that the interpolating algorithm fails because
it would lack the required number of points when trying to interpolate at the ends of the
interval: For example, the linear interpolation needs one point before and one point after
the interpolated point but the latter won't exist when x > xval[xval.length - 1]. Hence,
we replace "xval" with an _extended_ "xvalP" such that
{code}
xvalP[xvalP.length - 1] = xval[0] + period
{code}

{quote}
Don't you [...] maybe even [need] two "offset" parameters (distance between beginning of the
period and the first "interior" domain value and between last "interior" domain value and
end of the period)?
{quote}
I'm not sure that we mean the same thing with that "offset". I only meant it as the "zero-point"
of the periodic signal.

I didn't get the "fitness" idea. Maybe that you target something more powerful than what I

> "UnivariateRealPeriodicInterpolator"
> ------------------------------------
>
>                 Key: MATH-562
>                 URL: https://issues.apache.org/jira/browse/MATH-562
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>             Fix For: 3.0
>
>
> It would be an interpolator implementation that assumes that the data to be interpolated
is periodic. Thus values that are outside of the range can be passed to the interpolation
function:
> They will be wrapped into the initial range before being passed to the class that actually
computes the interpolation.
> The constructor prototype would be:
> {code}
> /**
>  * Builds an interpolator.
>  *
>  * @param interpolator Interpolator.
>  * @param period Period.
>  * @param offset Offset.
>  * @param extend Number of points to be appended at the beginning and
>  * end of the sample arrays in order to avoid interpolation failure at
>  * the (periodic) boundaries of the orginal interval. The value is the
>  * number of sample points which the original {@code interpolator} needs
>  * on each side of the interpolation point.
>  */
> public UnivariateRealPeriodicInterpolator(UnivariateRealInterpolator interpolator,
>                                           double period,
>                                           double offset,
>                                           int extend) {
>     // ...
> }
> {code}
> Would it be useful to have that in CM?

--
This message is automatically generated by JIRA.