Broken stick regression and find change point
Show older comments
Hi!
I've got two vectors, one with data on outside temperature, and the other one is heat supply for a building. I can scatter plot the vectors to get a visual of how the heat supply increases with lower temperature (Celsius). For higher temperature heat is only needed for water and therefore there is no longer a dependency between increasing temperature and lowered heat demand. As can be seen in the picture below

I would like to find the change point, (the temperature where building heating is starting to be needed) and perform a segmented regression (broken stick), one line for the temperature dependent part, and one line for the independent. Is there a way to do that in for example the curve fitting app? Or how do i write it in code?
I know about the function Findchangepts, but it only works with 1 vector, not 2, and not with a matrix.
3 Comments
John D'Errico
on 26 Oct 2017
Edited: John D'Errico
on 26 Oct 2017
So, the upper "line" (above the break) is really a constsnt function, with the level unknown, but a zero slope?
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
