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".

  • "gaussian": Gaussian distribution.

  • "binomial": logistic distribution. When family = "binomial", the input response in both target and source should be 0/1.

  • "poisson": poisson distribution. When family = "poisson", the input response in both target and source should be non-negative.

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).

  • "all": generate a list with a target data set of size n.target and K source data set of size n.source.

  • "source": generate a list with K source data set of size n.source.

  • "target": generate a list with a target data set of size n.target.

h

measures the deviation (l_1-norm) of transferable source coefficient from the target coefficient.

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 K. Default is a K-vector with all elements 150.

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 K. Default = K.

Value

a list of data sets which depend on the value of type.

References

Tian, Y. and Feng, Y., 2021. Transfer Learning under High-dimensional Generalized Linear Models. arXiv preprint arXiv:2105.14328.

See Also

glmtrans.

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")


[Package glmtrans version 2.0.0 Index]