Post Reply 
Statistical - Cubic Regression (Cubic Spline Fit) ?
06-06-2022, 01:03 PM
Post: #23
RE: Statistical - Cubic Regression (Cubic Spline Fit) ?
(06-03-2022 09:42 AM)Wes Loewer Wrote:  This is consistent with the Prime's spline command. However, some cubic spline implementations don't limit themselves to y=f(x), but instead treat x and y parametrically, finding x(t) and y(t) where t is the parametric variable.

This is not a "limit". We can get same kind of results with CAS spline command.

XCAS> T,X,Y := range(5), [0,2,3,4,5], [1,0,3,5,4]
XCAS> tx := spline(T,X) :;
XCAS> ty := spline(T,Y) :;

To interpolate for x=1, we solve for t first.

XCAS> t1 := fsolve(tx[0]=1,x=.5)      → 0.451840260174
XCAS> [tx[0], ty[0]] (x=t1)               → [1.0, 0.156460522575]

We could also use complex numbers, combined 2 splines into 1

XCAS> txy := spline(T, X+i*Y) :;
XCSS> txy[0](x=t1)                          → 1.0 + 0.156460522575*i

Note: curve shape is *very* different than cubic-spline of X,Y

XCAS> spline(X,Y)[0](x=1.)               → -0.433139534884
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Statistical - Cubic Regression (Cubic Spline Fit) ? - Albert Chan - 06-06-2022 01:03 PM



User(s) browsing this thread: 1 Guest(s)