I would like to implement a regression equation for a new shoulder model using multiple regression coefficients with some second order terms. Consider the following example:

From what I know, the ‘AnyKinMeasureLinComb’ is well suited for regressions with only first order terms and cannot involves interaction terms (i.e. InputKinMeas1*InputKinMeas2), so how can I implement this regression correctly ?

Some terms of your regression formula is possible to implement I think, but I can not see how to do the last term where the measures are multiplied.

The second order terms need to be done with the AnyKinMeasureComb
here is an example of its use

// Here's the point of the model: The position of the point along
// the stick is constrained to be on the ellipsoid surface. This is
// done by means of the equation for an ellipsoid with center at
// the origin of the coordinate system:
// x^2/a + y^2/b + z^2/c = 1
// This fits a second order NormComb measure perfectly. The 1 on
// the right hand side of the equation is obtained by driving the
// measure to 1 by a simple driver.
AnyKinEqSimpleDriver ScapThoracGlide1 = {
AnyKinMeasureNormComb Comb = {
AnyKinLinear lin = {
AnyRefFrame &C = Main.MyModel.GlobalRef.EllipNode;
AnyRefFrame &Point = Main.MyModel.Point;
Ref = 0;
};
Order = 2;
Offset = 0;
Weight = {1/Main.MyModel.GlobalRef.R[0],
1/Main.MyModel.GlobalRef.R[1],
1/Main.MyModel.GlobalRef.R[2]};
};
DriverPos = {1}; // RHS of the allipsoid equation
DriverVel = {0};
};

In your case the second order term will look something like this.

This second order term can then be inserted in the linear combination measure.

Concerning the multiplication of the two measures, I currently can not see this to be feasible, but it might not be very difficult to implement, I am not sure.

Thank you very much for your quick reply. In the definition of the AnyKinMeasureNormComb, the exponent ‘p’ is further cancelled by the ‘1/p’. How can I make a second order measure with that ?

Yes you are right, I overlooked this when I looked at the scapula example, in that example it works because taking the square root on both side still makes this equation fit, in your case this will not work, sorry for that

Is it possible to create a combined measure involving the sinus of another measure ? Here is an example in which I compute one of the clavicle DOFs using two components of the thoracohumeral orientation:

The sinus of the elevation angle is also the distance along one of the three directions of the thoracohumeral orientation unit vector. If the above equation cannot be obtained, is there any way to get one of the components of the orientation unit vector ? I saw that the AnyKinRotational proposes different ways of computing the orientations (RotVector, DirCosines, EulerParameters, etc.).