multi_sims: multi_sims

Description Usage Arguments Details Value Note See Also Examples

View source: R/sim_data.R

Description

Generate artificial oscillating time series of various types.

Usage

1
multi_sims(type, noises, n, freq = 0.2, end = 50, ...)

Arguments

type

character indicating which type of time series are to be generated. Possible values are: "ps": Phase-Shifted plain sinusoids; "pst": Phase-Shifted plain sinusoids with linear trend over time; "psd": Phase-Shifted and Damped sinusoids (chirp); "na": Noisy Amplitude, plain sinusoids with Gaussian white noise; "nad": Noisy Amplitude Damped, plain sinusoids with Gaussian white noise; "edls": Exponential Decay Lag Shifted.

noises

numerical vector giving levels of noise to generate the data. Do not pass 0 (no noise) as this is already generated by default. The feature controlled by this argument varies across types of simulations. Phase-Shifted simulations ('psX'): standard deviation of the Gaussian distribution used to shift the curves. Noisy-Amplitude simulations ('naX'): standard deviation of the Gaussian distribution used to generate amplitude noise at each time point. Exponential decay Lag Shifted: standard deviation of the Gaussian distribution used to generate the lag between excitation time and response time. Typical values ranges from 0 to 2.

n

number of trajectories per noise level.

freq

numeric, spacing between 2 time points.

end

numeric, end time of simulations.

...

Additional arguments specific to simulation type. See corresponding sim_X functions.

Details

See ?sim_phase_shifted.

Value

a data.table containing the trajectories in long format in 4 columns. "variable" indicates the ID of the trajectory. IDs are named V1, V2, ..., Vn for each level of noise.

Note

TODO - function is not optimized: it builds the simulation by growing a data.table. plot_sim can be used to visualize the output.

See Also

plot_sim, sim_phase_shifted, sim_phase_shifted_damped, sim_phase_shifted_with_fixed_trend, sim_noisy_amplitude, sim_noisy_amplitude_damped, sim_expodecay_lagged_stim

Examples

1
2
x <- multi_sims(type = "ps", noises = seq(0.5, 2, 0.5), n = 10, freq = 0.5, end = 30)
plot_sim(x)

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