Formula of "mean dist" and "standard deviation"

Feel free to ask any question here
Post Reply
MarkusM
Posts: 2
Joined: Wed Feb 12, 2014 7:30 am

Formula of "mean dist" and "standard deviation"

Post by MarkusM »

Hi there,

I could not figure out how the computation of "mean distance" and "standard deviation" for Cloud/Cloud or Cloud/Mesh Distances work.

Is it something like:

mean dist = sum ( distances ) / n
std deviation = sqrt ( sum ( Xi - Xm )) / n

n: number of all distances
Xi: distance from Point i to its next neighbour
Xm: mean distance

It would be nice if anybody could help me out.

Thanks and Greets
MarkusM
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Formula of "mean dist" and "standard deviation"

Post by daniel »

The mean distance is what you suggested:

Code: Select all

mean dist = sum ( distances ) / n
But you forgot a "square" power in the std. deviation equation, and the division is done before the square root:

Code: Select all

std deviation = sqrt ( sum ( Xi - Xm )^2  / n )
Which simplifies in:

Code: Select all

std deviation = sqrt( sum ( Xi )^2 / n - mean^2 ) 
(well at least it's faster to compute ;)
Daniel, CloudCompare admin
MarkusM
Posts: 2
Joined: Wed Feb 12, 2014 7:30 am

Re: Formula of "mean dist" and "standard deviation"

Post by MarkusM »

Thank you for the quick response!
Post Reply