Learn R Programming

timsac (version 1.3.8-4)

mulfrf: Frequency Response Function (Multiple Channel)

Description

Compute multiple frequency response function, gain, phase, multiple coherency, partial coherency and relative error statistics.

Usage

mulfrf(y, lag = NULL, iovar = NULL)

Value

cospec

spectrum (complex).

freqr

frequency response function : real part.

freqi

frequency response function : imaginary part.

gain

gain.

phase

phase.

pcoh

partial coherency.

errstat

relative error statistics.

mcoh

multiple coherency.

Arguments

y

a multivariate time series.

lag

maximum lag. Default is \(2 \sqrt{n}\), where \(n\) is the number of rows in y.

iovar

input variables iovar[i] (\(i=1,k\)) and output variable iovar[k+1] (\(1 \le k \le d\)), where \(d\) is the number of columns in y. Default is \(c(1:d)\).

References

H.Akaike and T.Nakagawa (1988) Statistical Analysis and Control of Dynamic Systems. Kluwer Academic publishers.

Examples

Run this code
ar <- array(0, dim = c(3,3,2))
ar[, , 1] <- matrix(c(0.4,  0,   0.3,
                      0.2, -0.1, -0.5,
                      0.3,  0.1, 0), nrow = 3, ncol = 3, byrow = TRUE)
ar[, , 2] <- matrix(c(0,  -0.3,  0.5,
                      0.7, -0.4,  1,
                      0,   -0.5,  0.3), nrow = 3, ncol = 3, byrow = TRUE)
x <- matrix(rnorm(200*3), nrow = 200, ncol = 3)
y <- mfilter(x, ar, "recursive")
mulfrf(y, lag = 20)

Run the code above in your browser using DataLab