Giter Club home page Giter Club logo

taustar's Introduction

TauStar Package

Purpose

This package allows you to efficiently compute, and perform tests of independence with, the U/V-statistic corresponding to the tau* coefficient described in the paper:

Bergsma, Wicher; Dassios, Angelos. A consistent test of independence based on a sign covariance related to Kendall's tau. Bernoulli 20 (2014), no. 2, 1006–1028.

The tau* statistic has the special property that it is 0 if and only if the bivariate distribution it is computed upon is independent (under some weak conditions on the bivariate distribution) and is positive otherwise. Since t*, the U-statistic corresponding to tau*, is an unbiased estimator of tau* this gives a consistent test of independence. Computing t* naively results an algorithm that takes O(n^4) time where n is the sample size. Luckily it is possible to compute t* much faster (in O(n^2) time) using the algorithm described in:

Heller, Yair and Heller, Ruth. "Computing the Bergsma Dassios sign-covariance." arXiv preprint arXiv:1605.08732 (2016).

building off of the O(n^2*log(n)) algorithm of:

Weihs, Luca, Mathias Drton, and Dennis Leung. "Efficient Computation of the Bergsma-Dassios Sign Covariance." arXiv preprint arXiv:1504.00964 (2015).

This fast algorithm is implemented in this package. Moreover, the package also uses the results of Nandy, Weihs, and Drton (2016) to allow the use of t* in performing tests of independence. In particular, we provide the function tauStarTest which automates tests of independence using the asymptotic null distribution of t*.

Example

A simple example of computing t* on a independent bivariate normal distribution follows:

> set.seed(2342)
> x = rnorm(1000)
> y = rnorm(1000)
> tStar(x, y)
[1] 0.0003637266

Similarly, we may obtain the asymptotic p-value corresponding to a test of independence as follows:

> set.seed(2341)
> x = rnorm(1000)
> y = rnorm(1000)
> tauStarTest(x, y)$pVal
[1] 0.5692797

Where to go

The main functionality of this package is currently included in the functions tStar (which computes the t* statistic on two input vectors) and tauStarTest (which performs tests of independence using t*). One may also be interested in the functions

  1. pHoeffInd, dHoeffInd, rHoeffInd, qHoeffInd
  2. pDisHoeffInd, dDisHoeffInd, rDisHoeffInd, qDisHoeffInd
  3. pMixHoeffInd, dMixHoeffInd, rMixHoeffInd, qMixHoeffInd

which compute distribution functions, densities, random samples, and quantiles for the asymptotic distribution of t* in different cases.

taustar's People

Contributors

lucaweihs avatar

Stargazers

Eugene Scherba avatar mnarayan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.