Giter VIP home page Giter VIP logo

sdafilter's Introduction

sdafilter

The goal of sdafilter is to provide an R package for our new paper on arXiv; see the link: https://arxiv.org/abs/2002.11992

Installation

You can install the released version of sdafilter from CRAN with:

install.packages("sdafilter")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("dulilun/sdafilter")

Example 1: multiple testing: one-sample t-test

This is a simple example of multiple testing of means under dependence.

library(sdafilter)
n = 50
p = 100

rho = 0.8
Sig = matrix(rho, p, p)
diag(Sig) = 1

dat <- MASS::mvrnorm(n, rep(0, p), Sig)
mu = rep(0, p)
mu[1:as.integer(0.1*p)]=0.5
dat = dat+rep(1, n)%*%t(mu)

alpha = 0.2
#kwd = {'lasso', 'de_lasso', 'innovate', 'pfa'}
out = SDA_M(dat, alpha, solve(Sig), kwd='innovate')
print(out)
#>  [1]  1  2  3  4  5  6  7  8  9 10 15 54

Example 2: multiple testing: two-sample t-test

This is a demonstration on how to use our SDA method in two sample case.

p = 100
n = 30

dat_I = matrix(rnorm(n*p),nrow = n)
mu = rep(0, p)
mu[1:10] = 1.5
dat_I = dat_I = rep(1, n)%*%t(mu)

dat_II = matrix(rnorm(n*p), nrow = n)

Sigma_I = diag(p)
Sigma_II = diag(p)

out = SDA_2S(dat_I, dat_II, alpha=0.05, Sigma_I, Sigma_II)
print(out)
#>  [1]  1  2  3  4  5  6  7  8  9 10

sdafilter's People

Contributors

dulilun avatar

Stargazers

 avatar Tianbo Diao avatar

Watchers

 avatar

sdafilter's Issues

Two sample example

Does the package support two sample case as stated in the paper? Is there an example for that?

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.