MECfda_simDataGen_fcReg: Simulation Data Generation: Scalar-on-function Regression

View source: R/MECfda_simDataGen_fcReg.R

MECfda_simDataGen_fcRegR Documentation

Simulation Data Generation: Scalar-on-function Regression

Description

Generate data set for scalar-on-function regression

Usage

MECfda_simDataGen_fcReg(
  N = 100,
  distribution = c("Gaussian", "Bernoulli"),
  t_interval,
  t_points,
  n_t = 100,
  seed = 0
)

Arguments

N

Sample size.

distribution

Conditional distribution of response varaible given the covariate (Y_i|X_i(t),Z_i). There are two options: 'Gaussian' and 'Bernoulli'.

t_interval

A 2-element vector, represents an interval, means the domain of the functional covariate. Default is c(0,1), represent interval [0,1].

t_points

the measurement points of functional variables, should be numeric vector.

n_t

Number of measurement time points. Overwritten if argument t_points is assigned.

seed

Pseudo-random number generation seed.

Value

return a list with following elements.

Y

An atomic vector of response variable

Z

A dataframe with a binary and a continuous scalar-valued covariate.

FC

A list of two 'functional_variable' class object.

t_interval

Same as in the input argument.

t_points

Sequence of the measurement (time) points.

Examples

dat_sim = MECfda_simDataGen_fcReg(100,"Bernoulli")
res = fcRegression(FC = dat_sim$FC, Y=dat_sim$Y, Z=dat_sim$Z,
                   basis.order = 3, basis.type = c('Fourier'),
                   family = binomial(link = "logit"))

MECfda documentation built on April 3, 2025, 10:07 p.m.