Learn R Programming

colorednoise (version 1.1.1)

colored_noise: Generate Autocorrelated Noise

Description

Generates temporally autocorrelated random numbers with a mean, standard deviation, and autocorrelation you specify.

Usage

colored_noise(timesteps, mean, sd, phi)

Value

A vector of temporally autocorrelated random numbers.

Arguments

timesteps

The number of temporally autocorrelated random numbers (one per timestep) you want.

mean

The mean of the temporally autocorrelated random numbers.

sd

The standard deviation of the temporally autocorrelated random numbers.

phi

The temporal autocorrelation. 0 is white noise (uncorrelated), positive values are red noise (directly correlated) and negative values are blue noise (inversely correlated).

Examples

Run this code
rednoise <- colored_noise(timesteps = 30, mean = 0.5, sd = 0.2, phi = 0.3)
rednoise

Run the code above in your browser using DataLab