PACS: PACS procedure for variable selection

Description Usage Arguments Value Examples

View source: R/StatComp21075.R

Description

This code estimates coefficient for the PACS procedure.

Usage

1
PACS(y, X, lambda, betawt, type = 1, rr = 0, eps = 10^-5)

Arguments

y

centered vector of response

X

scaled design matrix

lambda

non‐negative tuning parameter

betawt

adaptive weights, usually OLS/ridge coefficient estimates

type

1 for Adaptive PACS 2 for Adaptive Correlated PACS 3 for Threshold with Adaptive PACS 4 for Threshold with Adaptive Correlated PACS

rr

correlation for Threshold PACS approaches, a value between 0 and 1(needed for type=3 and type=4)

eps

criteria for convergence

Value

estimated PACS coefficients

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
library(MASS)
n<-50
c1<-c(1,0.7,0.7,rep(0,5))
c2<-c(0.7,1,0.7,rep(0,5))
c3<-c(0.7,0.7,1,rep(0,5))
c4<-c(rep(0,3),1,rep(0,4))
c5<-c(rep(0,4),1,rep(0,3))
c6<-c(rep(0,5),1,rep(0,2))
c7<-c(rep(0,6),1,0)
c8<-c(rep(0,7),1)
s<-rbind(c1,c2,c3,c4,c5,c6,c7,c8)
x<-mvrnorm(n,rep(1,8),s)
beta<-c(2,2,2,rep(0,5))
eps<-rnorm(n)
y<-x%*%beta+eps
betawt<-summary(lm(y~x))$coefficients[2:9]
PACS(y,x,lambda=1,betawt=betawt,type=1,rr=0,eps=10^-5)

## End(Not run)

belzheng/StatComp21075 documentation built on Dec. 23, 2021, 10:22 p.m.