Rank: 1507 based on 55 downloads (last 30 days) and 2 files submitted
photo

Umberto Picchini

E-mail

Personal Profile:

Ph.D. in Statistics. My researches are mainly devoted to parameter estimation techniques for nonlinear dynamical models with emphasis on stochastic differential equations.

Personal page:
http://www.maths.dur.ac.uk/users/umberto.picchini/

My Stochastic Differential Equations Toolbox for MATLAB can be found at:
http://sdetoolbox.sourceforge.net

Professional Interests:
Stochastic processes, dynamical models, stochastic differential equations, parameter estimation

 

Watch this Author's files

 

Files Posted by Umberto View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
13 Oct 2006 Fast Trapezoidal Integration Similar to TRAPZ but (up to) 16x-times faster. Equally spaced data NOT required. Author: Umberto Picchini integration, quick, mex, fast, trapezoidal 24 3
  • 3.75
3.8 | 4 ratings
20 Apr 2006 Fast Linear Interpolation Performs linear interpolation with a speed acceleration of (up to) 4x. Author: Umberto Picchini interpolation, linear, quick, mex, fast, approximation 31 0
  • 4.0
4.0 | 2 ratings
Comments and Ratings by Umberto
Updated File Comments Rating
30 Oct 2008 comparisons a strategy of classification Author: Marco

Marco, it's not fair for a contributor to rate his/her own programs. Rating is for reviewers: contributors should only comment, reply, discuss on their own submissions. Would you let a boxer give him/herself the score for his/her match? Please be honest with this community. My comment applies to almost all your submissions.

Comments and Ratings on Umberto's Files View all
Updated File Comment by Comments Rating
19 Sep 2008 Fast Trapezoidal Integration Similar to TRAPZ but (up to) 16x-times faster. Equally spaced data NOT required. Author: Umberto Picchini Optican, Lance

trapzf does not allow for unevenly sampled data, even though the comment claims it does. Matlab's trapz does allow for uneven data. To correct this, the following change must be made to the C code of trapzf, here called trapzfu. Note that the speedup on a 64-bit WinXP computer of trapfzu over trapz was about 10-fold. Unrolling the loop in trapzfu2.c provides another 20% improvement in speed.

--- trapzfu.c ------
/* F=trapzfu(X,Y) computes the integral of Y with respect to X using
    the trapezoidal method. X and Y must be vectors of the same length.
    For trapzf to work properly:
    X must be a STRICTLY monotonically increasing vector.
    X does not need to be evenly spaced.
 
    C. Quaia, National Eye Institute, NIH, DHHS
 */

#include "mex.h"

void trapzfu( double *area, double *xv, double *yv, int N) {
        register int i;
        
        *area = 0;
        for (i = 0; i < (N-1); i++) {
                *area = *area + (xv[i+1] - xv[i]) * (yv[i] + yv[i+1]);
        }
        *area = *area / 2;
}

void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
        int N, N1, N2;
        double *area;
        double *xv, *yv ;
        
        N1 = mxGetNumberOfElements(prhs[0]);
        N2 = mxGetNumberOfElements(prhs[1]);
        if (N1 != N2)
                mexErrMsgTxt("Input x and y must have the same length");
        else
                N = N1;
        if (N < 2)
                mexErrMsgTxt("The minimum length is 2");
        
        xv = mxGetPr(prhs[0]);
        yv = mxGetPr(prhs[1]);
        plhs[0] = mxCreateDoubleMatrix(1, 1, mxREAL);
        area = mxGetPr(plhs[0]);
        
        trapzfu(area, xv, yv, N);
}

------------ trapzfu2.c --------
/* F=trapzfu2(X,Y) computes the integral of Y with respect to X using
    the trapezoidal method. X and Y must be vectors of the same length.
    For trapzf to work properly:
    X must be a STRICTLY monotonically increasing vector.
    X does not need to be evenly spaced.

    L. Optican, NEI/NIH/DHHS

 */

#include "mex.h"

void trapzfu2( double *area, double *xv, double *yv, int N) {
        register int i, j,r;
        
        *area = 0;
        i = 0;
        r = (N - 1) % 4;
        for(; i < r; i++) {
                // *area += (xv[i+1] - xv[i]) * (yv[i] + yv[i+1]);
                *area += (xv[i+1] - xv[i]) * (yv[i+1] + yv[i]);
        }
        
        for(; i <= (N-4); i += 4) {
                *area += (xv[i+1] - xv[i]) * (yv[i+1] + yv[i]);
                *area += (xv[i+2] - xv[i+1]) * (yv[i+2] + yv[i+1]);
                *area += (xv[i+3] - xv[i+2]) * (yv[i+3] + yv[i+2]);
                *area += (xv[i+4] - xv[i+3]) * (yv[i+4] + yv[i+3]);
        }
        *area = *area / 2;
}

void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
        int N, N1, N2;
        double *area;
        double *xv, *yv ;
        
        N1 = mxGetNumberOfElements(prhs[0]);
        N2 = mxGetNumberOfElements(prhs[1]);
        if (N1 != N2)
                mexErrMsgTxt("Input x and y must have the same length");
        else
                N = N1;
        if (N < 2)
                mexErrMsgTxt("The minimum length is 2");
        
        xv = mxGetPr(prhs[0]);
        yv = mxGetPr(prhs[1]);
        plhs[0] = mxCreateDoubleMatrix(1, 1, mxREAL);
        area = mxGetPr(plhs[0]);
        
        trapzfu2(area, xv, yv, N);
}

06 Mar 2008 Fast Trapezoidal Integration Similar to TRAPZ but (up to) 16x-times faster. Equally spaced data NOT required. Author: Umberto Picchini hhh, lll

not good

14 Feb 2008 Fast Trapezoidal Integration Similar to TRAPZ but (up to) 16x-times faster. Equally spaced data NOT required. Author: Umberto Picchini prabhu2003, mm

thanks

04 Jul 2007 Fast Linear Interpolation Performs linear interpolation with a speed acceleration of (up to) 4x. Author: Umberto Picchini Nievinski, Felipe

12 Mar 2006 Fast Trapezoidal Integration Similar to TRAPZ but (up to) 16x-times faster. Equally spaced data NOT required. Author: Umberto Picchini baad, sind

Top Tags Applied by Umberto
fast, mex, quick, approximation, integration
Files Tagged by Umberto View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
13 Oct 2006 Fast Trapezoidal Integration Similar to TRAPZ but (up to) 16x-times faster. Equally spaced data NOT required. Author: Umberto Picchini integration, quick, mex, fast, trapezoidal 24 3
  • 3.75
3.8 | 4 ratings
20 Apr 2006 Fast Linear Interpolation Performs linear interpolation with a speed acceleration of (up to) 4x. Author: Umberto Picchini interpolation, linear, quick, mex, fast, approximation 31 0
  • 4.0
4.0 | 2 ratings
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com