simulate_simple_dfrr: Simulating a Simple 'dfrr' Model

Description Usage Arguments Examples

View source: R/simulate_simple_dfrr.R

Description

Simulation from a simple dfrr model:

Y_{i}(t)=I(β_0(t)+β_1(t)*x_{i}+\varepsilon_{i}(t)+ε_{i}(t)\timesσ^2>0),

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

Usage

1
2
3
4
5
6
7
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

Examples

1
2
3
4
5
6
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)

asgari-fatemeh/dfrr documentation built on Aug. 12, 2020, 3:06 a.m.