Description Usage Arguments Details See Also
View source: R/util-regression.R
break a vector out for continuous piecewise regression (i.e. the fitted segments will join eachother at each end) into a matrix whose row totals are the original values, but whose columns divide the value across a set of bins, so 82 across bins with boundaries c(50,60,65,70,80,90) becomes the row 50,10,5,5,10,2,0, which sums to 82... This is very useful for finding rough change points in thermal response as is expected for buildings with clear setpoints
1 | regressor.piecewise(regressor, bins, diverge = F)
|
regressor |
The single array of regressor values to be broken out into piecewise columns. |
bins |
- numerical arry whose values are the break points defining the piecewise regressors |
diverge |
- Defautl FALSE: Whether the first column contains the distance of the value from the bottom change point (rather than from 0) |
TODO: This can create a column of zeros, which should break the regression so we might need to prune the columns when we're done and keep track of which bins are in play when comparing across regressions
piecewise.regressor
for 'apply' syntax
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.