R/Snd1.R

Defines functions Snd1

Documented in Snd1

#'@title Cramer-von Mises statistic for the goodness-of-fit test of the null hypothesis of a univariate uniform distribution over [0,1]
#'
#'@description This function computes the Cramer-von Mises statistic Sn for goodness-of-fit of the null hypothesis of a univariate uniform distrubtion over [0,1]
#'
#'@param U vector of pseudos-observations (approximating uniform)
#'
#'@return \item{sta}{Cramer-von Mises statistic}
#'
#'@export


Snd1 <- function(U){

  n = length(U)

  u = sort(U)

  t = t((-0.5+rep(1:n))) / n

  sta = 1/(12*n) + sum( (u-t)^2 ) ;

  return(sta)

}

Try the GenHMM1d package in your browser

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

GenHMM1d documentation built on Jan. 21, 2021, 9:07 a.m.