--- "Inger, Matthew" <[EMAIL PROTECTED]> wrote:
> Is there any plan to possibly have a MultivariateRealFunction interface?
> I had planned to return the linear regression coefficients in
> the form of a linear function:
>
> public interface MultivariateRealFunction
> {
> public double value(double x[]);
> }
>
> // in package "linear"
>
> // a function of the form:
> // y = b0 + b1*x1 + b2*x2 + ... bn*xn
> public class LinearFunction
> implements MultivariateRealFunction
> {
> public double value(double x[]) { ... };
> public int getCoefficientCount() { ... };
> public double getCoefficientAt(int idx) { ... };
> public double[] getCoefficients() { ... };
> }
>
>
> public class LinearRegressionResults
> {
> public LinearFunction getFunction() { ... };
> public double[] getResidual();
> ...
> // put in all the other statistical values here
> }
>
> public class LinearRegresion
> {
> public LinearRegressionResults
> solve(double x[][], double y[]) { ... };
> }
>
> Thoughts?
>
That is an interesting approach, but I suspect that users of this class are
going to be primarily interested in the vector of estimated coefficients as
well as standard errors and other model statistics. I would prioritize
getting the parameter estimates and standard errors represented and
available. I have no problem including a predict() method (or even
returning a function) that uses the coefficients to produce predicted
values based on the model, but I would be happy (actually happier) with a
(row) RealMatrix of coefficients.
Phil
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]