Learn R Programming

simts (version 0.1.1)

gen_ma1: Generate an Moving Average Order 1 (MA(1)) Process

Description

Generate an MA(1) Process given \(\theta\) and \(\sigma^2\).

Usage

gen_ma1(N, theta = 0.3, sigma2 = 1)

Arguments

N

An integer for signal length.

theta

A double that contains moving average.

sigma2

A double that contains process variance.

Value

A vec containing the MA(1) process.

Process Definition

The Moving Average order 1 (MA(1)) process with non-zero parameter \(\theta \in (-1,+1)\) and \(\sigma^2 \in {\rm I\!R}^{+}\). This process is defined as: $${x_t} = {\varepsilon_t} + {\theta _1}{\varepsilon_{t - 1}}$$, where $${\varepsilon_t}\mathop \sim \limits^{iid} N\left( {0,\sigma^2} \right)$$

Generation Algorithm

The function first generates a vector of white noise using gen_wn and then obtains the MA values under the above equation.

The \(X_0\) (first value of \(X_t\)) is discarded.

Details

The function implements a way to generate the \(x_t\) values without calling the general ARMA function.