dot product operator

2 replies [Last post]
smedland's picture
Joined: 08/04/2009

Is there any chance of building in %.% as an alturnate for the dot product operator *.
I'm seeing so many students confuse this and it is the only mulitplication type that doesn't follow the % % format...
I realise it would be a redundency but I think it would be a useful one.

mspiegel's picture
Joined: 07/31/2009
I was waiting for more

I was waiting for more feedback on this suggestion, but I'll go first since it's been a couple days. I can only speak for my own opinion, but in the OpenMx interface we've tried to add new operators when the R language was missing an operator. The Kronecker product and Kronecker exponent are two examples of this behavior (%x% and %^%). If the operator is already defined by the R language, I think it's preferable to train the users to use that definition. If the operator is already defined, and we define a new alias for the operator, the downside is that the alias only works in the OpenMx library. Users will need to learn the original definition when they use R outside of the OpenMx library.

neale's picture
Joined: 07/31/2009
dot operator

I certainly see Sarah's point. However, looking into the future, the day will come when there are no legacy Mx users left in the world, and OpenMx would carry a disadvantage for the typical R user, as mspiegel points out. A better solution would be for R to change to support %.%, and to phase out the somewhat ambiguous * in the context of dot producting matrices. Unfortunately, I don't see that happening, but I suppose we could suggest it.

Oh, and thank you auto spell - I did not mean "pro ducting" :)