R/circ_skew.R

Defines functions circ_skew

  #skewness
  circ_skew <- function(theta){
    
    n<-length(theta)
    C1 <- sum(cos(theta))
    S1 <- sum(sin(theta))
    R.bar <- sqrt((C1/n)^2+(S1/n)^2)
    theta.bar <- atan2(C1, S1)
    rho2 <- sum(cos(2*(theta-theta.bar)))/n
    C2 <- sum(cos(2*theta))/n
    S2 <- sum(sin(2*theta))/n
    mu2 <- atan2(C2, S2)
    skew <- (rho2*sin(mu2-2*theta.bar))/(1-R.bar)^3/2
    skew
    
  }
  
Gi-Seop/ODA documentation built on Aug. 28, 2018, 2:30 a.m.