The Show() function writes text based on its arguments to the Log window, which is not open by default. Select View > Log if you are using Windows or Window > Log if you are using Macintosh.
I modified the script to estimate the x-intercept, assuming that it exists in the real plane. It is just the quadratic solution for the roots.
Names Default To Here( 1 );
// example of data
x = -5::5;
dt = New Table( "Non-Linear Data",
New Column( "X", Numeric, Continuous, Values( x ) ),
New Column( "Y", Numeric, Continuous, Values( x^2 - x - 12 ) )
);
// fit quadratic polynomial interpolating function
biv = dt << Bivariate(
Y( :Y ),
X( :X ),
Fit Polynomial( 2 )
);
// get reference to report layer
rbiv = biv << Report;
// get parameter estimates
parm = rbiv["Parameter Estimates"][NumberColBox( 1 )] << Get As Matrix;
// compute x intercept
ans = parm[2]^2 - 4*parm[3]*parm[1];
x intercepts = If( ans > 0,
(-parm[2] + { -1, 1 } * Sqrt( ans )) / (2*parm[3]);
);
Show( parm, x intercepts );
... View more