Thank you John this is wonderful package, but I think there may be an issue with slmeval when using the inverse of a spline which is monotonically decreasing.
As a simple example, when I work with data with a positive relationship everything is okay:
%first working with a simple positive relationship
X=sort(randn(20,1));
Y=X+10;
slm = slmengine(X,Y,'plot','on');
%find the Y value for X=0.5
Yhat=slmeval(0.5,slm,0);
%and work in the opposite direction
Xhat=slmeval(Yhat,slm,-1)
Xhat =
0.5000
But when I try them same thing for a negative relationship a NaN is returned:
%now work with a negative relationship
X=sort(randn(20,1));
Y=-X-10;
slm = slmengine(X,Y,'plot','on');
%find the Y value for X=0.5
Yhat=slmeval(0.5,slm,0)
%and work in the opposite direction
Xhat=slmeval(Yhat,slm,-1)
Xhat =
NaN
Of course this is just a simply example and the problem I'm working involves more complex relationships. Maybe I've misunderstood the use of slmeval, but any advice you could offer would be great,
thanks, Dave