| irf | R Documentation |
Computes and plots the impulse response function (IRF) or step response function (SRF) of a transfer function.
irf(tf, lag.max = 10, cum = FALSE, plot = TRUE)
tf |
An object of class "tf". |
lag.max |
Integer. Maximum number of lags to compute (default 10). |
cum |
Logical. If TRUE computes step response function (cumulative), if FALSE computes impulse response function (default FALSE). |
plot |
Logical. If TRUE creates a plot, if FALSE returns values only (default TRUE). |
If plot = FALSE, a named numeric vector with IRF/SRF values.
If plot = TRUE, creates a plot and returns nothing (invisibly).
# Create transfer function
x <- rep(0, 100); x[50] <- 1
tfx <- tf(x, w0 = 0.8, ar = "(1 - 0.5B)")
# Plot impulse response function
irf(tfx, lag.max = 15)
# Get step response values without plot
srf_values <- irf(tfx, lag.max = 10, cum = TRUE, plot = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.