Simulate latent function components for longitudinal data analysis

sim.create_f(
  X,
  covariates,
  relevances,
  lengthscales,
  X_affected,
  dis_fun,
  bin_kernel,
  steepness,
  vm_params,
  force_zeromean
)

Arguments

X

input data matrix (generated by sim.create_x)

covariates

Integer vector that defines the types of covariates (other than id and age). Different integers correspond to the following covariate types:

  • 0 = disease-related age

  • 1 = other continuous covariate

  • 2 = a categorical covariate that interacts with age

  • 3 = a categorical covariate that acts as a group offset

  • 4 = a categorical covariate that that acts as a group offset AND is restricted to have value 0 for controls and 1 for cases

relevances

Relative relevance of each component. Must have be a vector so that
length(relevances) = 2 + length(covariates).
First two values define the relevance of the individual-specific age and shared age component, respectively.

lengthscales

A vector so that
length(lengthscales) = 2 + sum(covariates %in% c(0,1,2)).

X_affected

which individuals are affected by the disease

dis_fun

A function or a string that defines the disease effect. If this is a function, that function is used to generate the effect. If dis_fun is "gp_vm" or "gp_ns", the disease component is drawn from a nonstationary GP prior ("vm" is the variance masked version of it).

bin_kernel

Should the binary kernel be used for categorical covariates? If this is TRUE, the effect will exist only for group 1.

steepness

Steepness of the input warping function. This is only used if the disease component is in the model.

vm_params

Parameters of the variance mask function. This is only needed if useMaskedVarianceKernel = TRUE.

force_zeromean

Should each component (excluding the disease age component) be forced to have a zero mean?

Value

a data frame FFF where one column corresponds to one additive component