Description Usage Arguments Value Examples
This function uses algorithm SAEM to fit the ABSLOPE model with missing data.
1 2 3 4 |
X |
Design matrix with missingness n * p |
y |
Response vector n * 1 |
lambda |
Penalization coefficient |
a |
Coefficient for sparsity prior |
b |
Coefficient for sparsity prior |
beta.start |
Initialization for τ |
maxit |
Maximum number of iteration. The default is maxit = 300. |
case |
Missing mechanism |
seed |
An integer as a seed set for the radom generator. |
print_iter |
If TRUE, miss.saem will print the estimated parameters in each iteration of SAEM. |
tol_em |
The tolerance to stop SAEM. The default is tol_em = 1e-6. |
impute |
Imputation method for the initilization. The default is impute = 'PCA'. |
sigma.known |
If TRUE, σ is known. |
sigma.init |
Value for known σ. |
scale |
If TRUE, perform scaling in each iteration. |
method_na |
Method for dealing with missing values. Default is method_na = 'lineq'. |
A list with components
X.sim |
Simulated dataset in the last iteration. |
beta |
Estiamated β. |
seqbeta |
Sequence of β estimated in each iteration. |
beta.new |
Estiamated β * model selection indicator γ. |
gamma |
Simulated model selection indicator γ in the last iteration. |
gamma.avg |
Average γ during the iterations. |
seqgamma |
Sequence of γ in each iteration. |
pi.binom |
Probability for selecting each variable. |
theta |
Simulated sparsity θ in the last iteration. |
seqtheta |
Sequence of θ in each iteration. |
sigma |
Estimated σ. |
seqsigma |
Sequence of σ estimated in each iteration. |
mu |
Estimated μ. |
Sigma |
Estimated Σ. |
c |
Simulated inverse of average signal magnitude c in the last iteration. |
seqc |
Sequence of c in each iteration. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # Generate dataset
n=50
p=50
nspr=10 # non-sparsity
p.miss=0.1 # percentage of missingness
mu = rep(0,p)
Sigma=toeplitz(0^(0:(p-1)))
signallevel=3 # signal strength
sigma=1 # noise
amplitude = signallevel*sqrt(2*log(p)) # signal amplitude
# Design matrix
X <- matrix(rnorm(n*p), nrow=n)%*%chol(Sigma) + matrix(rep(mu,n), nrow=n, byrow = TRUE)
X = scale(X)/sqrt(n) #scale
# Coefficient and response vectors
nonzero = sample(p, nspr)
beta = amplitude * (1:p %in% nonzero)
y = X %*% beta + sigma*rnorm(n)
# Missing values
X.obs <- X
p.miss <- 0.10
patterns <- runif(n*p)<p.miss #missing completely at random
X.obs[patterns] <- NA
# ABSLOPE
lambda = create_lambda_bhq(ncol(X),fdr=0.10)
list.SLOB = ABSLOPE(X, y, lambda, a=2/p, b=1-2/p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.