This function generates Y_df bases on df, beta_func with the following link Y = beta_0 + int(X(t)*beta(t))dt It generates also the noised values of Y. Here the NotS_ratio is the Noise over total Signal ratio meaning that a value of 0.2 means that the noise represents 20% of the TOTAL variance.
Usage
generate_Y_df(
df,
curve_type = NULL,
beta_real_func_or_list,
beta_0_real = 5.4321,
NotS_ratio = 0.2,
seed = 123,
id_col = "id",
time_col = "time",
int_mode = 1,
nb_pt = 10,
subdivisions = 100,
parallel = FALSE
)Arguments
- df
the X(t) dataframe to evaluate Y on
- curve_type
a character, the type of data, default NULL, need to be \'cat\' or \'num\'.
- beta_real_func_or_list
a function or a list of functions beta(t), function used for the Y evaluation
- beta_0_real
the intercept, default 5.4321
- NotS_ratio
the Noise over total Signal ratio, default 0.2
- seed
a integer value for the seed to be reproducible 123
- id_col
a character of the id column, default 'id'
- time_col
a character of the time column, default 'time'
- int_mode
integration mode, 1 for integrate, 2 for pracma::trapz
- nb_pt
number of points for the integration, default value : 10
- subdivisions
default parameter of R function integrate; default value : 100
- parallel
a boolean to use parallelization, default FALSE
Examples
df = generate_X_df(nind=100, curve_type = 'cat')
beta_real_func<-function(t, end_time=100, drop = NULL){
return(beta_real = sin(t*2*pi/end_time + pi) * exp (1.5*t/end_time))
}
beta_0_real=5.4321
Y_df = generate_Y_df(df, curve_type = 'cat',
beta_real_func, beta_0_real, NotS_ratio=0.2)
