Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Weighted Dependence Measures

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
NotificationsYou must be signed in to change notification settings

tnagler/wdm-r

Repository files navigation

R-CMD-checkCRAN statusCRAN downloads

R interface to thewdm C++ library,which provides efficient implementations of weighted dependence measuresand related independence tests:

  • Pearsons’s rho
  • Spearmans’s rho
  • Kendall’s tau
  • Blomqvist’s beta
  • Hoeffding’s D

All measures are computed inO(n logn) time, wheren is thenumber of observations.

For a detailed description of the functionality, see theAPIdocumentation.

Installation

  • the stable release from CRAN:
install.packages("wdm")
  • the development version fromGitHub with:
# install.packages("devtools")install_submodule_git<-function(x,...) {install_dir<- tempfile()  system(paste("git clone --recursive", shQuote(x), shQuote(install_dir)))devtools::install(install_dir,...)}install_submodule_git("https://github.com/tnagler/wdm-r")

Cloning

This repo containswdm as a submodule.For a full clone use

git clone --recurse-submodules<repo-address>

Examples

library(wdm)
Dependence between two vectors
x<- rnorm(100)y<- rpois(100,1)# all but Hoeffding's D can handle tiesw<- runif(100)wdm(x,y,method="kendall")# unweighted#> [1] -0.03093257wdm(x,y,method="kendall",weights=w)# weighted#> [1] 0.04835766
Dependence in a matrix
x<-matrix(rnorm(100*3),100,3)wdm(x,method="spearman")# unweighted#>             [,1]      [,2]        [,3]#> [1,]  1.00000000 0.2194659 -0.05435344#> [2,]  0.21946595 1.0000000  0.11401140#> [3,] -0.05435344 0.1140114  1.00000000wdm(x,method="spearman",weights=w)# weighted#>            [,1]      [,2]       [,3]#> [1,]  1.0000000 0.2575236 -0.1689466#> [2,]  0.2575236 1.0000000  0.1197442#> [3,] -0.1689466 0.1197442  1.0000000
Independence test
x<- rnorm(100)y<- rpois(100,1)# all but Hoeffding's D can handle tiesw<- runif(100)indep_test(x,y,method="kendall")# unweighted#>    estimate statistic   p_value n_eff  method alternative#> 1 0.1278922  1.532215 0.1254693   100 kendall   two-sidedindep_test(x,y,method="kendall",weights=w)# weighted#>    estimate statistic    p_value   n_eff  method alternative#> 1 0.1704296  1.779486 0.07516007 79.6939 kendall   two-sided

About

Weighted Dependence Measures

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp