seasonal_trend: Generation of a seasonal trend

View source: R/seasonal_trend.R

seasonal_trendR Documentation

Generation of a seasonal trend

Description

This function generates a time trend for given time points in the trial according to a periodic function.

Usage

seasonal_trend(j, lambda, n_wave, n_total)

Arguments

j

Time points for which the trend should be generated.

lambda

Strength of time trend.

n_wave

How many cycles (waves) should the time trend have (ψ).

n_total

Total sample size in the trial.

Details

The time trend is generated according to the function f(j) = λ \cdot \mathrm{sin} \big( ψ \cdot 2π \cdot \frac{j-1}{N-1} \big), where N is the total sample size (parameter n_total) and the parameter ψ corresponds to the input parameter n_wave.

Value

Time trend for time points j.

Author(s)

Marta Bofill Roig, Pavla Krotka


NCC documentation built on March 7, 2023, 6:50 p.m.