How can you determine the mean and standard deviation on a polar histogram?

8 views (last 30 days)
Hello,
I am currently trying to find mean and standard deviation of my data during cycling. Each partcipant has 30 revolutions of pedaling and I found the angles where the peak values occur in each revolution. For some variables, the angles are distributed from mid 300 degrees to 90 degrees, which will be cancelled out when you just take the mean. So, I was wondering if there is any way to calculate the mean without cancelling out. I have attached sample data and figure below:
load example
min(example)
ans = 0
max(example)
ans = 6.2832
polarhistogram(example,'BinWidth',deg2rad(10))
set(gca,'ThetaZeroLocation','top','ThetaDir','clockwise')
If you have any suggestions or insights, please let me know. Thank you.
  3 Comments
Youngmin
Youngmin on 28 Feb 2024
@VBBV Thank you for your comment. Of course, I can tell you more about it. As you can see in the example data above, the maximum peak angle is 6.283 rad but the minimum peak angle is 0 rad. Given that the data was obtained during 30 consecutive revolutions of pedaling, both can be considered the same pedal position where the pedals are located at the top. When you take the average values across all data, the mean value is ...
load example
mean(example)
ans = 1.5516
I do not think this mean value can accurately represent the data, as the actual mean value appears to be approximately 0.7 rad when angles greater than 6 rad are converted to negative angles (e.g., converting 6 rad to -0.2832 rad). So, I was wondering if there is any way to calculate the mean angle without the skewness of the data.
histogram(example,20)
Walter Roberson
Walter Roberson on 28 Feb 2024
load example
norm_angle = example;
mask = norm_angle > pi;
norm_angle(mask) = norm_angle(mask) - 2*pi;
mean_angle = mean(norm_angle);
mean(mean_angle)
ans = 0.7138

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 28 Feb 2024
You have to do something like
norm_angle = Angles;
mask = norm_angle > 180;
norm_angle(mask) = norm_angle(mask) - 360;
mean_angle = mean(norm_angle);
  1 Comment
Youngmin
Youngmin on 28 Feb 2024
@Walter Roberson Thank you for your response. Although it is possible to apply this code to this example, it may cause the same issue on other variables as other variables could have different ranges of the angle.

Sign in to comment.

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!