[R] How to get the minimum ?

Philippe Lamy plamy at daimi.au.dk
Thu Jul 7 11:37:15 CEST 2005


Hi,

I have a model with differents observations Xi.
Each observation belongs to a group, either A or B.
I would like to minimize a fonction like :

sum( Xi - Z)^2 + sum (Xi - aZ -b)^2
 A                B

The first sum contains all observations from group A and the second all
observations from group B.
I want to find the Z-value wich minimize this function. a and b are predefined
parameters.

Thanks for help.

Philippe




More information about the R-help mailing list