piecewise linear function fitting !!
- To: mathgroup@smc.vnet.net
- Subject: [mg11317] piecewise linear function fitting !!
- From: "sylvan" <scd@gopher.chem.wayne.edu>
- Date: Fri, 6 Mar 1998 00:40:28 -0500
- Organization: Wayne State University
Hi, I tried without sucess to map some Data with a piecewise linear function: x0 and x1 are not taken in account as parameters and do not change ! Any solution ?? Regards, Data1= Map[ (#+ Random[Real, {-5,5}])& , { 1.5,1.4,1.3,1.2,1.1,1, 0.9, 0.8, 0.7, 0.6, -1, -10,-8, -7, -5,-3,-1,1,3,5,7,9,10, 11} ] ; func := Which[ x < x0, a x + b, (x>x0) || (x<x1), c x + d, x > x1, e x + f ]; ListParam = {a,b,c,d,e,f,x0,x1}; Bet = { whatever... }; l= Transpose[{ListParam, Bet}]; TryFit = NonlinearRegress[ Data1, func, x, l , ShowProgress -> True ];