Softwares
- Randomized Multiarm Bandits: An Improved Adaptive Data Collection Method
Available on github - R package: Rgpt: An R package to talk to chatgpt from R
This package provides the API for R talking to chatgpt. To use this package, it is required to obtain a OPENAI_API_KEY. To get this, you should obtain an account of Open API. On the account page, go to Personal -> View API Keys -> Create new secret key. Copy the key. Edit the file .Renviron, and set OPENAI_API_KEY= the key created. To install the package:
library(devtools)
install_github("zhaozhg81/Rgpt")
Example:
library(Rgpt)
Rgpt("Using R, wirte a sample code for linear model.")
x=matrix(rnorm(12), nrow=3,ncol=4)
LatexTable( 3, 4, t( round(x, digits=3) ) )
- R package: generalized signal-to-noise ratio (gSNR)
To install the package:
library(devtools)
install_github("zhaozhg81/gSNR")
Example:
library(gSNR)
n <- 1000
H <- 20
m <- n/H
sigma <- 1
p <- 20
set.seed(2)
D <- 1
beta <- array(0, c(p, D) )
beta <- rnorm(p, 0, 1)
X <- matrix( rnorm(p*n), c(n, p) )
Z <- X%*% beta
Y <- sin(Z[,1])*exp(Z[,1])*0.2 + sigma*rnorm(n,0,1)
res <- gSNR( X, Y, discrete=FALSE, pvalue=TRUE)
res$stat
res$pvalue
ORD <- order(Y)
Y2 <- array(0, n)
Y2[ ORD[1:floor(n/3)] ] <- 1
Y2[ ORD[ (floor(n/3)+1):floor(2*n/3)] ] <- 2
Y2[ ORD[ (floor(2*n/3)+1):n] ] <- 3
res.2 <- gSNR( X, Y2, discrete=TRUE, pvalue=TRUE)
res.2$stat
res.2$pvalue
- R package: Binary Expansion Test (BET)
- R package: LassoSIR: Sparsed Sliced Inverse Regression via Lasso ( LassoSIR )
- R package: Multiple Testing Procedure for Grouped Hypotheses ( GroupTest )
- R package: Cdf and locfdr Assisted Testing method (CLAT)
To install the package:
library(devtools)
install_github("zhaozhg81/CLAT")
Example:
p <- 1000
X <- c( rnorm(100, -2, 1), rnorm(100, 2, 1), rnorm(800, 0, ) )
q <- 0.05
p.right <- pnorm( X, lower.tail=FALSE )
clat.right <- CLAT( p.right, q)
rejind <- which( clat.right$SigInd!=0 )
## Two-sided test
p.right <- pnorm( X, lower.tail=FALSE )
clat.right <- CLAT( p.right, q)
p.left <- pnorm( X, lower.tail=TRUE )
clat.left <- CLAT( p.left, q)
rejind <- c( which( clat.left$SigInd!=0 ), which(clat.right$SigInd!=0) )
- Bayesian LASSO with Zero Inflated Mixture Prior
- EBVariant: An Empirical Bayes testing procedure for detecting variants in analysis of next generation sequencing data.
- R package: generalized signal-to-noise ratio (gSNR)