Skip to contents

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_CFD(
  df,
  beta_real_func_or_list,
  beta_0_real = 5.4321,
  NotS_ratio = 0.2,
  id_col = "id",
  time_col = "time",
  int_mode = 1,
  nb_pt = 10,
  subdivisions = 100,
  seed = 123,
  parallel = FALSE
)

Arguments

df

the X(t) dataframe to evaluate Y on

beta_real_func_or_list

a function beta(t), or a list of 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

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

seed

a integer, random seed

parallel

a boolean to enable parallel processing, default FALSE

Value

a dataframe of Y real and noised values

Author

Francois Bassac

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_CFD(df, beta_real_func, beta_0_real)