Learn R Programming

timsac (version 1.3.0)

sglfre: Frequency Response Function (Single Channel)

Description

Compute 1-input,1-output frequency response function, gain, phase, coherency and relative error statistics.

Usage

sglfre(y, lag=NULL, invar, outvar)

Arguments

y
a multivariate time series.
lag
maximum lag. Default $2 \sqrt(n)$, where $n$ is the length of the time series y.
invar
within $d$ variables of the spectrum, invar-th variable is taken as an input variable.
outvar
within $d$ variables of the spectrum, outvar-th variable is taken as an output variable .

Value

  • inspecpower spectrum (input).
  • outspecpower spectrum (output).
  • cspecco-spectrum.
  • qspecquad-spectrum.
  • gaingain.
  • cohcoherency.
  • freqrfrequency response function : real part.
  • freqifrequency response function : imaginary part.
  • errstatrelative error statistics.
  • phasephase.

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),3,3,byrow=TRUE)
  ar[,,2] <- matrix(c(0,  -0.3,  0.5,
                      0.7, -0.4,  1,
                      0,   -0.5,  0.3),3,3,byrow=TRUE)
  x <- matrix(rnorm(200*3),200,3)
  y <- mfilter(x,ar,"recursive")
  sglfre(y, lag=20, invar=1, outvar=2)

Run the code above in your browser using DataLab