This function generates a time trend for given time points in the trial according to an inverted-u function.
inv_u_trend(j, lambda, N_peak, n_total)Time trend for time points j.
Time points for which the trend should be generated.
Strength of time trend.
Point at which the time trend switches direction in terms of overall sample size.
Total sample size in the trial.
Marta Bofill Roig, Pavla Krotka
The time trend is generated according to the function \(f(j) = \lambda \cdot \frac{j-1}{N-1} (I(j \leq N_p) - I(j > N_p))\),
where \(N\) is the total sample size (parameter n_total) and \(N_p\) (parameter N_peak) indicates the point at which the trend switches direction.