In article <[EMAIL PROTECTED]>, ross <[EMAIL PROTECTED]> wrote:
>Can someone help me with this self-education exercise?
>(post is formatted for a fixed pitch font).
>
>Assume some 'ordinary' data - a set of (x,y) data points, ordered on x,
> with x & y real. Assume we draw a boundary somewhere in the middle of
>the x domain
>(x = k) to divide it into 2 adjacent subdomains. I want to fit 2
>regression lines of the form y = ax + b, one to each of the subdomains,
>with a continuity constraint.
>
>In other words I want to satisfy these criteria:
>(C1) the total sum of squared deviates over both intervals is minimised
>(C2) the two fitted lines intersect the boundary x = k at the same
>point.
What you are working with is called a spline regression. Often
it is done as a cubic spline, but it can also be done with a lower order
piecewise linear fit. See: Suits, Mason and Chan, Review of Economics
and Statistics 60, 1978, p.132-139 for a good exposition of this models.
You can fit this type of model with a nonlinear regression package,
using an equation like:
frml sp1 y = a1 + b1*(x-x0) +
(b2-b1)*ds1*(x-x1) +
(b3-b2)*ds2*(x-x2) ;
where:
x0 = min(x)
x1, x2 are "knots" (boundary points like your k , x1 < x2 )
ds1 = 1 for (x >= x1), 0 otherwise
ds2 = 1 for (x >= x2), 0 otherwise
a1, b1, b2, b3 are parameters to be estimated
Obviously, you can also estimate the above model with a linear
regression package, by collecting terms on the parameters to be
estimated, i.e.
y = a1 + b1*z1 + b2*z2 + b3*z3
where
z3 = ds2*(x-x2)
z2 = ds1*(x-x1) - ds2*(x-x2)
z1 = (x-x0) - ds1*(x-x1)
Clint Cummins
TSP International
.
.
=================================================================
Instructions for joining and leaving this list, remarks about the
problem of INAPPROPRIATE MESSAGES, and archives are available at:
. http://jse.stat.ncsu.edu/ .
=================================================================