I am working on creating a statistics object to calculate regression and correlation coefficients from data passed to the object. The regression and correlation equations use some intermediate results, such as the sum of all the x's multiplied by the y's. In an object oreiented approach would it be better to store these intermediate results as data members or simply redo the calculation each time the value is needed? The values will sometimes be used a second time, but not always.
Also does anyone know if someone else has already created such a statistical package and made it available.