Question: RMSD calculation

Question:RMSD calculation

vvostri 66 Maple

Hello,

 

I have two vectors, M and N, and I need to calculate root mean square deviation (RMSD) between them, i.e. the following expression:

sqrt[((Mi  -  Ni) + (Mi+1 - Ni+1) + ... + (Mn - Nn))/n]

 

In practical terms, M is the experimental data and N is the theoretical model that depends on several parameters. In future I will be changing these parameters and will need to evaluate a large number of RMSDs.

So far I have the following code that does that, but is there a more efficient way for high-throughput calculations? 

 

restart: with(LinearAlgebra): with(ArrayTools):

N := RandomMatrix(5, 1):

M := RandomMatrix(5, 1):

MN:=map(x->x^2,M-N):

sqrt(AddAlongDimension(MN,1)/ArrayNumElems(N));

 

Thank you!

Please Wait...