Colour noise and palette helpers
Source:R/wr_compat.R, R/zzz_aliases_american.R
wr_coloured_noise.Rdwr_coloured_noise generates AR(1) red noise (replaces colorednoise::colored_noise);
wr_brewer_palettes lists the available ColorBrewer palette names and their maximum number of colours.
Usage
wr_coloured_noise(timesteps, mean, sd, phi)
wr_brewer_palettes()
wr_colored_noise(timesteps, mean, sd, phi)Arguments
- timesteps
Number of values to generate (integer, >= 1; with 1 a single normal value is returned). Required, no default.
- mean
Mean of the noise (numeric, in the unit of the series to be simulated). Required, no default.
- sd
Standard deviation of the noise (numeric, > 0); the marginal standard deviation of the AR(1) process. Required, no default.
- phi
Lag-1 autocorrelation of the AR(1) process (numeric, between 0 and 1, below 1; 0 gives white noise, values close to 1 give strongly red noise). Required, no default.