diff options
author | Suraj Yerramilli | 2015-11-01 23:34:37 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2015-11-01 23:34:37 +0530 |
commit | 99258294adb0fa1efb72e2719ff25266e701bde4 (patch) | |
tree | c9dfd9bedd513a02cdaa6960b7d2edf79f65366d | |
parent | 3f84524ca77692c94accb3989e21399b0e4ebca4 (diff) | |
download | SysID-R-code-99258294adb0fa1efb72e2719ff25266e701bde4.tar.gz SysID-R-code-99258294adb0fa1efb72e2719ff25266e701bde4.tar.bz2 SysID-R-code-99258294adb0fa1efb72e2719ff25266e701bde4.zip |
Updating NAMESPACE and documentation
-rw-r--r-- | NAMESPACE | 1 | ||||
-rw-r--r-- | R/estpoly.R | 29 | ||||
-rw-r--r-- | man/armax.Rd | 5 | ||||
-rw-r--r-- | man/arx.Rd | 3 | ||||
-rw-r--r-- | man/oe.Rd | 60 |
5 files changed, 77 insertions, 21 deletions
@@ -45,6 +45,7 @@ export(inputNames) export(misdata) export(nInputSeries) export(nOutputSeries) +export(oe) export(outputData) export(outputNames) export(read.idframe) diff --git a/R/estpoly.R b/R/estpoly.R index 23c59ad..062bccd 100644 --- a/R/estpoly.R +++ b/R/estpoly.R @@ -148,8 +148,7 @@ residplot <- function(model,newdata=NULL){ #' using the \code{\link{detrend}} function. #' #' @return -#' An object with classes \code{estARX} and \code{estPoly}, containing -#' the following elements: +#' An object of class \code{estPoly} containing the following elements: #' #' \tabular{ll}{ #' \code{coefficients} \tab an \code{idpoly} object containing the @@ -219,7 +218,7 @@ arx <- function(x,order=c(0,1,0)){ #' @param x an object of class \code{idframe} #' @param order: Specification of the orders: the four integer components #' (na,nb,nc,nk) are the order of polynolnomial A, order of polynomial B -#' + 1, order of the polynomial,and the input-output delay respectively +#' + 1, order of the polynomial C,and the input-output delay respectively #' #' @details #' SISO ARMAX models are of the form @@ -235,8 +234,7 @@ arx <- function(x,order=c(0,1,0)){ #' using the \code{\link{detrend}} function. #' #' @return -#' An object with classes \code{estARX} and \code{estPoly}, containing -#' the following elements: +#' An object of class \code{estPoly} containing the following elements: #' #' \tabular{ll}{ #' \code{coefficients} \tab an \code{idpoly} object containing the @@ -330,14 +328,14 @@ armax <- function(x,order=c(0,1,1,0)){ #' #' @param x an object of class \code{idframe} #' @param order: Specification of the orders: the four integer components -#' (na,nb,nc,nk) are the order of polynolnomial A, order of polynomial B -#' + 1, order of the polynomial,and the input-output delay respectively +#' (nb,nf,nk) are order of polynomial B + 1, order of the polynomial F, +#' and the input-output delay respectively #' #' @details -#' SISO ARMAX models are of the form +#' SISO OE models are of the form #' \deqn{ -#' y[k] + a_1 y[k-1] + \ldots + a_{na} y[k-na] = b_{nk} u[k-nk] + -#' \ldots + b_{nk+nb} u[k-nk-nb] + c_{1} e[k-1] + \ldots c_{nc} e[k-nc] +#' y[k] + f_1 y[k-1] + \ldots + f_{nf} y[k-nf] = b_{nk} u[k-nk] + +#' \ldots + b_{nk+nb} u[k-nk-nb] + f_{1} e[k-1] + \ldots f_{nf} e[k-nf] #' + e[k] #' } #' The function estimates the coefficients using non-linear least squares @@ -347,8 +345,7 @@ armax <- function(x,order=c(0,1,1,0)){ #' using the \code{\link{detrend}} function. #' #' @return -#' An object with classes \code{estARX} and \code{estPoly}, containing -#' the following elements: +#' An object of class \code{estPoly} containing the following elements: #' #' \tabular{ll}{ #' \code{coefficients} \tab an \code{idpoly} object containing the @@ -370,11 +367,11 @@ armax <- function(x,order=c(0,1,1,0)){ #' 21.6.3 #' #' @examples -#' data(armaxsim) +#' data(oesim) #' z <- dataSlice(data,end=1533) # training set -#' mod_armax <- armax(z,c(1,2,1,2)) -#' summary(mod_armax) # obtain estimates and their covariances -#' plot(mod_armax) # plot the predicted and actual responses +#' mod_oe <- oe(z,c(2,1,2)) +#' summary(mod_oe) # obtain estimates and their covariances +#' plot(mod_oe) # plot the predicted and actual responses #' #' @export oe <- function(x,order=c(1,0,1)){ diff --git a/man/armax.Rd b/man/armax.Rd index 1d4bd2f..d4e5cf5 100644 --- a/man/armax.Rd +++ b/man/armax.Rd @@ -11,11 +11,10 @@ armax(x, order = c(0, 1, 1, 0)) \item{order:}{Specification of the orders: the four integer components (na,nb,nc,nk) are the order of polynolnomial A, order of polynomial B -+ 1, order of the polynomial,and the input-output delay respectively} ++ 1, order of the polynomial C,and the input-output delay respectively} } \value{ -An object with classes \code{estARX} and \code{estPoly}, containing -the following elements: +An object of class \code{estPoly} containing the following elements: \tabular{ll}{ \code{coefficients} \tab an \code{idpoly} object containing the @@ -14,8 +14,7 @@ arx(x, order = c(0, 1, 0)) the input-output delay} } \value{ -An object with classes \code{estARX} and \code{estPoly}, containing -the following elements: +An object of class \code{estPoly} containing the following elements: \tabular{ll}{ \code{coefficients} \tab an \code{idpoly} object containing the diff --git a/man/oe.Rd b/man/oe.Rd new file mode 100644 index 0000000..23fcab1 --- /dev/null +++ b/man/oe.Rd @@ -0,0 +1,60 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/estpoly.R +\name{oe} +\alias{oe} +\title{Estimate Output-Error Models} +\usage{ +oe(x, order = c(1, 0, 1)) +} +\arguments{ +\item{x}{an object of class \code{idframe}} + +\item{order:}{Specification of the orders: the four integer components +(nb,nf,nk) are order of polynomial B + 1, order of the polynomial F, +and the input-output delay respectively} +} +\value{ +An object of class \code{estPoly} containing the following elements: + +\tabular{ll}{ + \code{coefficients} \tab an \code{idpoly} object containing the + fitted coefficients \cr + \code{vcov} \tab the covariance matrix of the fitted coefficients\cr + \code{sigma} \tab the standard deviation of the innovations\cr + \code{df} \tab the residual degrees of freedom \cr + \code{fitted.values} \tab the predicted response \cr + \code{residuals} \tab the residuals \cr + \code{call} \tab the matched call \cr + \code{time} \tab the time of the data used \cr + \code{input} \tab the input data used + } +} +\description{ +Fit an output-error model of the specified order given the input-output data +} +\details{ +SISO OE models are of the form +\deqn{ + y[k] + f_1 y[k-1] + \ldots + f_{nf} y[k-nf] = b_{nk} u[k-nk] + + \ldots + b_{nk+nb} u[k-nk-nb] + f_{1} e[k-1] + \ldots f_{nf} e[k-nf] + + e[k] +} +The function estimates the coefficients using non-linear least squares +(Levenberg-Marquardt Algorithm) +\\ +The data is expected to have no offsets or trends. They can be removed +using the \code{\link{detrend}} function. +} +\examples{ +data(oesim) +z <- dataSlice(data,end=1533) # training set +mod_oe <- oe(z,c(2,1,2)) +summary(mod_oe) # obtain estimates and their covariances +plot(mod_oe) # plot the predicted and actual responses +} +\references{ +Arun K. Tangirala (2015), \emph{Principles of System Identification: +Theory and Practice}, CRC Press, Boca Raton. Sections 14.4.1, 17.5.2, +21.6.3 +} + |