movfun: movmin

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

movfun: movmin

Juan Pablo Carbajal-2
Dear all,

A first version of movmin is implemented in the movfun package

https://bitbucket.org/KaKiLa/movfun/src

A review is now in order, if anyone has time to do it. When this
function is polished, all the other mov* functions are implemented the
same way.

The critical points (check issues) are parsing of arguments (can't
check with the other software), and compatibility (name of options,
window length and asymmetry, etc...). Related to the later, note how I
named the boundary condition (now called Endpoints) arbitrarily,
without know what the other software did, I can fix that now.

Thanks

Reply | Threaded
Open this post in threaded view
|

Re: movfun: movmin

Rik-4
On 10/18/2018 09:00 AM, [hidden email] wrote:
Subject:
movfun: movmin
From:
Juan Pablo Carbajal [hidden email]
Date:
10/17/2018 03:48 PM
To:
Maintainers GNU Octave [hidden email]
List-Post:
[hidden email]
Precedence:
list
MIME-Version:
1.0
Message-ID:
[hidden email]
Content-Type:
text/plain; charset="UTF-8"
Message:
1

Dear all,

A first version of movmin is implemented in the movfun package

https://bitbucket.org/KaKiLa/movfun/src

A review is now in order, if anyone has time to do it. When this
function is polished, all the other mov* functions are implemented the
same way.

The critical points (check issues) are parsing of arguments (can't
check with the other software), and compatibility (name of options,
window length and asymmetry, etc...). Related to the later, note how I
named the boundary condition (now called Endpoints) arbitrarily,
without know what the other software did, I can fix that now.

Thanks


Also see bug #48774 (https://savannah.gnu.org/bugs/?func=detailitem&item_id=48774) where the request for moving versions of the statistics functions was made.  This bug report can be used to update and track progress as you add implementations. 

I glanced at movfun and I saw what looked like a a 2-deep nested for loop (one over columns and one over the number of elements not subject to boundary effects).  Those will be slow in an interpreted language like Octave.  You may need to write movfun in C++ if it needs to keep the for loops.  Or maybe there is a way to use clever bits of indexing.

--Rik

Reply | Threaded
Open this post in threaded view
|

Re: movfun: movmin

Juan Pablo Carbajal-2
Hi Rik,

Thanks for the review

The loop over columns is expected to be small, e.g. if you have a single signal ncols == 1 (I can't understand why people put sliding window functions in a statistics package that has all methods implemented for independent samples, movfun doesn't belong there and is a signal processing tool, but well... I guess this is inheritance again...).
Hence for a single signal there is only 1 loop which is over the columns of an indexed matrix (see reshapemod). I have tested the function with large signals and did not see any justification to write lower level code (well, assuming reshapemod fits in memory)

Example

x = randn (1e6, 1);
tic;y = movfun(@min, x, 5);toc
Elapsed time is 0.067837 seconds.

On Thu, Oct 18, 2018 at 10:08 PM Rik <[hidden email]> wrote:
On 10/18/2018 09:00 AM, [hidden email] wrote:
Subject:
movfun: movmin
From:
Juan Pablo Carbajal [hidden email]
Date:
10/17/2018 03:48 PM
To:
Maintainers GNU Octave [hidden email]
List-Post:
[hidden email]
Precedence:
list
MIME-Version:
1.0
Message-ID:
[hidden email]
Content-Type:
text/plain; charset="UTF-8"
Message:
1

Dear all,

A first version of movmin is implemented in the movfun package

https://bitbucket.org/KaKiLa/movfun/src

A review is now in order, if anyone has time to do it. When this
function is polished, all the other mov* functions are implemented the
same way.

The critical points (check issues) are parsing of arguments (can't
check with the other software), and compatibility (name of options,
window length and asymmetry, etc...). Related to the later, note how I
named the boundary condition (now called Endpoints) arbitrarily,
without know what the other software did, I can fix that now.

Thanks


Also see bug #48774 (https://savannah.gnu.org/bugs/?func=detailitem&item_id=48774) where the request for moving versions of the statistics functions was made.  This bug report can be used to update and track progress as you add implementations. 

I glanced at movfun and I saw what looked like a a 2-deep nested for loop (one over columns and one over the number of elements not subject to boundary effects).  Those will be slow in an interpreted language like Octave.  You may need to write movfun in C++ if it needs to keep the for loops.  Or maybe there is a way to use clever bits of indexing.

--Rik