sim_phase_shifted: Simulate oscillating trajectory

Description Usage Arguments Details Value Functions See Also

View source: R/sim_data.R

Description

Set of functions to simulate different types of oscillating trajectories. To generate data with different noise levels, use multi_sim.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sim_phase_shifted(n, noise, freq = 0.2, end = 50)

sim_phase_shifted_damped(n, noise, damp_params, freq = 0.2, end = 50)

sim_phase_shifted_with_fixed_trend(n, noise, slope, freq = 0.2,
  end = 50)

sim_noisy_amplitude(n, noise, freq = 0.2, end = 50)

sim_noisy_amplitude_damped(n, noise, damp_params, freq = 0.2, end = 50)

sim_expodecay_lagged_stim(n, noise, interval.stim = 5, lambda = 0.2,
  freq = 0.2, end = 50)

Arguments

n

numeric, number of simulated trajectories

noise

numeric, noise level, see ?multi_sims for details

freq

numeric, spacing between 2 time points.

end

numeric, end time of simulations.

damp_params

numeric vector of 2, for dampening parameters of the form c(initial amplitude, decay rate). Used in sim_phase_shifted_damped and sim_noisy_amplitude_damped. See details.

slope

numeric, slope of linear trend, i.e. change of mean value per unit of time.

interval.stim

Time interval between stimulations. Used in sim_expodecay_lagged_stim only.

lambda

Desintegration rate. Used in sim_expodecay_lagged_stim only. See details.

Details

Damping sinusoids are generated with the equation: y(t)=A . exp(-L.t) . sin(t). Where A represents the initial envelope amplitude and lambda the decay constant. damp_params is of the form: c(A,L)

sim_expodecay_lagged_stim simulates trajectories that arise from a "stimulation" (i.e. taking the trajectory to a fixed high-level). Relaxation after stimulation is an exponential decay following equation: y(t) = A0 . exp(-t/T). Where A0 represents the initial level of the trajectory and T the desintegration rate.

Value

a data.table containing the trajectories in long format in 3 columns. "variable" indicates the ID of the trajectory.

Functions

See Also

multi_sim


majpark21/TSexploreR documentation built on Oct. 16, 2019, 2:46 p.m.