diff options
Diffstat (limited to 'man')
44 files changed, 1567 insertions, 0 deletions
diff --git a/man/armax.Rd b/man/armax.Rd new file mode 100644 index 0000000..18310d7 --- /dev/null +++ b/man/armax.Rd @@ -0,0 +1,71 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/estpoly.R +\name{armax} +\alias{armax} +\title{Estimate ARMAX Models} +\usage{ +armax(x, order = c(0, 1, 1, 0), init_sys = NULL, intNoise = FALSE, + options = optimOptions()) +} +\arguments{ +\item{x}{an object of class \code{idframe}} + +\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 C,and the input-output delay respectively} + +\item{init_sys}{Linear polynomial model that configures the initial parameterization. +Must be an ARMAX model. Overrules the \code{order} argument} + +\item{intNoise}{Logical variable indicating whether to add integrators in +the noise channel (Default=\code{FALSE})} + +\item{options}{Estimation Options, setup using \code{\link{optimOptions}}} +} +\value{ +An object of class \code{estpoly} containing the following elements: + \item{sys}{an \code{idpoly} object containing the + fitted ARMAX coefficients} + \item{fitted.values}{the predicted response} + \item{residuals}{the residuals} + \item{input}{the input data used} + \item{call}{the matched call} + \item{stats}{A list containing the following fields: \cr + \code{vcov} - the covariance matrix of the fitted coefficients \cr + \code{sigma} - the standard deviation of the innovations} + \item{options}{Option set used for estimation. If no + custom options were configured, this is a set of default options} + \item{termination}{Termination conditions for the iterative + search used for prediction error minimization: + \code{WhyStop} - Reason for termination \cr + \code{iter} - Number of Iterations \cr + \code{iter} - Number of Function Evaluations } +} +\description{ +Fit an ARMAX model of the specified order given the input-output data +} +\details{ +SISO ARMAX 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] + + e[k] +} +The function estimates the coefficients using non-linear least squares +(Levenberg-Marquardt Algorithm) +\cr +The data is expected to have no offsets or trends. They can be removed +using the \code{\link{detrend}} function. +} +\examples{ +data(armaxsim) +z <- dataSlice(armaxsim,end=1533) # training set +mod_armax <- armax(z,c(1,2,1,2)) +mod_armax + +} +\references{ +Arun K. Tangirala (2015), \emph{Principles of System Identification: +Theory and Practice}, CRC Press, Boca Raton. Sections 14.4.1, 21.6.2 +} + diff --git a/man/armaxsim.Rd b/man/armaxsim.Rd new file mode 100644 index 0000000..69f41f1 --- /dev/null +++ b/man/armaxsim.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{armaxsim} +\alias{armaxsim} +\title{Data simulated from an ARMAX model} +\format{an \code{idframe} object with 2555 samples, one input and one +output} +\usage{ +armaxsim +} +\description{ +This dataset contains 2555 samples simulated from the following ARMAX model: +\deqn{ + y[k] = \frac{0.6q^{-2} - 0.2q^{-3}}{1 - 0.5q^{-1}} u[k] + + \frac{1-0.3q^{-1}}{1 - 0.5q^{-1}} e[k] +} +} +\details{ +The model is simulated with a 2555 samples long full-band PRBS input. +The noise variance is set to 0.1 +} +\keyword{datasets} + diff --git a/man/arx.Rd b/man/arx.Rd new file mode 100644 index 0000000..f55db17 --- /dev/null +++ b/man/arx.Rd @@ -0,0 +1,70 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/estpoly.R +\name{arx} +\alias{arx} +\title{Estimate ARX Models} +\usage{ +arx(x, order = c(1, 1, 1), lambda = 0.1, intNoise = FALSE, fixed = NULL) +} +\arguments{ +\item{x}{an object of class \code{idframe}} + +\item{order}{Specification of the orders: the three integer components +(na,nb,nk) are the order of polynolnomial A, (order of polynomial B + 1) and +the input-output delay} + +\item{lambda}{Regularization parameter(Default=\code{0.1})} + +\item{intNoise}{Logical variable indicating whether to add integrators in +the noise channel (Default=\code{FALSE})} + +\item{fixed}{list containing fixed parameters. If supplied, only \code{NA} entries +will be varied. Specified as a list of two vectors, each containing the parameters +of polynomials A and B respectively.} +} +\value{ +An object of class \code{estpoly} containing the following elements: + \item{sys}{an \code{idpoly} object containing the + fitted ARX coefficients} + \item{fitted.values}{the predicted response} + \item{residuals}{the residuals} + \item{input}{the input data used} + \item{call}{the matched call} + \item{stats}{A list containing the following fields: \cr + \code{vcov} - the covariance matrix of the fitted coefficients \cr + \code{sigma} - the standard deviation of the innovations\cr + \code{df} - the residual degrees of freedom} +} +\description{ +Fit an ARX model of the specified order given the input-output data +} +\details{ +SISO ARX 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] + e[k] +} +The function estimates the coefficients using linear least squares (with +regularization). +\cr +The data is expected to have no offsets or trends. They can be removed +using the \code{\link{detrend}} function. +\cr +To estimate finite impulse response(\code{FIR}) models, specify the first +order to be zero. +} +\examples{ +data(arxsim) +mod_arx <- arx(arxsim,c(1,2,2)) +mod_arx +plot(mod_arx) # plot the predicted and actual responses + +} +\references{ +Arun K. Tangirala (2015), \emph{Principles of System Identification: +Theory and Practice}, CRC Press, Boca Raton. Section 21.6.1 + +Lennart Ljung (1999), \emph{System Identification: Theory for the User}, +2nd Edition, Prentice Hall, New York. Section 10.1 +} + diff --git a/man/arxsim.Rd b/man/arxsim.Rd new file mode 100644 index 0000000..4972ff6 --- /dev/null +++ b/man/arxsim.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{arxsim} +\alias{arxsim} +\title{Data simulated from an ARX model} +\format{an \code{idframe} object with 2555 samples, one input and one +output} +\usage{ +arxsim +} +\description{ +This dataset contains 2555 samples simulated from the following ARX model: +\deqn{ + y[k] = \frac{0.6q^{-2} - 0.2q^{-3}}{1 - 0.5q^{-1}} u[k] + + \frac{1}{1 - 0.5q^{-1}} e[k] +} +} +\details{ +The model is simulated with a 2555 samples long full-band PRBS input. +The noise variance is set to 0.1 +} +\keyword{datasets} + diff --git a/man/bj.Rd b/man/bj.Rd new file mode 100644 index 0000000..b6a7cfc --- /dev/null +++ b/man/bj.Rd @@ -0,0 +1,86 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/estpoly.R +\name{bj} +\alias{bj} +\title{Estimate Box-Jenkins Models} +\usage{ +bj(z, order = c(1, 1, 1, 1, 0), init_sys = NULL, options = optimOptions()) +} +\arguments{ +\item{z}{an \code{idframe} object containing the data} + +\item{order}{Specification of the orders: the five integer components +(nb,nc,nd,nf,nk) are order of polynomial B + 1, order of the polynomial C, +order of the polynomial D, order of the polynomial F, and the +input-output delay respectively} + +\item{init_sys}{Linear polynomial model that configures the initial parameterization. +Must be a BJ model. Overrules the \code{order} argument} + +\item{options}{Estimation Options, setup using +\code{\link{optimOptions}}} +} +\value{ +An object of class \code{estpoly} containing the following elements: + \item{sys}{an \code{idpoly} object containing the + fitted BJ coefficients} + \item{fitted.values}{the predicted response} + \item{residuals}{the residuals} + \item{input}{the input data used} + \item{call}{the matched call} + \item{stats}{A list containing the following fields: \cr + \code{vcov} - the covariance matrix of the fitted coefficients \cr + \code{sigma} - the standard deviation of the innovations} + \item{options}{Option set used for estimation. If no + custom options were configured, this is a set of default options} + \item{termination}{Termination conditions for the iterative + search used for prediction error minimization: + \code{WhyStop} - Reason for termination \cr + \code{iter} - Number of Iterations \cr + \code{iter} - Number of Function Evaluations } +} +\description{ +Fit a box-jenkins model of the specified order from input-output data +} +\details{ +SISO BJ models are of the form +\deqn{ + y[k] = \frac{B(q^{-1})}{F(q^{-1})}u[k-nk] + + \frac{C(q^{-1})}{D(q^{-1})} e[k] +} +The orders of Box-Jenkins model are defined as follows: +\deqn{ + B(q^{-1}) = b_1 + b_2q^{-1} + \ldots + b_{nb} q^{-nb+1} +} + +\deqn{ + C(q^{-1}) = 1 + c_1q^{-1} + \ldots + c_{nc} q^{-nc} +} + +\deqn{ + D(q^{-1}) = 1 + d_1q^{-1} + \ldots + d_{nd} q^{-nd} +} +\deqn{ + F(q^{-1}) = 1 + f_1q^{-1} + \ldots + f_{nf} q^{-nf} +} + +The function estimates the coefficients using non-linear least squares +(Levenberg-Marquardt Algorithm) +\cr +The data is expected to have no offsets or trends. They can be removed +using the \code{\link{detrend}} function. +} +\examples{ +data(bjsim) +z <- dataSlice(bjsim,end=1500) # training set +mod_bj <- bj(z,c(2,1,1,1,2)) +mod_bj +residplot(mod_bj) # residual plots + +} +\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 +} + diff --git a/man/bjsim.Rd b/man/bjsim.Rd new file mode 100644 index 0000000..d599860 --- /dev/null +++ b/man/bjsim.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{bjsim} +\alias{bjsim} +\title{Data simulated from an BJ model} +\format{an \code{idframe} object with 2046 samples, one input and one +output} +\usage{ +bjsim +} +\description{ +This dataset contains 2046 samples simulated from the following BJ model: +\deqn{ + y[k] = \frac{0.6q^{-2} - 0.2q^{-3}}{1 - 0.5q^{-1}} u[k] + + \frac{1+0.2q^{-1}}{1 - 0.3q^{-1}} e[k] +} +} +\details{ +The model is simulated with a 2046 samples long full-band PRBS input. +The noise variance is set to 0.1 +} +\keyword{datasets} + diff --git a/man/compare.Rd b/man/compare.Rd new file mode 100644 index 0000000..3700f0a --- /dev/null +++ b/man/compare.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/predict.R +\name{compare} +\alias{compare} +\title{Compare the measured output and the predicted output(s)} +\usage{ +compare(data, nahead = 1, ...) +} +\arguments{ +\item{data}{validation data in the form of an \code{idframe} object} + +\item{nahead}{number of steps ahead at which to predict (Default:1). For infinite- +step ahead predictions, supply \code{Inf}.} + +\item{\ldots}{models whose predictions are to be compared} +} +\description{ +Plots the output predictions of model(s) superimposed over validation data, +data, for comparison. +} +\examples{ +data(arxsim) +mod1 <- arx(arxsim,c(1,2,2)) +mod2 <- oe(arxsim,c(2,1,1)) +compare(arxsim,nahead=Inf,mod1,mod2) + +} +\seealso{ +\code{\link{predict.estpoly}} for obtaining model predictions +} + diff --git a/man/cstr.Rd b/man/cstr.Rd new file mode 100644 index 0000000..66f31f5 --- /dev/null +++ b/man/cstr.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{cstr} +\alias{cstr} +\title{Continuous stirred tank reactor data (idframe)} +\format{an \code{idframe} object with 7500 samples, one input and two +outputs} +\usage{ +cstr +} +\description{ +The Process is a model of a Continuous Stirring Tank Reactor, +where the reaction is exothermic and the concentration is +controlled by regulating the coolant flow. +\cr +} +\details{ +Inputs: q, Coolant Flow l/min +Outputs: +\describe{ +\item{Ca}{Concentration mol/l} +\item{T}{Temperature Kelvin}} +} +\keyword{datasets} + diff --git a/man/cstrData.Rd b/man/cstrData.Rd new file mode 100644 index 0000000..7fc7be9 --- /dev/null +++ b/man/cstrData.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{cstrData} +\alias{cstrData} +\title{Continuous stirred tank reactor data (data.frame)} +\format{an \code{data.frame} object with 7500 rows and three columns: +q, Ca and T} +\source{ +\url{ftp://ftp.esat.kuleuven.be/pub/SISTA/data/process_industry/cstr.dat.gz} +} +\usage{ +cstrData +} +\description{ +The Process is a model of a Continuous Stirring Tank Reactor, +where the reaction is exothermic and the concentration is +controlled by regulating the coolant flow. +\cr +} +\details{ +Inputs: q, Coolant Flow l/min +Outputs: +\describe{ +\item{Ca}{Concentration mol/l} +\item{T}{Temperature Kelvin}} +} +\keyword{datasets} + diff --git a/man/cstr_mis.Rd b/man/cstr_mis.Rd new file mode 100644 index 0000000..15f9433 --- /dev/null +++ b/man/cstr_mis.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{cstr_mis} +\alias{cstr_mis} +\title{Continuous stirred tank reactor data with missing values} +\format{an \code{idframe} object with 7500 samples, one input and two +outputs} +\usage{ +cstr_mis +} +\description{ +This dataset is derived from the \code{cstr} dataset with few samples +containing missing values, in one or all variables. It is used to +demonstrate the capabilities of the \code{misdata} routine. +} +\seealso{ +\code{\link{cstr}}, \code{\link{misdata}} +} +\keyword{datasets} + diff --git a/man/dataSlice.Rd b/man/dataSlice.Rd new file mode 100644 index 0000000..f0c1cd6 --- /dev/null +++ b/man/dataSlice.Rd @@ -0,0 +1,43 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/preprocess.R +\name{dataSlice} +\alias{dataSlice} +\title{Subset or Resample idframe data} +\usage{ +dataSlice(data, start = NULL, end = NULL, freq = NULL) +} +\arguments{ +\item{data}{an object of class \code{idframe}} + +\item{start}{the start index} + +\item{end}{the end index} + +\item{freq}{fraction of the original frequency at which the series +to be sampled.} +} +\value{ +an idframe object +} +\description{ +\code{dataSlice} is a subsetting method for objects of class \code{idframe}. It +extracts the subset of the object \code{data} observed between indices \code{start} +and \code{end}. If a frequency is specified, the series is then re-sampled at the +new frequency. +} +\details{ +The dataSlice function extends the \code{\link[stats]{window}} +function for idframe objects +} +\examples{ +data(cstr) +cstrsub <- dataSlice(cstr,start=200,end=400) # extract between indices 200 and 400 +cstrTrain <- dataSlice(cstr,end=4500) # extract upto index 4500 +cstrTest <- dataSlice(cstr,start=6501) # extract from index 6501 till the end +cstr_new <- dataSlice(cstr,freq=0.5) # resample data at half the original frequency + +} +\seealso{ +\code{\link[stats]{window}} +} + diff --git a/man/detrend.Rd b/man/detrend.Rd new file mode 100644 index 0000000..2303b5b --- /dev/null +++ b/man/detrend.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/preprocess.R +\name{detrend} +\alias{detrend} +\alias{trInfo} +\title{Remove offsets and linear trends} +\usage{ +detrend(x, type = 0) +} +\arguments{ +\item{x}{an object of class \code{idframe}} + +\item{type}{argument indicating the type of trend to be removed (Default=\code{0}) +\itemize{ + \item type=\code{0}: Subtracts mean value from each signal + \item type=\code{1}: Subtracts a linear trend (least-squres fit) + \item type=\code{trInfo} object: Subtracts a trend specified by the object +}} +} +\value{ +A list containing two objects: the detrended data and the trend information +} +\description{ +Removes offsets or trends from data +} +\details{ +\code{R} by default doesn't allow return of multiple objects. The \code{\%=\%} +operator and \code{g} function in this package facillitate this behaviour. See +the examples section for more information. +} +\examples{ +data(cstr) +datatrain <- dataSlice(cstr,end=4500) +datatest <- dataSlice(cstr,4501) +g(Ztrain,tr) \%=\% detrend(datatrain) # Remove means +g(Ztest) \%=\% detrend(datatest,tr) + +} +\seealso{ +\code{\link[stats]{lm}} +} + diff --git a/man/estpoly.Rd b/man/estpoly.Rd new file mode 100644 index 0000000..13a5556 --- /dev/null +++ b/man/estpoly.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/estpoly.R +\name{estpoly} +\alias{estpoly} +\title{Estimated polynomial object} +\usage{ +estpoly(sys, fitted.values, residuals, options = NULL, call, stats, + termination = NULL, input) +} +\arguments{ +\item{sys}{an \code{idpoly} object containing the estimated polynomial +coefficients} + +\item{fitted.values}{1-step ahead predictions on the training dataset} + +\item{residuals}{1-step ahead prediction errors} + +\item{options}{optimization specification ser used (applicable for non-linear least +squares)} + +\item{call}{the matched call} + +\item{stats}{a list containing estimation statistics} + +\item{termination}{termination criteria for optimization} + +\item{input}{input signal of the training data-set} +} +\description{ +Estimated discrete-time polynomial model returned from an estimation +routine. +} +\details{ +Do not use \code{estpoly} for directly specifing an input-output polynomial model. +\code{\link{idpoly}} is to be used instead +} + diff --git a/man/etfe.Rd b/man/etfe.Rd new file mode 100644 index 0000000..662ff4a --- /dev/null +++ b/man/etfe.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/nonparam.R +\name{etfe} +\alias{etfe} +\title{Estimate empirical transfer function} +\usage{ +etfe(data, n = 128) +} +\arguments{ +\item{data}{an object of class \code{idframe}} + +\item{n}{frequency spacing (Default: \code{128})} +} +\value{ +an \code{idfrd} object containing the estimated frequency response +} +\description{ +Estimates the emperical transfer function from the data by taking the +ratio of the fourier transforms of the output and the input variables +} +\examples{ +data(arxsim) +frf <- etfe(arxsim) + +} +\references{ +Arun K. Tangirala (2015), \emph{Principles of System Identification: +Theory and Practice}, CRC Press, Boca Raton. Sections 5.3 and 20.4.2 +} +\seealso{ +\code{\link[stats]{fft}} +} + diff --git a/man/fitch.Rd b/man/fitch.Rd new file mode 100644 index 0000000..1715797 --- /dev/null +++ b/man/fitch.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/estpoly.R +\name{fitch} +\alias{fitch} +\title{Fit Characteristics} +\usage{ +fitch(x) +} +\arguments{ +\item{x}{the estimated model} +} +\value{ +A list containing the following elements + +\item{MSE}{Mean Square Error measure of how well the response of the model fits +the estimation data} +\item{FPE}{Final Prediction Error} +\item{FitPer}{Normalized root mean squared error (NRMSE) measure of how well the +response of the model fits the estimation data, expressed as a percentage.} +\item{AIC}{Raw Akaike Information Citeria (AIC) measure of model quality} +\item{AICc}{Small sample-size corrected AIC} +\item{nAIC}{Normalized AIC} +\item{BIC}{Bayesian Information Criteria (BIC)} +} +\description{ +Returns quantitative assessment of the estimated model as a list +} + diff --git a/man/frd.Rd b/man/frd.Rd new file mode 100644 index 0000000..c122fed --- /dev/null +++ b/man/frd.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{frd} +\alias{frd} +\title{Frequency response data} +\format{an \code{idfrd} object with response at 128 frequency points} +\usage{ +frd +} +\description{ +This dataset contains frequency response data of an unknown SISO system. +} +\keyword{datasets} + diff --git a/man/getcov.Rd b/man/getcov.Rd new file mode 100644 index 0000000..8ee2537 --- /dev/null +++ b/man/getcov.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/estUtil.R +\name{getcov} +\alias{getcov} +\title{Parameter covariance of the identified model} +\usage{ +getcov(sys) +} +\arguments{ +\item{sys}{a linear, identified parametric model} +} +\description{ +Obtain the parameter covariance matrix of the linear, identified +parametric model +} + diff --git a/man/grapes-equals-grapes.Rd b/man/grapes-equals-grapes.Rd new file mode 100644 index 0000000..fbc3231 --- /dev/null +++ b/man/grapes-equals-grapes.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/util.R +\name{\%=\%} +\alias{\%=\%} +\alias{g} +\title{Multiple assignment operator} +\usage{ +l \%=\% r +} +\arguments{ +\item{l}{the variables to be assigned} + +\item{r}{the list or function-return object} +} +\description{ +Assign multiple variables from a list or function return object +} + diff --git a/man/idframe.Rd b/man/idframe.Rd new file mode 100644 index 0000000..ce00ba0 --- /dev/null +++ b/man/idframe.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/idframe.R +\name{idframe} +\alias{idframe} +\title{S3 class for storing input-output data.} +\usage{ +idframe(output, input = NULL, Ts = 1, start = 0, end = NULL, + unit = c("seconds", "minutes", "hours", "days")[1]) +} +\arguments{ +\item{output}{dataframe/matrix/vector containing the outputs} + +\item{input}{dataframe/matrix/vector containing the inputs} + +\item{Ts}{sampling interval (Default: 1)} + +\item{start}{Time of the first observation} + +\item{end}{Time of the last observation Optional Argument} + +\item{unit}{Time unit (Default: "seconds")} +} +\value{ +an idframe object +} +\description{ +\code{idframe} is an S3 class for storing and manipulating input-ouput data. It supports discrete time and frequency domain data. +} +\examples{ + +dataMatrix <- matrix(rnorm(1000),ncol=5) +data <- idframe(output=dataMatrix[,3:5],input=dataMatrix[,1:2],Ts=1) + +} +\seealso{ +\code{\link{plot.idframe}}, the plot method for idframe objects +} + diff --git a/man/idfrd.Rd b/man/idfrd.Rd new file mode 100644 index 0000000..1d3f96e --- /dev/null +++ b/man/idfrd.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/idframe.R +\name{idfrd} +\alias{idfrd} +\title{S3 class constructor for storing frequency response data} +\usage{ +idfrd(respData, freq, Ts, spec = NULL, covData = NULL, noiseCov = NULL) +} +\arguments{ +\item{respData}{frequency response data. For SISO systems, supply a +vector of frequency response values. For MIMO systems with Ny +outputs and Nu inputs, supply an array of size c(Ny,Nu,Nw).} + +\item{freq}{frequency points of the response} + +\item{Ts}{sampling time of data} + +\item{spec}{power spectra and cross spectra of the system +output disturbances (noise). Supply an array of size (Ny,Ny,Nw)} + +\item{covData}{response data covariance matrices. Supply an array +of size (Ny,Nu,Nw,2,2). covData[ky,ku,kw,,] is the covariance matrix +of respData[ky,ku,kw]} + +\item{noiseCov}{power spectra variance. Supply an array of +size (Ny,Ny,Nw)} +} +\value{ +an idfrd object +} +\description{ +S3 class constructor for storing frequency response data +} +\seealso{ +\code{\link{plot.idfrd}} for generating bode plots, +\code{\link{spa}} and \code{\link{etfe}} for estimating the +frequency response given input/output data +} + diff --git a/man/idinput.Rd b/man/idinput.Rd new file mode 100644 index 0000000..01f0b7c --- /dev/null +++ b/man/idinput.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/idinput.R +\name{idinput} +\alias{idinput} +\title{function to generate input singals (rgs/rbs/prbs/sine)} +\usage{ +idinput(n, type = "rgs", band = c(0, 1), levels = c(-1, 1)) +} +\arguments{ +\item{n}{integer length of the input singal to be generated} + +\item{type}{the type of input signal to be generated. +'rgs' - generates random gaussian signal +'rbs' - generates random binary signal +'prbs' - generates pseudorandom binary signal +'sine' - generates a signal that is a sum of sinusoids + +Default value is type='rgs'} + +\item{band}{determines the frequency content of the signal. +For type='rbs'/'sine'/, band = [wlow,whigh] +which specifies the lower and the upper bound of the passband frequencies(expressed as fractions of Nyquist frequency). Default is c(0,1) +For type='prbs', band=[0,B] +where B is such that the singal is constant over 1/B (clock period). Default is c(0,1)} + +\item{levels}{row vector defining the input level. It is of the form +levels=c(minu, maxu) +For 'rbs','prbs', 'sine', the generated signal always between minu and maxu. +For 'rgs', minu=mean value of signal minus one standard deviation and maxu=mean value of signal plus one standard deviation + +Default value is levels=c(-1,1)} +} +\description{ +\code{idinput} is a function for generating input signals (rgs/rbs/prbs/sine) for identification purposes +} + diff --git a/man/idpoly.Rd b/man/idpoly.Rd new file mode 100644 index 0000000..f95eca2 --- /dev/null +++ b/man/idpoly.Rd @@ -0,0 +1,54 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/poly.R +\name{idpoly} +\alias{idpoly} +\title{Polynomial model with identifiable parameters} +\usage{ +idpoly(A = 1, B = 1, C = 1, D = 1, F1 = 1, ioDelay = 0, Ts = 1, + noiseVar = 1, intNoise = F, unit = c("seconds", "minutes", "hours", + "days")[1]) +} +\arguments{ +\item{A}{autoregressive coefficients} + +\item{B, F1}{coefficients of the numerator and denominator respectively +of the deterministic model between the input and output} + +\item{C, D}{coefficients of the numerator and denominator respectively +of the stochastic model} + +\item{ioDelay}{the delay in the input-output channel} + +\item{Ts}{sampling interval} + +\item{noiseVar}{variance of the white noise source (Default=\code{1})} + +\item{intNoise}{Logical variable indicating presence or absence of integrator +in the noise channel (Default=\code{FALSE})} + +\item{unit}{time unit (Default=\code{"seconds"})} +} +\description{ +Creates a polynomial model with identifiable coefficients +} +\details{ +Discrete-time polynomials are of the form +\deqn{ + A(q^{-1}) y[k] = \frac{B(q^{-1})}{F1(q^{-1})} u[k] + + \frac{C(q^{-1})}{D(q^{-1})} e[k] +} +} +\examples{ +# define output-error model +mod_oe <- idpoly(B=c(0.6,-0.2),F1=c(1,-0.5),ioDelay = 2,Ts=0.1, +noiseVar = 0.1) + +# define box-jenkins model with unit variance +B <- c(0.6,-0.2) +C <- c(1,-0.3) +D <- c(1,1.5,0.7) +F1 <- c(1,-0.5) +mod_bj <- idpoly(1,B,C,D,F1,ioDelay=1) + +} + diff --git a/man/impulseest.Rd b/man/impulseest.Rd new file mode 100644 index 0000000..4247a0f --- /dev/null +++ b/man/impulseest.Rd @@ -0,0 +1,46 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/nonparam.R +\name{impulseest} +\alias{impulseest} +\title{Estimate Impulse Response Coefficients} +\usage{ +impulseest(x, M = 30, K = NULL, regul = F, lambda = 1) +} +\arguments{ +\item{x}{an object of class \code{idframe}} + +\item{M}{Order of the FIR Model (Default:\code{30})} + +\item{K}{Transport delay in the estimated impulse response +(Default:NULL)} + +\item{regul}{Parameter indicating whether regularization should be +used. (Default:\code{FALSE})} + +\item{lambda}{The value of the regularization parameter. Valid only if +\code{regul=TRUE}. (Default:\code{1})} +} +\description{ +\code{impulseest} is used to estimate impulse response coefficients from +the data +} +\details{ +The IR Coefficients are estimated using linear least squares. Future +Versions will provide support for multivariate data. +} +\examples{ +uk <- rnorm(1000,1) +yk <- filter (uk,c(0.9,-0.4),method="recursive") + rnorm(1000,1) +data <- idframe(output=data.frame(yk),input=data.frame(uk)) +fit <- impulseest(data) +impulseplot(fit) + +} +\references{ +Arun K. Tangirala (2015), \emph{Principles of System Identification: +Theory and Practice}, CRC Press, Boca Raton. Sections 17.4.11 and 20.2 +} +\seealso{ +\code{\link{step}} +} + diff --git a/man/impulseplot.Rd b/man/impulseplot.Rd new file mode 100644 index 0000000..0e7ced3 --- /dev/null +++ b/man/impulseplot.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/nonparam.R +\name{impulseplot} +\alias{impulseplot} +\title{Impulse Response Plots} +\usage{ +impulseplot(model, sd = 2) +} +\arguments{ +\item{model}{an object of class \code{impulseest}} + +\item{sd}{standard deviation of the confidence region (Default: \code{2})} +} +\description{ +Plots the estimated IR coefficients along with the significance limits +at each lag. +} +\seealso{ +\code{\link{impulseest}},\code{\link{step}} +} + diff --git a/man/inputData.Rd b/man/inputData.Rd new file mode 100644 index 0000000..5164aa8 --- /dev/null +++ b/man/inputData.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ioNamesData.R +\name{inputData} +\alias{inputData} +\alias{inputData.idframe} +\alias{outputData} +\alias{outputData.idframe} +\title{Output or Input-data} +\usage{ +inputData(x, series) +} +\arguments{ +\item{x}{\code{idframe} object} + +\item{series}{the indices to extract} +} +\description{ +Extract output-data or input-data in idframe objects +} + diff --git a/man/inputNames-set.Rd b/man/inputNames-set.Rd new file mode 100644 index 0000000..7584a55 --- /dev/null +++ b/man/inputNames-set.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ioNamesData.R +\name{inputNames<-} +\alias{inputNames} +\alias{inputNames<-} +\alias{inputNames<-.idframe} +\alias{outputNames} +\alias{outputNames<-} +\alias{outputNames<-.idframe} +\title{Extract or set series' names} +\usage{ +inputNames(x) <- value +} +\arguments{ +\item{x}{\code{idframe} object} + +\item{value}{vector of strings} +} +\description{ +Extract or set names of series in input or output +} + diff --git a/man/iv.Rd b/man/iv.Rd new file mode 100644 index 0000000..91a4340 --- /dev/null +++ b/man/iv.Rd @@ -0,0 +1,52 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/iv.R +\name{iv} +\alias{iv} +\title{ARX model estimation using instrumental variable method} +\usage{ +iv(z, order = c(0, 1, 0), x = NULL) +} +\arguments{ +\item{z}{an idframe object containing the data} + +\item{order}{Specification of the orders: the three integer components +(na,nb,nk) are the order of polynolnomial A, (order of polynomial B + 1) +and the input-output delay} + +\item{x}{instrument variable matrix. x must be of the same size as the output +data. (Default: \code{NULL})} +} +\value{ +An object of class \code{estpoly} containing the following elements: + \item{sys}{an \code{idpoly} object containing the + fitted ARX coefficients} + \item{fitted.values}{the predicted response} + \item{residuals}{the residuals} + \item{input}{the input data used} + \item{call}{the matched call} + \item{stats}{A list containing the following fields: \cr + \code{vcov} - the covariance matrix of the fitted coefficients \cr + \code{sigma} - the standard deviation of the innovations\cr + \code{df} - the residual degrees of freedom} +} +\description{ +Estimates an ARX model of the specified order from input-output data using +the instrument variable method. If arbitrary instruments are not supplied +by the user, the instruments are generated using the arx routine +} +\examples{ +data(arxsim) +mod_iv <- iv(arxsim,c(2,1,1)) + +} +\references{ +Arun K. Tangirala (2015), \emph{Principles of System Identification: +Theory and Practice}, CRC Press, Boca Raton. Sections 21.7.1, 21.7.2 + +Lennart Ljung (1999), \emph{System Identification: Theory for the User}, +2nd Edition, Prentice Hall, New York. Section 7.6 +} +\seealso{ +\code{\link{arx}}, \code{\link{iv4}} +} + diff --git a/man/iv4.Rd b/man/iv4.Rd new file mode 100644 index 0000000..77b794c --- /dev/null +++ b/man/iv4.Rd @@ -0,0 +1,55 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/iv.R +\name{iv4} +\alias{iv4} +\title{ARX model estimation using four-stage instrumental variable method} +\usage{ +iv4(z, order = c(0, 1, 0)) +} +\arguments{ +\item{z}{an idframe object containing the data} + +\item{order}{Specification of the orders: the three integer components +(na,nb,nk) are the order of polynolnomial A, (order of polynomial B + 1) +and the input-output delay} +} +\value{ +An object of class \code{estpoly} containing the following elements: + \item{sys}{an \code{idpoly} object containing the + fitted ARX coefficients} + \item{fitted.values}{the predicted response} + \item{residuals}{the residuals} + \item{input}{the input data used} + \item{call}{the matched call} + \item{stats}{A list containing the following fields: \cr + \code{vcov} - the covariance matrix of the fitted coefficients \cr + \code{sigma} - the standard deviation of the innovations\cr + \code{df} - the residual degrees of freedom} +} +\description{ +Estimates an ARX model of the specified order from input-output data using +the instrument variable method. The estimation algorithm is insensitive to +the color of the noise term. +} +\details{ +Estimation is performed in 4 stages. The first stage uses the arx function. The resulting model generates the +instruments for a second-stage IV estimate. The residuals obtained from this model are modeled using a sufficently +high-order AR model. At the fourth stage, the input-output data is filtered through this AR model and then subjected +to the IV function with the same instrument filters as in the second stage. +} +\examples{ +mod_dgp <- idpoly(A=c(1,-0.5),B=c(0.6,-.2),C=c(1,0.6),ioDelay = 2,noiseVar = 0.1) +u <- idinput(400,"prbs") +y <- sim(mod_dgp,u,addNoise=TRUE) +z <- idframe(y,u) +mod_iv4 <- iv4(z,c(1,2,2)) + +} +\references{ +Lennart Ljung (1999), \emph{System Identification: Theory for the User}, +2nd Edition, Prentice Hall, New York. Section 15.3 +} +\seealso{ +\code{\link{arx}}, \code{\link{iv4}} +} + diff --git a/man/misdata.Rd b/man/misdata.Rd new file mode 100644 index 0000000..a6d4df8 --- /dev/null +++ b/man/misdata.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/preprocess.R +\name{misdata} +\alias{misdata} +\title{Replace Missing Data by Interpolation} +\usage{ +misdata(data) +} +\arguments{ +\item{data}{an object of class \code{idframe}} +} +\value{ +data (an idframe object) with missing data replaced. +} +\description{ +Function for replacing missing values with interpolated ones. This is an +extension of the \code{na.approx} function from the \code{zoo} package. +The missing data is indicated using the value \emph{NA}. +} +\examples{ +data(cstr_mis) +summary(cstr_mis) # finding out the number of NAs +cstr <- misdata(cstr_mis) + +} +\seealso{ +\code{\link[zoo]{na.approx}} +} + diff --git a/man/nInputSeries.Rd b/man/nInputSeries.Rd new file mode 100644 index 0000000..7f7feed --- /dev/null +++ b/man/nInputSeries.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ioNamesData.R +\name{nInputSeries} +\alias{nInputSeries} +\alias{nOutputSeries} +\title{Number of series in input or output} +\usage{ +nInputSeries(data) +} +\arguments{ +\item{data}{\code{idframe} object} +} +\description{ +Number of series in input or output in a idframe object +} + diff --git a/man/oe.Rd b/man/oe.Rd new file mode 100644 index 0000000..f5a56bc --- /dev/null +++ b/man/oe.Rd @@ -0,0 +1,70 @@ +% Generated by roxygen2: 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, 1, 0), init_sys = NULL, options = optimOptions()) +} +\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} + +\item{init_sys}{Linear polynomial model that configures the initial parameterization. +Must be an OE model. Overrules the \code{order} argument} + +\item{options}{Estimation Options, setup using +\code{\link{optimOptions}}} +} +\value{ +An object of class \code{estpoly} containing the following elements: + \item{sys}{an \code{idpoly} object containing the + fitted OE coefficients} + \item{fitted.values}{the predicted response} + \item{residuals}{the residuals} + \item{input}{the input data used} + \item{call}{the matched call} + \item{stats}{A list containing the following fields: \cr + \code{vcov} - the covariance matrix of the fitted coefficients \cr + \code{sigma} - the standard deviation of the innovations} + \item{options}{Option set used for estimation. If no + custom options were configured, this is a set of default options} + \item{termination}{Termination conditions for the iterative + search used for prediction error minimization: + \code{WhyStop} - Reason for termination \cr + \code{iter} - Number of Iterations \cr + \code{iter} - Number of Function Evaluations } +} +\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) +\cr +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(oesim,end=1533) # training set +mod_oe <- oe(z,c(2,1,2)) +mod_oe +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 +} + diff --git a/man/oesim.Rd b/man/oesim.Rd new file mode 100644 index 0000000..7ecf0a7 --- /dev/null +++ b/man/oesim.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{oesim} +\alias{oesim} +\title{Data simulated from an OE model} +\format{an \code{idframe} object with 2555 samples, one input and one +output} +\usage{ +oesim +} +\description{ +This dataset contains 2555 samples simulated from the following OE model: +\deqn{ + y[k] = \frac{0.6q^{-2} - 0.2q^{-3}}{1 - 0.5q^{-1}} u[k] + e[k] +} +} +\details{ +The model is simulated with a 2555 samples long full-band PRBS input. +The noise variance is set to 0.1 +} +\keyword{datasets} + diff --git a/man/optimOptions.Rd b/man/optimOptions.Rd new file mode 100644 index 0000000..1d77f64 --- /dev/null +++ b/man/optimOptions.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/estUtil.R +\name{optimOptions} +\alias{optimOptions} +\title{Create optimization options} +\usage{ +optimOptions(tol = 0.01, maxIter = 20, LMinit = 0.01, LMstep = 2, + display = c("off", "on")[1]) +} +\arguments{ +\item{tol}{Minimum 2-norm of the gradient (Default: \code{1e-2})} + +\item{maxIter}{Maximum number of iterations to be performed} + +\item{LMinit}{Starting value of search-direction length +in the Levenberg-Marquardt method (Default: \code{0.01})} + +\item{LMstep}{Size of the Levenberg-Marquardt step (Default: \code{2})} + +\item{display}{Argument whether to display iteration details or not +(Default: \code{"off"})} +} +\description{ +Specify optimization options that are to be passed to the +numerical estimation routines +} + diff --git a/man/plot.idframe.Rd b/man/plot.idframe.Rd new file mode 100644 index 0000000..2e7948d --- /dev/null +++ b/man/plot.idframe.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/idframe.R +\name{plot.idframe} +\alias{plot.idframe} +\title{Plotting idframe objects} +\usage{ +\method{plot}{idframe}(x, col = "steelblue", lwd = 1, main = NULL, + size = 12, ...) +} +\arguments{ +\item{x}{an \code{idframe} object} + +\item{col}{line color, to be passed to plot.(Default=\code{"steelblue"})} + +\item{lwd}{line width, in millimeters(Default=\code{1})} + +\item{main}{the plot title. (Default = \code{NULL})} + +\item{size}{text size (Default = \code{12})} + +\item{\ldots}{additional arguments} +} +\description{ +Plotting method for objects inherting from class \code{idframe} +} +\examples{ +data(cstr) +plot(cstr,col="blue") + +} + diff --git a/man/plot.idfrd.Rd b/man/plot.idfrd.Rd new file mode 100644 index 0000000..435f6d7 --- /dev/null +++ b/man/plot.idfrd.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/idframe.R +\name{plot.idfrd} +\alias{plot.idfrd} +\title{Plotting idfrd objects} +\usage{ +\method{plot}{idfrd}(x, col = "steelblue", lwd = 1, ...) +} +\arguments{ +\item{x}{An object of class \code{idframe}} + +\item{col}{a specification for the line colour (Default : \code{" +steelblue"})} + +\item{lwd}{the line width, a positive number, defaulting to 1} + +\item{\ldots}{additional arguments} +} +\description{ +Generates the bode plot of the given frequency response data. It uses the +ggplot2 plotting engine +} +\examples{ +data(frd) +plot(frd) + +} +\seealso{ +\code{\link[ggplot2]{ggplot}} +} + diff --git a/man/predict.estpoly.Rd b/man/predict.estpoly.Rd new file mode 100644 index 0000000..53371e6 --- /dev/null +++ b/man/predict.estpoly.Rd @@ -0,0 +1,38 @@ +% 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}(object, newdata = NULL, nahead = 1, ...) +} +\arguments{ +\item{object}{\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}.} + +\item{\ldots}{other arguments} +} +\value{ +Time-series containing the predictions +} +\description{ +Predicts the output of an identified model (\code{estpoly}) object K steps ahead. +} +\examples{ +data(arxsim) +mod1 <- oe(arxsim,c(2,1,1)) +Yhat <- predict(mod1,arxsim) # 1-step ahead predictions +Yhat_2 <- predict(mod1,arxsim,nahead=2) # 2-step ahead predictions +Yhat_inf <- predict(mod1,arxsim,nahead=Inf) # Infinite-step ahead predictions + +} +\references{ +Arun K. Tangirala (2015), \emph{Principles of System Identification: Theory +and Practice}, CRC Press, Boca Raton. Chapter 18 +} + diff --git a/man/rarx.Rd b/man/rarx.Rd new file mode 100644 index 0000000..1d0bac4 --- /dev/null +++ b/man/rarx.Rd @@ -0,0 +1,55 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/rarx.R +\name{rarx} +\alias{rarx} +\title{Estimate parameters of ARX recursively} +\usage{ +rarx(x, order = c(1, 1, 1), lambda = 0.95) +} +\arguments{ +\item{x}{an object of class \code{idframe}} + +\item{order}{Specification of the orders: the three integer components +(na,nb,nk) are the order of polynolnomial A, (order of polynomial B + 1) and +the input-output delay} + +\item{lambda}{Forgetting factor(Default=\code{0.95})} +} +\value{ +A list containing the following objects +\describe{ + \item{theta}{Estimated parameters of the model. The \eqn{k^{th}} + row contains the parameters associated with the \eqn{k^{th}} + sample. Each row in \code{theta} has the following format: \cr + theta[i,:]=[a1,a2,...,ana,b1,...bnb] + } + \item{yhat}{Predicted value of the output, according to the + current model - parameters based on all past data} +} +} +\description{ +Estimates the parameters of a single-output ARX model of the +specified order from data using the recursive weighted least-squares +algorithm. +} +\examples{ +Gp1 <- idpoly(c(1,-0.9,0.2),2,ioDelay=2,noiseVar = 0.1) +Gp2 <- idpoly(c(1,-1.2,0.35),2.5,ioDelay=2,noiseVar = 0.1) +uk = idinput(2044,'prbs',c(0,1/4)); N = length(uk); +N1 = round(0.35*N); N2 = round(0.4*N); N3 = N-N1-N2; +yk1 <- sim(Gp1,uk[1:N1],addNoise = TRUE) +yk2 <- sim(Gp2,uk[N1+1:N2],addNoise = TRUE) +yk3 <- sim(Gp1,uk[N1+N2+1:N3],addNoise = TRUE) +yk <- c(yk1,yk2,yk3) +z <- idframe(yk,uk,1) +g(theta,yhat) \%=\% rarx(z,c(2,1,2)) + +} +\references{ +Arun K. Tangirala (2015), \emph{Principles of System Identification: +Theory and Practice}, CRC Press, Boca Raton. Section 25.1.3 + +Lennart Ljung (1999), \emph{System Identification: Theory for the User}, +2nd Edition, Prentice Hall, New York. Section 11.2 +} + diff --git a/man/read.idframe.Rd b/man/read.idframe.Rd new file mode 100644 index 0000000..9d821b8 --- /dev/null +++ b/man/read.idframe.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/readData.R +\name{read.idframe} +\alias{read.idframe} +\title{Data input into a idframe object} +\usage{ +read.idframe(data, ninputs = NULL, Ts = 1, unit = c("seconds", "minutes", + "hours", "days")[1]) +} +\arguments{ +\item{data}{a \code{data.frame} object} + +\item{ninputs}{the number of input columns. (Default: 0)} + +\item{Ts}{sampling interval (Default: 1)} + +\item{unit}{Time Unit (Default: "seconds")} +} +\value{ +an idframe object +} +\description{ +Read the contents of a data.frame/matrix into a \code{idframe} object. +} +\examples{ +data(cstrData) +data <- read.idframe(cstrData,ninputs=1,Ts= 1,unit="minutes") + +} + diff --git a/man/read.table.idframe.Rd b/man/read.table.idframe.Rd new file mode 100644 index 0000000..ca80a4c --- /dev/null +++ b/man/read.table.idframe.Rd @@ -0,0 +1,50 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/readData.R +\name{read.table.idframe} +\alias{read.table.idframe} +\title{Read the contents of a table-formatted file} +\usage{ +read.table.idframe(file, header = TRUE, sep = ",", ninputs = 0, Ts = 1, + unit = c("seconds", "minutes", "hours", "days")[1], ...) +} +\arguments{ +\item{file}{the path to the file to read} + +\item{header}{a logical value indicating whether the first row corresponding to +the first element of the rowIndex vector contains the names of the variables. +(Default: \code{TRUE})} + +\item{sep}{the field separator character. Values on each line of the file are +separated by this character. (Default: \code{","})} + +\item{ninputs}{the number of input columns. (Default: 0)} + +\item{Ts}{sampling interval (Default: 1)} + +\item{unit}{Time Unit (Default: "seconds")} + +\item{...}{additional arguments to be passed to the \code{\link[utils]{read.table}} function} +} +\value{ +an idframe object +} +\description{ +Read the contents of an file in table format into a \code{idframe} object. +} +\details{ +The \code{read.table.idframe} function uses the \code{\link[utils]{read.table}} function, +provided by the \pkg{utils} package, to read data from a table-formatted file and then calls the +\code{\link{read.idframe}} function to read the data into a idframe object +} +\examples{ +dataMatrix <- data.frame(matrix(rnorm(1000),ncol=5)) +colnames(dataMatrix) <- c("u1","u2","y1","y2","y3") +write.csv(dataMatrix,file="test.csv",row.names=FALSE) + +data <- read.table.idframe("test.csv",ninputs=2,unit="minutes") + +} +\seealso{ +\code{\link[utils]{read.table}} +} + diff --git a/man/residplot.Rd b/man/residplot.Rd new file mode 100644 index 0000000..b9509c9 --- /dev/null +++ b/man/residplot.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/estpoly.R +\name{residplot} +\alias{residplot} +\title{Plot residual characteristics} +\usage{ +residplot(model, newdata = NULL) +} +\arguments{ +\item{model}{estimated polynomial model} + +\item{newdata}{an optional dataset on which predictions are to be computed. If +not supplied, predictions are computed on the training dataset.} +} +\description{ +Computes the 1-step ahead prediction errors (residuals) for an estimated polynomial +model, and plots auto-correlation of the residuals and the +cross-correlation of the residuals with the input signals. +} + diff --git a/man/sim.Rd b/man/sim.Rd new file mode 100644 index 0000000..a40ba29 --- /dev/null +++ b/man/sim.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sim.R +\name{sim} +\alias{sim} +\title{Simulate response of dynamic system} +\usage{ +sim(model, input, addNoise = F, innov = NULL, seed = NULL) +} +\arguments{ +\item{model}{the linear system to simulate} + +\item{input}{a vector/matrix containing the input} + +\item{addNoise}{logical variable indicating whether to add noise to the +response model. (Default: \code{FALSE})} + +\item{innov}{an optional times series of innovations. If not supplied (specified +as \code{NULL}), gaussian white noise is generated, with the variance specified in +the model (Property: \code{noiseVar})} + +\item{seed}{integer indicating the seed value of the random number generator. +Useful for reproducibility purposes.} +} +\value{ +a vector containing the simulated output +} +\description{ +Simulate the response of a system to a given input +} +\details{ +The routine is currently built only for SISO systems. Future versions will +include support for MIMO systems. +} +\examples{ +# ARX Model +u <- idinput(300,"rgs") +model <- idpoly(A=c(1,-1.5,0.7),B=c(0.8,-0.25),ioDelay=1, +noiseVar=0.1) +y <- sim(model,u,addNoise=TRUE) + +} + diff --git a/man/spa.Rd b/man/spa.Rd new file mode 100644 index 0000000..306189f --- /dev/null +++ b/man/spa.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/nonparam.R +\name{spa} +\alias{spa} +\title{Estimate frequency response} +\usage{ +spa(x, winsize = NULL, freq = NULL) +} +\arguments{ +\item{x}{an \code{idframe} object} + +\item{winsize}{lag size of the Hanning window (Default: \code{min +(length(x)/10,30)})} + +\item{freq}{frequency points at which the response is evaluated +(Default: \code{seq(1,128)/128*pi/Ts})} +} +\value{ +an \code{idfrd} object containing the estimated frequency response +and the noise spectrum +} +\description{ +Estimates frequency response and noise spectrum from data with +fixed resolution using spectral analysis +} +\examples{ +data(arxsim) +frf <- spa(arxsim) + +} +\references{ +Arun K. Tangirala (2015), \emph{Principles of System Identification: +Theory and Practice}, CRC Press, Boca Raton. Sections 16.5 and 20.4 +} + diff --git a/man/step.Rd b/man/step.Rd new file mode 100644 index 0000000..a4c547d --- /dev/null +++ b/man/step.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/nonparam.R +\name{step} +\alias{step} +\title{Step Response Plots} +\usage{ +step(model) +} +\arguments{ +\item{model}{an object of class \code{impulseest}} +} +\description{ +Plots the step response of a system, given the IR model +} +\examples{ +uk <- rnorm(1000,1) +yk <- filter (uk,c(0.9,-0.4),method="recursive") + rnorm(1000,1) +data <- idframe(output=data.frame(yk),input=data.frame(uk)) +fit <- impulseest(data) +step(fit) + +} +\seealso{ +\code{\link{impulseest}} +} + diff --git a/man/time.Rd b/man/time.Rd new file mode 100644 index 0000000..91ba6c6 --- /dev/null +++ b/man/time.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/idframe.R +\name{time} +\alias{deltat} +\alias{frequency} +\alias{time} +\title{Sampling times of IO data + +\code{time} creates the vector of times at which data was sampled. \code{frequency} returns the number of damples per unit time and \code{deltat} the time-interval +between observations} +\usage{ +time(x) +} +\arguments{ +\item{x}{a idframe object, or a univariate or multivariate time-series, or a vector or matrix} +} +\description{ +Sampling times of IO data + +\code{time} creates the vector of times at which data was sampled. \code{frequency} returns the number of damples per unit time and \code{deltat} the time-interval +between observations +} + |