simulate_simple_dfrr: Simulating a Simple 'dfrr' Model

View source: R/simulate_simple_dfrr.R

simulate_simple_dfrrR Documentation

Simulating a Simple dfrr Model

Description

Simulation from a simple dfrr model:

Y_{i}(t)=I(\beta_0(t)+\beta_1(t)*x_{i}+\varepsilon_{i}(t)+\epsilon_{i}(t)\times\sigma^2>0),

where I(.) is the indicator function, \varepsilon_{i} is a Gaussian random function, and \epsilon_{i}(t) are iid standard normal for each i and t independent of \varepsilon_{i}. For demonstration purpose only.

Usage

simulate_simple_dfrr(
  beta0 = function(t) {
     cos(pi * t + pi)
 },
  beta1 = function(t) {
     2 * t
 },
  X = rnorm(50),
  time = seq(0, 1, length.out = 24),
  sigma2 = 0.2
)

Arguments

beta0, beta1

(optional) functional intercept and slope parameters

X

an (optional) vector consists of scalar covariate

time

an (optional) vector of time points for which, each sample curve is observed at.

sigma2

variance of the measurement error in the dfrr model

Value

This function returns a martix of binary values of dimension NxM where N denotes the length of X and M stands for the length of time.

Examples

N<-50;M<-24
X<-rnorm(N,mean=0)
time<-seq(0,1,length.out=M)
Y<-simulate_simple_dfrr(beta0=function(t){cos(pi*t+pi)},
                        beta1=function(t){2*t},
                        X=X,time=time)

dfrr documentation built on May 31, 2023, 5:32 p.m.