MECfda_simDataGen_fcReg {MECfda} | R 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
( |
t_interval |
A 2-element vector, represents an interval,
means the domain of the functional covariate.
Default is |
t_points |
the measurement points of functional variables, should be numeric vector. |
n_t |
Number of measurement time points.
Overwritten if argument |
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"))