diff options
-rw-r--r-- | R/poly.R | 30 | ||||
-rw-r--r-- | man/idpoly.Rd | 43 | ||||
-rw-r--r-- | man/sim.Rd | 31 |
3 files changed, 104 insertions, 0 deletions
@@ -1,3 +1,33 @@ +#' Polynomial model with identifiable parameters +#' +#' Creates a polynomial model with identifiable coefficients +#' +#' @param A Autoregressive coefficients +#' @param B,F1 Coefficients of the numerator and denominator respectively +#' of the deterministic model between the input and output +#' @param C,D Coefficients of the numerator and denominator respectively +#' of the stochastic model +#' @param ioDelay the delay in the input-output channel +#' @param Ts sampling interval +#' +#' @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) +#' +#' # define box-jenkins model +#' 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) +#' #' @export idpoly <- function(A=1,B=1,C=1,D=1,F1=1,ioDelay=0,Ts=1){ out <- list(A= A,B=B,C=C,D=D,F1=F1,ioDelay = ioDelay,Ts=Ts) diff --git a/man/idpoly.Rd b/man/idpoly.Rd new file mode 100644 index 0000000..98f0036 --- /dev/null +++ b/man/idpoly.Rd @@ -0,0 +1,43 @@ +% Generated by roxygen2 (4.1.1): 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) +} +\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} +} +\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) + +# define box-jenkins model +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/sim.Rd b/man/sim.Rd new file mode 100644 index 0000000..562b656 --- /dev/null +++ b/man/sim.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/sim.R +\name{sim} +\alias{sim} +\title{Simulate dynamic system} +\usage{ +sim(model, input, sigma = 0, seed = NULL) +} +\arguments{ +\item{model}{the system model to simulate} + +\item{input}{a vector/matrix containing the input} + +\item{sigma}{standard deviation of the innovations (Default= \code{0})} + +\item{seed}{integer indicating the seed value of the random number generator} +} +\value{ +a vector containing the output +} +\description{ +Simulate the response of a system given the input +} +\details{ +The routine is currently built only for SISO systems. Future Versions will +include support for MIMO systems. Current support +} +\seealso{ +\code{\link{sim.idpoly}} for simulating polynomial models +} + |