From 41200c6168ef204042c6397144385881c6d9b010 Mon Sep 17 00:00:00 2001 From: Suraj Yerramilli Date: Sun, 23 Aug 2015 16:56:52 +0530 Subject: Multivariate support for step plots --- R/nonparam.R | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'R') diff --git a/R/nonparam.R b/R/nonparam.R index 068f9b7..7df30d9 100644 --- a/R/nonparam.R +++ b/R/nonparam.R @@ -125,11 +125,17 @@ plot.impulseest <- function(model,sig=0.975){ #' #' @export step <- function(model){ - title <- paste("Step Response \n From",model$x,"to",model$y) - stepResp <- cumsum(coef(model)) - plot(model$lags,stepResp,type="s",xlab="Lag",ylab= model$y, - main = title) - abline(h=0) + par(mfrow=c(model$noutputs,model$ninputs)) + + stepplot <- function(model){ + title <- paste("Step Response \n From",model$x,"to",model$y) + stepResp <- cumsum(coef(model)) + plot(model$lags,stepResp,type="s",xlab="Lag",ylab= model$y, + main = title) + abline(h=0) + } + l <- model[seq(model$noutputs*model$ninputs)] + p <- lapply(l,stepplot) } #' Estimate frequency response -- cgit