# Questions tagged [piecewise-linear]

The tag has no usage guidance.

63 questions
Filter by
Sorted by
Tagged with
1 vote
36 views

### Fit points with a continuous, piecewise linear function with minimum number of points for each segment

I have a set of two-dimensional data points that I want to fit with a continuous piecewise linear function with one break point. However, I want each of the two segments to be supported by a minimum ...
• 13
1 vote
38 views

### Latent growth curve with three latent variable and piecewise linear regression

I already heard about piecewise linear regression but I have no experience with latent growth curves. I came across it in that paper. As far as I understood based on Figure 1 (observed sample means) ...
• 189
63 views

### lsmeans for a piecewise linear mixed-effects model on r

I am trying to figure out how to obtain lsmeans for a piecewise linear mixed-effects model (fitted with the nlme package) with random intercepts and slopes. My data represent math scores from a group ...
• 1
521 views

### How to detect trend changes in noise time series?

wget -q -O- https://i.stack.imgur.com/xczQ1.gif | tail -c +43 R> with(f, plot(x, log10(y), type='l')) I have a series whose ...
• 512
61 views

### Formula for cyclic continuous piecewise Regression

I am interested in running a piecewise linear regression in R. I would like to specify the model matrix for the piecewise regression myself so I am not interested in using a pre-coded solution from a ...
• 293
166 views

### Is there a formal test for model comparison between polynomial regression and piecewise/segmented regression? (i.e., are these models nested?)

I am interested in comparing three models a linear regression model: mod_linear <- lm (dv ~ iv) a polynomial regression model: mod_polynomial <- lm (dv ~ iv + I(iv^2)) a one-breakpoint ...
• 87
229 views

### Is there a "canonical" probabilistic version of the step function?

Step and switch-like functions can be thought of as deterministic switches at some threshold, so smooth sigmoidal-like functions describe that switch with uncertainty around that value. The machine ...
• 11
1 vote
303 views

### Generalized Linear Model in a Piecewise SEM?

I have applied a piecewise structural equation model to my data using generalised linear models. I have used the glm() R function along with psem in the "piecewiseSEM" R package. It has ...
• 131
243 views

### How to fit a piecewise assembly of nonlinear functions?

I am trying to model vegetation spectral signatures (grey lines) using a two-part piecewise function (black dotted lines). In it, I am trying to use only a few points (red dots) to fit a linear (first ...
• 51
260 views

### How do you fix one slope coefficient in an interaction term?

hoping someone can help me with what (on the face of it) appears to be a relatively simple problem but which I can't current code out. Basically, I would like to fit a GLM in R with a simple two-way ...
1 vote
616 views

### In hierarchical regression, the first step is not significant but later steps are

I ran a hierarchical regression comparing different models, in order of complexity. The first step was not significant (the simplest model vs a more complex model). However the next two steps were ...
• 87
1 vote
72 views

### Select model in piecewise regression

How could we compare models fitted with piecewise regression that have different breakpoints? I used the code written here. In the example below, the "best" model, i.e. minimizing the residuals is ...
70 views

### Simple algorithm to detect change point in time series

Apologies if this question has already been asked, but a lot of similar questions are regarding R or complex algorithms that I don't want. I have numerous 2-dimensional time series, eacch plotting ...
554 views

### How to do a discontinuos segmented logistic regression in R?

I'm trying to do a discontinuous segmented logistic regression, something like this: https://imgur.com/ON4k1hy . The 6 breaking points are predetermined from domain knowledge. Unfortunately my ...
72 views

• 11
1 vote
50 views

### Censoring linearly splined predictor in regression

I'm developing a logistic regression where one of the independent variables has a non-linear relationship to the probability of the event occurring. I have created linear splines based on this ...
• 151
704 views

### Position of knots in piecewise linear regression as 'random effects'

TL;DR: Is there some way I can do 'random knots' (where the position of the knot varies according to some group, not the number)? Full question: After obtaining experimental data, I find that one of ...
677 views

### Piecewise regression vs multiple models

Say you have a piecewise regression model with one breakpoint. Is there any difference between that and just creating a separate simple regression model for each segment of the IV?
• 295
1 vote
435 views

### Understanding the Math of Segmented and Splines2 packages.

I was trying to teach myself the math behind what produces the slope and intercept of a segmented variable in the segmented package using the plant data set. My ...
• 215
257 views

### Looking for references - ReLU neural networks vs Fitting continuous piecewise linear function

ReLU activated neural networks with a linear output are continuous piecewise linear functions (CPLF). There are technuques to fit CPLF functions, so comparison of those methods seems very natural, ...
• 670
1 vote
208 views

### How to adjust the parameters of a Piecewise regression model in Matlab?

I have an existent piecewise regression model correlating the parameters X and Y as follows: If X<0.1, then Y=0.744. If X>=0.1 & X<=0.8, then Y=0.842-0.977*X. If X>0.8, then Y=0.06. The ...
1 vote
167 views

### Finding an inflection point between two conditions

The figure below illustrates a sample data from a numerosity estimation experiment with an uncalibrated (i.e., spontaneous) estimation condition (blue) and a calibrated estimation condition (orange). ...
• 73
1 vote
110 views

• 421
72 views

### piecewise regression into a for loop [closed]

I´m trying get a piecewise regression. ...
• 3
465 views

### Model with piecewise-linear functions

I have a model which is of the following deterministic form: Y = A + B + C A, B and C are piecewise-linear functions of a, b and c, which are macroeconomic variables. I have the values (nodes, ...
• 31
1 vote
407 views

179 views

### Weighted piecewise regression to model proportion?

I was trying to model the relationship between utilization of service (from 0 to 1) and travel distance. First I binned travel distance by each 20 km and then calculate utilization for each bin (count ...
• 145