Hi, a question about the circular mean function in the package CircStats:
Can anyone shed some light on why the circ mean function seems to make sense for the first 2 set of bearings and then the mean of 225 and 45 degrees gives an unexpected 180 deg.
Can anyone explain this???
This problem was first detected when I was trying to take the circ weighted means of my data:
With 2 groups of bearings:
x <- c(270,180)
y <- c(45,270)
the circular mean of these bearings gives:
When finding the weighted means I get this:
> meany <- circ.mean(rad(y))
> meanx <- circ.mean(rad(x))
The function for weighted mean I am using:
circ.weighted.mean <- function (x,w)
sinr <- sum(w*sin(x))
cosr <- sum(w*cos(x))
circmean <- atan(sinr, cosr)
I am assuming that the problem that mention above is the cause of the different mean bearings.
Am I missing something fundamental here?
This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:06 EST