summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-01-07 16:41:28 +0530
committerSuraj Yerramilli2016-01-07 16:41:28 +0530
commit74beaa04179840133b06f30815bc5538fba85596 (patch)
tree9f7387f33d26af93d3aeddf4c5f525c4cbfec2c4
parent5b9dee3637e7f9c3f5a25a23cd978e1c22d7282b (diff)
downloadSysID-R-code-74beaa04179840133b06f30815bc5538fba85596.tar.gz
SysID-R-code-74beaa04179840133b06f30815bc5538fba85596.tar.bz2
SysID-R-code-74beaa04179840133b06f30815bc5538fba85596.zip
documentation for predict.estpoly
-rw-r--r--R/predict.R22
-rw-r--r--man/compare.Rd3
-rw-r--r--man/predict.estpoly.Rd33
3 files changed, 58 insertions, 0 deletions
diff --git a/R/predict.R b/R/predict.R
index 00db521..835d18a 100644
--- a/R/predict.R
+++ b/R/predict.R
@@ -37,6 +37,27 @@ polyinv <- function(x,k){
temp
}
+#' Predictions of identified model
+#'
+#' Predicts the output of an identified model (\code{estpoly}) object K steps ahead.
+#'
+#' @param x \code{estpoly} object containing the identified model
+#' @param newdata optional dataset to be used for predictions. If not supplied,
+#' predictions are made on the training set.
+#' @param nahead number of steps ahead at which to predict (Default:1). For infinite-
+#' step ahead predictions or pure simulation, supply \code{Inf}.
+#'
+#' @return
+#' Time-series containing the predictions
+#'
+#' @examples
+#' data(arxsim)
+#' Yhat <- predict(mod1,data) # 1-step ahead predictions
+#' Yhat_2 <- predict(mod1,data,nahead=2) # 2-step ahead predictions
+#' Yhat_inf <- predict(mod1,data,nahead=Inf) # Infinite-step ahead predictions
+#'
+#'
+#'
#' @export
predict.estpoly <- function(x,newdata=NULL,nahead=1){
if(is.null(newdata)&& nahead==1){
@@ -68,6 +89,7 @@ predict.estpoly <- function(x,newdata=NULL,nahead=1){
#' data(arxsim)
#' compare(data,nahead=1,mod1,mod2,mod3)
#'
+#' @seealso \code{\link{predict.estpoly}} for obtaining model predictions
#' @import ggplot2 reshape2
#' @export
compare <- function(data,nahead=1,...){
diff --git a/man/compare.Rd b/man/compare.Rd
index 8293506..f8cde79 100644
--- a/man/compare.Rd
+++ b/man/compare.Rd
@@ -23,4 +23,7 @@ data(arxsim)
compare(data,nahead=1,mod1,mod2,mod3)
}
+\seealso{
+\code{\link{predict.estpoly}} for obtaining model predictions
+}
diff --git a/man/predict.estpoly.Rd b/man/predict.estpoly.Rd
new file mode 100644
index 0000000..7deff80
--- /dev/null
+++ b/man/predict.estpoly.Rd
@@ -0,0 +1,33 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/predict.R
+\name{predict.estpoly}
+\alias{predict.estpoly}
+\title{Predictions of identified model}
+\usage{
+\method{predict}{estpoly}(x, newdata = NULL, nahead = 1)
+}
+\arguments{
+\item{x}{\code{estpoly} object containing the identified model}
+
+\item{newdata}{optional dataset to be used for predictions. If not supplied,
+predictions are made on the training set.}
+
+\item{nahead}{number of steps ahead at which to predict (Default:1). For infinite-
+step ahead predictions or pure simulation, supply \code{Inf}.}
+}
+\value{
+Time-series containing the predictions
+}
+\description{
+Predicts the output of an identified model (\code{estpoly}) object K steps ahead.
+}
+\examples{
+data(arxsim)
+Yhat <- predict(mod1,data) # 1-step ahead predictions
+Yhat_2 <- predict(mod1,data,nahead=2) # 2-step ahead predictions
+Yhat_inf <- predict(mod1,data,nahead=Inf) # Infinite-step ahead predictions
+
+
+
+}
+