generate_moving_average_process

Summary: Generates a Moving Average (MA) process of order 1 (MA(1)). The function simulates a time series where each value is derived from white noise and a weighted influence of the previous value.

double[]
generate_moving_average_process
(
double beta
,
int n
)

Parameters

beta double

The coefficient determining the influence of the previous random value on the current value.

n int

The number of samples to generate in the moving average process.

Return Value

Type: double[]

result: A double array containing n samples of the generated MA(1) process.

Notes: - The process is defined as: resulti = white_noisei + beta * white_noise[i-1] where white_noise[i] is sampled from a uniform distribution in the range [-1.0, 1.0]. - Uses Random(unpredictableSeed) for randomness, ensuring different sequences in each execution. - The function initializes the process with a single random value and iteratively generates the sequence. - If beta = 0, the process is equivalent to white noise. - The function dynamically appends values to result, which may cause memory reallocation. If performance is critical, preallocating the array may be more efficient. - Moving average models are commonly used in time-series analysis for modeling dependencies between sequential observations.