models | R Documentation |
Generate data from Gaussian, logistic and Poisson models used in the simulation part of Tian, Y., & Feng, Y. (2023).
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
)
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., & Feng, Y. (2023). 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 |
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 containing K
components with the first Ka
ones h
-transferable and the remaining ones h
-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 of K
components with the first Ka
ones h
-transferable and the remaining ones h
-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.
Tian, Y., & Feng, Y. (2023). Transfer learning under high-dimensional generalized linear models. Journal of the American Statistical Association, 118(544), 2684-2697.
glmtrans
.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.