Questions tagged [piecewise-linear]

The tag has no usage guidance.

1
vote
0answers
40 views

Finding the distribution of a piecewise function of a Gamma random variable

Let random variable $X \sim \text{Gamma}(\alpha,\beta)$. I want to derive the distribution of $Y$, where: $$ Y = \left\{ \begin{array}{ll} a X - k & \quad X \geq \frac{k}{a} \...
1
vote
1answer
36 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 ...
0
votes
0answers
34 views

How to test for differences between model parameter estimates for different datasets?

Description of analysis I am considering grain yield response to available nitrogen with a linear-plateau piecewise regression model for two different field studies, denoted by the variable ...
3
votes
0answers
145 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 ...
1
vote
2answers
139 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?
1
vote
0answers
247 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 ...
3
votes
0answers
163 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, ...
1
vote
1answer
133 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
0answers
107 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). ...
0
votes
1answer
98 views

How to estimate parameters of a (almost) linear model from unpaired observations?

I have this model: $a_i=mod(\lfloor i\cdot T+Normal(0,\sigma_a)\rfloor,Q)$ $b_i=mod(\lfloor a_i+D+Normal(0,\sigma_b)\rfloor,Q)$ with $i=1..N$ $N\in\mathbb{N}$ $Q\in\mathbb{N}$ $T\in\mathbb{R}, ...
1
vote
0answers
61 views

segmented piece wise linear regression problem?

I want to get a piecewise linear regression model with the function "segmented". ...
0
votes
1answer
226 views

What is the difference between linear interpolation and piece-wise linear interpolation?

I'm familiar with linear interpolation. I tried to search some details about piece-wise linear interpolation but failed to understand this method. Can someone explain the difference between these two ...
0
votes
2answers
1k views

Sampling from a piecewise linear probability density function

I have a pdf modelled as a piecewise linear function that I can represent as the sequence of pairs of real numbers standing for the points in the of the piecewise line: $\{(x_{1}, y_{1}), \dots, (x_{n}...
0
votes
1answer
50 views

piecewise regression into a for loop [closed]

I´m trying get a piecewise regression. ...
0
votes
0answers
311 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, ...
1
vote
1answer
203 views

How to find the best piecewise-smooth fit

I have data points $(\theta,y)$ that when plotted in a x-y (with $\theta$ being the x) graph can be fit by the curve $$y=-\alpha-\frac{\beta}{\cos(\theta_{0}-\theta)}$$ i.e. I can find $\alpha, \...
3
votes
1answer
1k views

Test for the significance of the effect of an intervention in a time series

I am looking for the best approach to test for the significance of the effect of an intervention that occurred at a known time on a time series data. Using a toy dataset as an example, I have come up ...
5
votes
3answers
172 views

“Branching Stick” Regression

With piecewise, or so-called broken-stick regression it is possible to fit two lines to data, But what if I wanted to fit data to two lines, one main and one branch which connects to a primary line ...
1
vote
0answers
345 views

Can a Piecewise Linear Regression Approximate a Neural Network?

I have a piecewise linear regression model that performs quite well (CVd) on subsets of a small data set (Ns between 30 and 90 for the subsets, with a total of 222 records). So there are separate ...
1
vote
2answers
91 views

Estimating failure-point when failed datapoints are unobservable

I have several datasets of two variables, y and time. Datapoints are objects subject to physical wear, and wear-rates are (roughly) constant over the life of the objects. y is defined as the ...
0
votes
2answers
2k views

Determine breakpoints in time series data where values change significantly

Given the following chart of data: which represents duration metrics gathered at absolute times, I am trying to determine when/if any of the values exhibit a jump in durations. In the example chart, ...
4
votes
1answer
747 views

Gaussian Process Regression for piecewise linear response functions

I am performing Gaussian Process Regression (without noise) for response functions which are piecewise linear. My question: Does there exist a covariance function, such that sample paths from a ...
1
vote
3answers
2k views

Piecewise regression with constraints

I want to make a piecewise linear regression in R. I have a large dataset with 3 segments where I want the first and third segment to be without slope, i.e. parallel to x-axis and I also want the ...
2
votes
1answer
97 views

Transforming TS for better fit

I'm trying to find transformation for my explanatory variable (outside temperature) to better explain heating power usage. I have data from one year here. ...
6
votes
2answers
906 views

R - how to get standard error for a breakpoint/parameter in a piecewise regression

I'm new to asking questions here, so I hope this is a reasonable place for this. I am trying to fit a piece-wise regression. I expect my response (y) to increase from x0 to somewhere along x, then to ...
2
votes
0answers
166 views

Change of variables with a continuous but not differentiable mapping

Suppose that Y is a continuous random variable with a density function $f_{Y}(y)$. We transform $Y$ by the following mapping \begin{equation} Y^{*} = \left \{ \begin{array}{ll} \alpha Y + \beta &...
1
vote
0answers
176 views

Piecewise linear / spline regression: explaining changes in standard error

I have a model to estimate the effect of gas prices on a dependent variable Y. In the piecewise linear regression model (Gujarati 1995, p.519), I included a dummy ...
1
vote
2answers
1k views

Testing slopes in multivariate adaptive regression splines (MARS/earth)

I am using the earth package in R to estimate the number of breakpoints in a curve. There is only a single predictor. I was ...
5
votes
2answers
2k views

Generate random number from a piecewise exponential distribution

I would like to generate a random number from a piecewise exponential distribution. I consider that the time-scale is divided in $J$ intervals with bounds $(s_{j-1},s_j]$, for $j=1,...,J$, and ...
2
votes
0answers
125 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 ...
2
votes
0answers
992 views

Is segmented (piecewise) regression possible with a dichotomous dependent variable?

I have created a model of American cities with a dichotomous Y variable using logistic regression. I have theoretical reasons to believe that the model will differ significantly between larger and ...
2
votes
1answer
1k views

Piecewise regression

I have a time series where I want to fit a piecewise regression equation. Now the problem occurs when I try to fit equations of different degree in different segments of the series. Please provide me ...
2
votes
1answer
147 views

Are the slopes of two segmented lines important in recognition of a breakpoint?

I have found one breakpoint in my linear regression but the slope of two lines have the same decreasing slope, I was wondering if the change of the slope is necessary in recognition of breakpoints.
2
votes
1answer
667 views

Adding additional terms to a piecewise regression

I am exploring the probability of flight in a seabird (1=flight, 0=no flight) using binomial logistic regression. My predictors are distance to a disturbance (continuous), hour of the day (continuous),...
2
votes
0answers
666 views

Estimating break point in a broken stick / piecewise linear model for one variable while including other as model terms

I am interested in estimating a break point in response to one explanatory variable, while also including other variables as terms in the linear model. One reason to include additional terms is to ...
4
votes
2answers
5k views

Correct way to compare two (very) different regression models?

I'm working with some piecewise linear regression models, and I'd like to compare their predictions with those produced by multiple (weighted) linear regression models. Both models describe the same ...
6
votes
3answers
3k views

Piecewise linear regression with knots as parameters

I would like to fit a piecewise linear regression with knots as parameters. I would like to know what's the best solution. Should I run a set of regressions with all the possible knots and choosing ...
4
votes
0answers
104 views

Parametric segmented or piecewise regression with heteroscedastic errors

I am fitting longitudinal data with an increase in variance over time. The standard physiological model is a bi- or tri-linear model with variable breakpoints. The estimated parameters are used to ...
9
votes
2answers
3k views

Standard error of slopes in piecewise linear regression with known breakpoints

The situation I have a dataset with one dependent $y$ and one independent variable $x$. I want to fit a continuous piecewise linear regression with $k$ known/fixed breakpoints occurring at $(a_{1}, ...
3
votes
0answers
635 views

How to find a breakpoint for each ID in a linear regression model with R?

I have some repeated measures with 196 individuals and some of my regressions have a plateau. So I want to characterize this with an eventual breakpoint for each ID. Example: subset of my personal ...
1
vote
2answers
816 views

Estimating two break points in a broken stick model with random effects in R

Five months ago, jbowman posted a very useful answer to estimate the break point in a broken stick model with random effects in R. I never use "computing" like ...
1
vote
2answers
1k views

How to determine if predictor in piece-wise linear regression is significant?

I saw a comment by mpiktas that "The sum of two independent t-distributed random variables is not t-distributed". Is it then of any known distribution? Actually, I am using piece-wise linear ...
2
votes
1answer
465 views

Bootstrap distribution of a breakpoint not centered around its parameter estimate

I estimated the breakpoint for a piecewise linear model (one intercept, two slopes that meet at the breakpoint) by minimizing the deviance using an optimizer (optim ...
5
votes
1answer
16k views

How to use segmented package to fit a piecewise linear regression with one breakpoint?

Sorry to ask a stupid question, but I have problems using the package segmented. My linear regression is very simple, between offer and demand: linearModel <- lm(demand~offer) And so should be ...
13
votes
4answers
11k views

Estimating the break point in a broken stick / piecewise linear model with random effects in R [code and output included]

Can someone please tell me how to have R estimate the break point in a piecewise linear model (as a fixed or random parameter), when I also need to estimate other random effects? I've included a toy ...