R/estimation_gamma.R

Defines functions estimation_gamma

Documented in estimation_gamma

estimation_gamma <- function(g, mhat1, y, groupnumber){

  n <- length(g)
  g <- factor(g)
  levels <- levels(g)

  group <- levels[groupnumber]

  y_t <- y[g == group]
  mhat1_t <- mhat1[g == group]
  C_t <- sum(cos(y_t - mhat1_t))
  S_t <- sum(sin(y_t - mhat1_t))

  return(atan2(S_t, C_t))
}

Try the NPCirc package in your browser

Any scripts or data that you put into this service are public.

NPCirc documentation built on Nov. 10, 2022, 5:48 p.m.