Mathematical Computation of Piecewise Linear Regression with Endogenous Segmentation for Accurate Data-Based Model Building: An Example of the Phillips Curve
Abstract
1. Introduction
2. Methodology and Data
2.1. Linear Regression Model for All Samples
2.2. Nonlinear Regression Model for All Samples
2.3. Computational Piecewise Linear Regression (CPLR) Method
2.3.1. Stage 1: Sequential Segment Identification
2.3.2. Stage 2: Optimal Minimum Segment Size Selection
2.3.3. Theoretical Property of the Breakpoint Detection Rule
2.4. Sample Description
2.4.1. Data and Sample Description
2.4.2. Data Sources and Definitions
- Inflation rate: it is measured by the annual percentage change in the consumer price index (CPI), reflecting the general price level fluctuation.
- Unemployment rate: it is defined as the harmonized unemployment rate, representing the proportion of the labor force that is unemployed and actively seeking employment, standardized across the G7 countries to ensure cross-sectional comparability.
2.4.3. Sample Design and Data Characteristics
2.4.4. Descriptive Statistics
3. Computation Results
3.1. Linear Model Benchmark
3.2. Nonlinear Regression Results
3.3. Computational Piecewise Regression Results
3.3.1. Cross-Country Structural Heterogeneity
3.3.2. State-Dependent Slope Dynamics and Sign Reversals
3.3.3. Model Performance and Adaptive Parsimony
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A. Pseudocode and Mathematical Formulation for the CPLR Method
Appendix A.1. Algorithm of the Pseudocode Procedure
| 1 Sort observations by unemployment rate: u1 ≤ u2 ≤ … ≤ un 2 Set minimum segment size k (initially k ≥ 5) 3 Initialize starting index: i ← 1 4 while i ≤ n − k + 1 do 5 Set current segment size: kin ← k 6 Estimate linear regression using observations (i, …, i + kin − 1) 7 Compute R2(i, kin) 8 while (i + kin ≤ n) do 9 Estimate regression using expanded sample (i, …, i + kin) 10 Compute R2(i, kin + 1) 11 if R2(i, kin + 1) ≥ R2(i, kin) then 12 kin ← kin + 1 13 Update R2(i, kin) 14 else 15 Breakpoint detected 16 Record segment (i, …, i + kin − 1) 17 i ← i + kin 18 Exit inner loop 19 end if 20 end while 21 end while |
| 22 For k = 5, 6, 7, … do 23 Apply Stage 1 segmentation 24 Compute global RMSE(k) across all observations 25 end for 26 Select optimal minimum segment size k* = arg min RMSE(k) 27 Return segmentation obtained with k* |
Appendix A.2. Mathematical Formulation of Segments
Appendix B. Comparative Analysis of CPLR and Complexity-Adjusted Selection Criteria (AICc)
| Country | Linear Regression | Nonlinear Regression | CPR Method |
|---|---|---|---|
| US | 24.180 | 12.393 * | 28.982 |
| UK | 32.263 | 23.489 * | 39.81 |
| CA | 19.006 | 7.200 * | 30.897 |
| JP | −9.804 * | −5.237 | 13.266 |
| GE | 26.725 * | 27.876 | 62.952 |
| IT | 42.444 | 44.442 * | 73.777 |
| FR | 1.714 | −8.336 * | 23.663 |
| Country | Linear Regression | Nonlinear Regression | CPR Method |
|---|---|---|---|
| US | 0.078 | 0.448 * | 0.173 |
| UK | 0.027 | 0.360 * | 0.309 |
| CA | 0.025 | 0.417 * | 0.207 |
| JP | 0.423 | 0.424 | 0.711 * |
| GE | −0.012 | 0.092 | 0.236 * |
| IT | 0.046 | 0.121 | 0.382 * |
| FR | 0.059 | 0.405 | 0.500 * |
Appendix C. Displaying the Optimal Sample Size Where the R-Squared Values Change in the First Stage
| Country | Optimal k (k*) | k(Optimal − 1) | k(Optimal) | k(Optimal + 1) |
|---|---|---|---|---|
| US | 14 | 1.323 | 1.322 | 1.411 |
| UK | 8 | 1.474 | 1.336 | 1.445 |
| CA | 7 | 1.173 | 1.162 | 1.255 |
| JP | 5 | - | 0.581 | 0.696 |
| GE | 5 | - | 1.263 | 1.295 |
| IT | 6 | 1.660 | 1.496 | 1.888 |
| FR | 5 | - | 0.719 | 0.803 |
| Country (k*) | Segment Range | Counts (k) | R2(k − 1) | R2(k) | R2(k + 1) |
|---|---|---|---|---|---|
| US (14) | 3.698~5.366 | 14 | 0.141 | 0.246 | 0.096 |
| 5.415~9.768 | 18 | - | - | - | |
| UK (8) | 3.700~5.025 | 10 | 0.440 | 0.441 | 0.432 |
| 5.075~5.975 | 8 | 0.314 | 0.113 | 0.022 | |
| 6.175~8.125 | 9 | 0.589 | 0.614 | 0.476 | |
| 8.600~10.400 | 5 | - | - | - | |
| CA (7) | 5.300~6.467 | 7 | 0.598 | 0.577 | 0.480 |
| 6.758~7.192 | 7 | 0.597 | 0.352 | 0.070 | |
| 7.217~8.450 | 10 | 0.281 | 0.506 | 0.335 | |
| 9.117~11.400 | 8 | - | - | - | |
| JP (5) | 2.100~2.500 | 5 | 0.705 | 0.570 | 0.108 |
| 2.600~2.892 | 5 | 0.908 | 0.593 | 0.467 | |
| 3.116~3.592 | 6 | 0.614 | 0.819 | 0.119 | |
| 3.841~4.717 | 10 | 0.450 | 0.556 | 0.498 | |
| 4.716~5.375 | 6 | - | - | - | |
| GE (5) | 2.975~4.367 | 8 | 0.277 | 0.295 | 0.261 |
| 4.708~6.567 | 6 | 0.657 | 0.841 | 0.222 | |
| 6.575~7.859 | 5 | 0.577 | 0.278 | 0.191 | |
| 8.008~9.450 | 8 | 0.026 | 0.153 | 0.027 | |
| 9.675~11.284 | 5 | - | - | - | |
| IT (6) | 6.150~8.050 | 6 | 0.221 | 0.122 | 0.085 |
| 8.075~8.542 | 6 | 0.522 | 0.572 | 0.185 | |
| 8.791~9.934 | 6 | 0.045 | 0.173 | 0.121 | |
| 10.050~11.184 | 7 | 0.094 | 0.259 | 0.117 | |
| 11.206~12.825 | 7 | - | - | - | |
| FR (5) | 7.316~8.034 | 5 | 0.787 | 0.838 | 0.701 |
| 8.433~8.850 | 5 | 0.129 | 0.056 | 0.055 | |
| 8.883~9.217 | 5 | 0.675 | 0.070 | 0.051 | |
| 9.275~9.759 | 5 | 0.455 | 0.271 | 0.103 | |
| 10.066~10.642 | 5 | 0.045 | 0.705 | 0.055 | |
| 11.316~12.400 | 7 | - | - | - |
References
- Golden, R.M.; Henley, S.S.; White, H.; Kashner, T.M. Consequences of Model Misspecification for Maximum Likelihood Estimation with Missing Data. Econometrics 2019, 7, 37. [Google Scholar] [CrossRef]
- Phillips, A.W. The Relation between Unemployment and the Rate of Change of Money Wage Rates in the United Kingdom, 1861–1957. Economica 1958, 25, 283–299. [Google Scholar] [CrossRef]
- Samuelson, P.A.; Solow, R.M. Analytical Aspects of Anti-inflation Policy. Am. Econ. Rev. 1960, 50, 177–194. [Google Scholar]
- Ball, L.; Mazumder, S. A Phillips Curve with Anchored Expectations and Short-term Unemployment. J. Money Credit Bank. 2019, 51, 111–137. [Google Scholar] [CrossRef]
- Eser, F.; Karadi, P.; Lane, P.R.; Moretti, L.; Osbat, C. The Phillips Curve at the ECB; European Central Bank Working Paper Series NO2044; European Central Bank: Frankfurt am Main, Germany, 2020. [Google Scholar]
- Cristini, A.; Ferri, P. Nonlinear Models of the Phillips Curve. J. Evol. Econ. 2021, 31, 1129–1155. [Google Scholar] [CrossRef]
- Ho, S.Y.; Iyke, B.N. Unemployment and Inflation: Evidence of a Nonlinear Phillips Curve in the Eurozone; MPRA Paper No. 87122; University Library of Munich: Munich, Germany, 2018; Available online: https://ideas.repec.org/p/pra/mprapa/87122.html (accessed on 10 April 2025).
- Gagnon, J.E.; Collins, C.G. Low Inflation Bends the Phillips Curve; Working Paper No. 19-6; Peterson Institute for International Economics: Washington, DC, USA, 2019. [Google Scholar]
- Nalewaik, J. Non-Linear Phillips Curves with Inflation Regime-Switching; Working Paper No. 2016-78; FEDS: Washington, DC, USA, 2016. [Google Scholar]
- Fendel, R.; Lis, E.M.; Rülke, J.C. Do Professional Forecasters Believe in the Phillips curve? Evidence from the G7 Countries. J. Forecast. 2011, 30, 268–287. [Google Scholar] [CrossRef]
- Popescu, C.C.; Diaconu, L. Inflation–Unemployment Dilemma. A Cross-Country Analysis. Sci. Ann. Econ. Bus. 2022, 69, 377–392. [Google Scholar] [CrossRef]
- Zhang, L. Modeling the Phillips Curve in China: A Nonlinear Perspective. Macroecon. Dyn. 2017, 21, 439–461. [Google Scholar] [CrossRef]
- Eliasson, A.C. Is the Short-Run Phillips Curve Nonlinear? Empirical Evidence for Australia, Sweden and the United States; Working Paper Series, No. 124; Sveriges Riksbank: Stockholm, Sweden, 2001. [Google Scholar]
- Forbes, K.J.; Gagnon, J.E.; Collins, C.G. Low Inflation Bends the Phillips Curve Around the World; Working Paper No. 29323; NBER: New York, NY, USA, 2021. [Google Scholar]
- Hall, T.E.; Hart, W.R. The Samuelson-Solow Phillips Curve and the Great Inflation. Hist. Econ. Rev. 2012, 55, 62–72. [Google Scholar] [CrossRef]
- Hoover, K.D. The Genesis of Samuelson and Solow’s Price-Inflation Phillips Curve; Working Paper No. 2014-10; CHOPE: Singapore, 2014. [Google Scholar]
- Smith, S.C.; Timmermann, A.; Wright, J.H. Nonlinear Phillips Curves; Notes No. 2024-09-04-1; FEDS: Washington, DC, USA, 2024; Available online: https://ideas.repec.org/p/fip/fedgfn/2024-09-04-1.html (accessed on 17 September 2025).
- Coulombe, P.G. A Neural Phillips Curve and a Deep Output Gap. J. Bus. Econ. Stat. 2025, 43, 669–683. [Google Scholar] [CrossRef]
- Coulombe, P.G. The Macroeconomy as a Random Forest. J. Appl. Econ. 2024, 39, 401–421. [Google Scholar] [CrossRef]
- McGee, V.E.; Carleton, W.T. Piecewise Regression. J. Am. Stat. Assoc. 1970, 65, 1109–1124. [Google Scholar] [CrossRef]
- Caporale, G.M.; Gil-Alana, L.A.; Poza, C. Inflation in the G7 Countries: Persistence and Structural Breaks. J. Econ. Financ. 2022, 46, 493–506. [Google Scholar] [CrossRef]
- Brodsky, B.E.; Darkhovsky, B.S. Applications of Nonparametric Change-point Detection Methods. In Nonparametric Methods in Change-Point Problems; Springer: Dordrecht, The Netherlands, 1993; pp. 169–182. [Google Scholar]
- Gkiolekas, I.; Papageorgiou, L.G. Piecewise Regression Analysis through Information Criteria Using Mathematical Programming. Expert Syst. Appl. 2019, 121, 362–372. [Google Scholar] [CrossRef]
- Kim, T.; Lee, H. Improved Identification of Breakpoints in Piecewise Regression and Its Applications. arXiv 2024, arXiv:2408.13751. [Google Scholar] [CrossRef]
- Lu, K.P.; Chang, S.T. An Advanced Segmentation Approach to Piecewise Regression Models. Mathematics 2023, 11, 4959. [Google Scholar] [CrossRef]
- Al-zeaud, H.; Al-hosban, S. Does the Phillips Curve Really Exist? An Empirical Evidence from Jordan. Eur. Sci. J. 2015, 11, 253–275. [Google Scholar]
- Hsiao, C.W.; Chan, Y.C.; Lee, M.Y.; Lu, H.P. Heteroscedasticity and Precise Estimation Model Approach for Complex Financial Time-Series Data: An Example of Taiwan Stock Index Futures before and during COVID-19. Mathematics 2021, 9, 2719. [Google Scholar] [CrossRef]
- OECD. Unemployment Rate (Indicator). Available online: https://www.oecd.org/en/data/indicators/unemployment-rate.html (accessed on 19 August 2023).







| Coefficient | Average | Median | Standard Deviation | Skew | Kurtosis | Spearman Correlation |
|---|---|---|---|---|---|---|
| US | 5.907 | 5.528 | 1.669 | 0.823 | 2.883 | −0.203 |
| UK | 6.309 | 5.575 | 1.873 | 0.606 | 2.259 | 0.406 |
| CA | 7.809 | 7.471 | 1.592 | 0.751 | 2.830 | −0.340 |
| JP | 3.712 | 3.717 | 1.002 | 0.029 | 1.717 | −0.733 |
| GE | 6.813 | 7.325 | 2.505 | −0.071 | 1.728 | −0.044 |
| IT | 9.640 | 9.642 | 1.731 | −0.098 | 2.155 | −0.312 |
| FR | 9.701 | 9.350 | 1.490 | 0.476 | 2.254 | −0.183 |
| Coefficient | Average | Median | Standard Deviation | Skew | Kurtosis |
|---|---|---|---|---|---|
| US | 2.562 | 2.525 | 1.455 | 5.677 | 4.452 |
| UK | 2.488 | 2.255 | 1.607 | 5.772 | 5.248 |
| CA | 2.084 | 1.886 | 1.305 | 5.988 | 5.058 |
| JP | 0.418 | 0.098 | 1.082 | 0.708 | 3.989 |
| GE | 1.942 | 1.562 | 1.445 | 3.711 | 4.768 |
| IT | 2.483 | 2.067 | 1.902 | 1.487 | 4.098 |
| FR | 1.604 | 1.665 | 1.014 | 4.178 | 4.277 |
| Coefficient | b0 | b1 | R2 | MSE | RMSE |
|---|---|---|---|---|---|
| US | 4.253 | −0.286 | 0.108 | 1.951 | 1.397 |
| UK | 1.177 | 0.208 | 0.059 | 2.512 | 1.585 |
| CA | 3.607 | −0.195 | 0.057 | 1.660 | 1.288 |
| JP | 3.082 | −0.718 * | 0.442 | 0.675 | 0.822 |
| GE | 2.502 | −0.082 | 0.020 | 2.113 | 1.454 |
| IT | 5.411 | −0.304 | 0.076 | 3.453 | 1.858 |
| FR | 3.576 | −0.203 | 0.089 | 0.967 | 0.983 |
| Country | b0 | b1 | R2 | MSE | RMSE | F |
|---|---|---|---|---|---|---|
| US | 44.300 | −41.369 * | 0.466 | 1.168 | 1.081 | 26.157 |
| UK | 44.158 | −41.301 * | 0.381 | 1.652 | 1.285 | 18.443 |
| CA | 30.993 | −28.581 * | 0.435 | 0.993 | 0.997 | 23.139 |
| JP | 7.980 | −5.292 * | 0.443 | 0.673 | 0.821 | 23.854 |
| GE | 1.811 | 0.741 | 0.121 | 1.895 | 1.377 | 4.133 |
| IT | −5.190 | 1.481 * | 0.149 | 3.181 | 1.783 | 5.260 |
| FR | 20.486 | −18.625 * | 0.424 | 0.611 | 0.782 | 22.116 |
| Country (RMSE) | Segment Range | b0 | b1 | R2 | MSE |
|---|---|---|---|---|---|
| US (1.323) | 3.698~5.366 | 10.216 | −1.67 | 0.246 | 2.575 |
| 5.415~9.768 | 5.44 | −0.425 * | 0.255 | 1.13 | |
| UK (1.336) | 3.700~5.025 | 15.684 | −2.979 * | 0.441 | 2.59 |
| 5.075~5.975 | −4.183 | 1.108 | 0.113 | 0.933 | |
| 6.175~8.125 | −2.913 | 0.715 * | 0.614 | 0.212 | |
| 8.600~10.400 | 16.293 | −1.317 | 0.218 | 5.012 | |
| CA (1.162) | 5.300~6.467 | 21.959 | −3.191 * | 0.577 | 1.668 |
| 6.758~7.192 | 17.842 | −2.304 | 0.352 | 2.343 | |
| 7.217~8.450 | 14.795 | −1.648 * | 0.506 | 0.491 | |
| 9.117~11.400 | 0.681 | 0.12 | 0.004 | 3.107 | |
| JP (0.581) | 2.100~2.500 | 12.059 | −4.542 | 0.570 | 0.648 |
| 2.600~2.892 | 22.008 | −7.675 | 0.593 | 0.635 | |
| 3.116~3.592 | −19.291 | 6.052 * | 0.819 | 0.311 | |
| 3.841~4.717 | 6.214 | −1.425 * | 0.556 | 0.174 | |
| 4.716~5.375 | 3.88 | −0.895 | 0.177 | 0.236 | |
| GE (1.263) | 2.975~4.367 | 11.097 | −2.58 | 0.295 | 3.926 |
| 4.708~6.567 | −9.413 | 2.228 * | 0.841 | 0.511 | |
| 6.575~7.859 | −11.826 | 1.888 | 0.378 | 2.098 | |
| 8.008~9.450 | 6.821 | −0.61 | 0.153 | 0.461 | |
| 9.675~11.284 | 1.367 | 0.018 | 0.001 | 0.144 | |
| IT (1.496) | 6.150~8.050 | 4.781 | −0.378 | 0.122 | 0.744 |
| 8.075~8.542 | 99.283 | −11.312 | 0.572 | 3.683 | |
| 8.791~9.934 | 21.806 | −2.056 | 0.173 | 4.798 | |
| 10.050~11.184 | −17.231 | 1.887 | 0.259 | 1.855 | |
| 11.206~12.825 | 11.206 | −0.868 | 0.362 | 0.609 | |
| FR (0.717) | 7.316~8.034 | 40.532 | −4.939 * | 0.838 | 0.714 |
| 8.433~8.850 | −2.888 | 0.53 | 0.056 | 0.177 | |
| 8.883~9.217 | 15.983 | −1.594 | 0.07 | 0.907 | |
| 9.275~9.759 | −19.925 | 2.289 | 0.271 | 0.648 | |
| 10.066~10.642 | −38.431 | 3.798 | 0.705 | 0.344 | |
| 11.316~12.400 | −7.774 | 0.762 | 0.204 | 0.382 |
| Country | Linear Model | Nonlinear Model | CPLR Method | |||
|---|---|---|---|---|---|---|
| MSE | RMSE | MSE | RMSE | MSE | RMSE | |
| US | 1.951 | 1.397 | 1.168 | 1.081 * | 1.749 | 1.323 |
| UK | 2.512 | 1.585 | 1.652 | 1.285 * | 1.785 | 1.336 |
| CA | 1.660 | 1.288 | 0.993 | 0.997 * | 1.351 | 1.162 |
| JP | 0.675 | 0.822 | 0.673 | 0.821 | 0.338 | 0.581 * |
| GE | 2.113 | 1.454 | 1.895 | 1.377 | 1.595 | 1.263 * |
| IT | 3.453 | 1.858 | 3.181 | 1.783 | 2.237 | 1.496 * |
| FR | 0.967 | 0.983 | 0.611 | 0.782 | 0.514 | 0.717 * |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Lin, Y.-S.; Fan, C.-P.; Lee, M.-Y.; Lee, Y.-H. Mathematical Computation of Piecewise Linear Regression with Endogenous Segmentation for Accurate Data-Based Model Building: An Example of the Phillips Curve. Mathematics 2026, 14, 1041. https://doi.org/10.3390/math14061041
Lin Y-S, Fan C-P, Lee M-Y, Lee Y-H. Mathematical Computation of Piecewise Linear Regression with Endogenous Segmentation for Accurate Data-Based Model Building: An Example of the Phillips Curve. Mathematics. 2026; 14(6):1041. https://doi.org/10.3390/math14061041
Chicago/Turabian StyleLin, Yi-Shin, Chih-Ping Fan, Mei-Yu Lee, and Yao-Hsien Lee. 2026. "Mathematical Computation of Piecewise Linear Regression with Endogenous Segmentation for Accurate Data-Based Model Building: An Example of the Phillips Curve" Mathematics 14, no. 6: 1041. https://doi.org/10.3390/math14061041
APA StyleLin, Y.-S., Fan, C.-P., Lee, M.-Y., & Lee, Y.-H. (2026). Mathematical Computation of Piecewise Linear Regression with Endogenous Segmentation for Accurate Data-Based Model Building: An Example of the Phillips Curve. Mathematics, 14(6), 1041. https://doi.org/10.3390/math14061041

