models {glmtrans} | R Documentation |
Generate data from Gaussian, logistic and Poisson models.
Description
Generate data from Gaussian, logistic and Poisson models used in the simulation part of Tian, Y. and Feng, Y., 2021.
Usage
models(
family = c("gaussian", "binomial", "poisson"),
type = c("all", "source", "target"),
cov.type = 1,
h = 5,
K = 5,
n.target = 200,
n.source = rep(100, K),
s = 5,
p = 500,
Ka = K
)
Arguments
family |
response type. Can be "gaussian", "binomial" or "poisson". Default = "gaussian".
|
type |
the type of generated data. Can be "all", "source" or "target". |
cov.type |
the type of covariates. Can be 1 or 2 (numerical). If it equals to 1, the predictors will be generated from the distribution used in Section 4.1.1 (Ah-Trans-GLM) in the latest version of Tian, Y. and Feng, Y., 2021. If it equals to 2, the predictors will be generated from the distribution used in Section 4.1.2 (When transferable sources are unknown).
|
h |
measures the deviation ( |
K |
the number of source data sets. Default = 5. |
n.target |
the sample size of target data. Should be a positive integer. Default = 100. |
n.source |
the sample size of each source data. Should be a vector of length |
s |
how many components in the target coefficient are non-zero, which controls the sparsity of target problem. Default = 15. |
p |
the dimension of data. Default = 1000. |
Ka |
the number of transferable sources. Should be an integer between 0 and |
Value
a list of data sets which depend on the value of type
.
-
type
= "all": a list of two components named "target" and "source" storing the target and source data, respectively. Component source is a list containingK
components with the firstKa
onesh
-transferable and the remaining onesh
-nontransferable. The target data set and each source data set have components "x" and "y", as the predictors and responses, respectively. -
type
= "source": a list with a signle component "source". This component contains a list ofK
components with the firstKa
onesh
-transferable and the remaining onesh
-nontransferable. Each source data set has components "x" and "y", as the predictors and responses, respectively. -
type
= "target": a list with a signle component "target". This component contains another list with components "x" and "y", as the predictors and responses of target data, respectively.
References
Tian, Y. and Feng, Y., 2021. Transfer Learning under High-dimensional Generalized Linear Models. arXiv preprint arXiv:2105.14328.
See Also
Examples
set.seed(0, kind = "L'Ecuyer-CMRG")
D.all <- models("binomial", type = "all")
D.target <- models("binomial", type = "target")
D.source <- models("binomial", type = "source")