R/RcppExports.R

# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Calculate the circular autocorrelation in a time-series
#'
#' @param ts A time-series (a numeric vector)
#'
#' @details Note that all values are included. Non-finite values may cause odd answers
#' 
#' @return A scalar numerical value circular autocorrelation
#'
#' @export
autocor <- function(ts) {
    .Call('RandomThinning_autocor', PACKAGE = 'RandomThinning', ts)
}

#' Generate a random signal with given circular autocorrelation
#'
#' @param m Length of the signal (a positive integer)
#' @param sac Strength of the circular autocorrelation (a positive double, should be between 0 and 1)
#' @param maxcounter Maximum number of tries in the \code{while} loop (a positive integer)
#' @param margin The margin of error between the desired and obtained autocorrelation (a positive double)
#'
#' @return A numerical vector
#'
#' @export
generateRandomSignal <- function(m, sac, maxcounter, margin) {
    .Call('RandomThinning_generateRandomSignal', PACKAGE = 'RandomThinning', m, sac, maxcounter, margin)
}

#' Range test - optimized for finite values only
#'
#' @param ts A time-series (a numeric vector)
#' @param its Indices of which bin the values of x correspond to (a numeric vector of integers between 1 and p). This is optional, and taken to be cyclical by default.
#' @param p Length of the period to test for (a positive integer)
#' 
#' @return A scalar numerical value giving the maximum difference (maximum - minumum) of the means of the \code{p} bins
#'
#' @export
#'
rangeTestFinitesOnly <- function(ts, its, p) {
    .Call('RandomThinning_rangeTestFinitesOnly', PACKAGE = 'RandomThinning', ts, its, p)
}

#' Range test - general version
#'
#' @param ts A time-series (a numeric vector)
#' @param its Indices of which bin the values of x correspond to (a numeric vector of integers between 1 and p). This is optional, and taken to be cyclical by default.
#' @param p Length of the period to test for (a positive integer)
#' 
#' @return A list with three components:
#'   - \code{range} = The maximum difference (maximum - minumum) of the means of the \code{p} bins
#'   - \code{counts} = a numerical array giving number of values in each of the \code{p} bins
#'   - \code{means} = a numerical array giving the mean value in each of the \code{p} bins
#'
#' @export
rangeTestGeneral <- function(ts, its, p) {
    .Call('RandomThinning_rangeTestGeneral', PACKAGE = 'RandomThinning', ts, its, p)
}
JeremySilver/RandomThinning documentation built on May 30, 2019, 9:40 p.m.