Code covered by the BSD License  

Highlights from
BrokenStickRegression

5.0

5.0 | 1 rating Rate this file 16 Downloads (last 30 days) File Size: 3.16 KB File ID: #29387

BrokenStickRegression

by Peter Nave

 

13 Nov 2010 (Updated 04 Sep 2011)

A line consisting of connected straight sections is fitted to a cloud of data points.

| Watch this File

File Information
Description

A line of connected straight sections is fitted to a 2D-cloud of data points. The sections are described by the coordinates of their endpoints. No toolbox required.

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
01 Sep 2011 Atul Ingle

Really well written code, exactly what I was looking for.

I want to specify only one breakpoint in between the end points -- something this code doesn't allow. But I guess it's an easy modification that I can make if needed.

14 Sep 2011 Atul Ingle

Is there a literature reference for the method used in the code?

15 Sep 2011 Peter Nave

@ Atui Ingle:
most probably, but I do not know of any; I "invented" the algorithm. The "penalty" method is very old and well known. -- Peter

Please login to add a comment or rating.
Updates
15 Nov 2010

Code shortened by ca. 20%.

02 Dec 2010

Two bugs detected by Carlos Romero fixed (thanks!). Initial trial breakpoints can now be specified. More error checks provided.

05 Dec 2010

Typographical errors corrected

04 Sep 2011

Improved checks on input; allows a single abscissa point as starting breakpoint.

04 Sep 2011

Further simplifications of the algorithm.

Tag Activity for this File
Tag Applied By Date/Time
piecewise linear regression Peter Nave 15 Nov 2010 10:36:11
statistics Peter Nave 15 Nov 2010 10:36:11

Contact us at files@mathworks.com