Git Product home page Git Product logo

parallelism's Introduction

Parallelism: Minimax Nonparametric Parallelism Test

The aim of the R package "Parallelism" is to provide a nonparametric testing approach to test whether the spatial or temporal signals in treatment and control groups are parallel or not. The power of the proposed test is minimax optimal with theoretical support.

Installation

Install the dependent packages:

install.packages(c('devtools', 'gss'))

Install 'Parallelism' package:

library(devtools)
install_github("BioAlgs/Parallelism")

Example

In this example, the true curve of the signals from group 0 and 1 are shown in the following figure:

alt text

We generate signals for each group with gaussian white noise and conduct the parallelsm test using the following code:

library(Parallelism)
library(gss)
set.seed(123456)
n = 200
##generate locataions of the spatial or temperal points
z= seq(0,1,length.out=n)
z = c(z,z) 
##the group indictor for each mearsuement
g = c(rep(0,n),rep(1,n))
df= data.frame(g=as.factor(g),z=z)
##generate the measured signal for each group at different locations
fun1 = function(x,delta) 2.5*sin(3*pi*x[,2])*(1-x[,2])*ifelse(x[,1]==0,1,0) + ( (2.5+delta)*sin(3*pi*x[,2])*(1-x[,2]) )*ifelse(x[,1]==0,0,1)
y = fun1(df, 1) + rnorm(2*n,0, 1)

##begin the test
res = parallelism(y,z,as.factor(g))

Testing Result:

begin model fitting...
begin testing...

the test complete.
p-value=0.0104371015740364 

Usage

parallelism(y = y, z = z, g = g)
     
Arguments:

       y: the input signal.

       z: the spatial or tempral locations (scaled to [0,1]).

       g: the categorical variable representing the group information.

Value:

     score: the value of the test statisitcs.

     pvalue: P-value of the test.

parallelism's People

Contributors

bioalgs avatar

Stargazers

 avatar  avatar

Watchers

 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.