Learn R Programming

VGAMextra (version 0.0-6)

UtilitiesVGAMextra: Utility Functions for the VGAMextra Package

Description

A set of common utility functions required by time series family functions at 'VGAMextra'.

Usage

Is.Numeric(x, isInteger  = FALSE, length.arg = NULL, Nnegative  = NULL)
  is.FormulaAR(Model = ~ 1, Resp  = 1) 
  cross.gammas(x, y = NULL, lags = 1)
  WN.lags(y, lags, to.complete = NULL)
  extract.Residuals(object, TSprocess,...)
  fittedVGAMextra(object,...)
  weightsVGAMextra(object, type.w = "prior",...)
  XLMmat(object,...)
  
  
  

Value

Is.Numeric() returns a logical vector (or value) (TRUE or FALSE), after verifying whether quantiles

x satisfies all conditions entered.

For is.FormulaAR(), this function returns a logical value, after verifying whether the expression entered for the Model

argument in cm.ARMA is an object of class `formula'.

Particularly, cross.gammas() computes either the single lagged covariance(s) from quantiles given in x or the lagged cross-covariance(s) from values given in x and y.

extract.Residuals() extracts the residuals of the process from slot @residuals, whilst

fittedVGAMextra and weightsVGAMextra return the fitted values and the weights from the vglm object, correspondingly.

isNA and inspectVGAMextra are essentially required when implementing link functions in VGAMextra.

Arguments

x

A vector of quantiles. Particularly, for Is.Numeric it is a single number (or vector) to be tested: Whether is numeric or not.

y

Vector of quantiles to be lagged. Then, the cross - covariances are computed from \(x\) and \(y_t\), \(x\) and \(y_{t -1}\), etcetera.

isInteger

Logical. If TRUE, it verifies that quantiles x are integers. Default is FALSE.

lags

Integer indicating the number of lags or delays to be applied to vector y. Then, calculate the cross-covariance between the pair of signals x and delayed samples computed from y.

length.arg

Integer. If length.arg > 0, it verifies that the length of x matches length.arg.

Model

Formula. A symbolic form of the models fitted by the vglm call. See formula for further details.

Nnegative

Logical. If TRUE, it verifies that x (all entries) are positive.

Resp

Integer. The number of responses in the Model. It must macth the number of respones entered in the vglm call.

object

An object of class 'vglm'. See vglm-class for details.

TSprocess

Logical, what time series model is being fitted. Choices are 'AR', 'MA', 'ARMA' and 'ARIMA'.

type.w

Character. What type of weights are to be used. Default is "prior". These are extracted from the slot @prior.weights of object.

to.complete

Use this argument to fill in the first 'p' observations when computing the lagged vectors in time series.

...

Additional parameters required by function extract.Residuals.

Author

V. Miranda and T. W. Yee.

Details

A set of utility functions in VGAMextra for different purposes.

Specially for time series family functions in VGAMextra which involve specific checks on the majority of arguments entered by the user.

See Also

cm.ARMA.

Examples

Run this code

# Example 1.
myModel1 <- ~ x1 + x2
is.FormulaAR(myModel1)       # TRUE

test <- list( cbind(y1, y2) ~ x1, ~ x2 - 1)
is.FormulaAR(test)          # FALSE
is.FormulaAR(test[[1]], 2)  # TRUE

# Example 2.

x1 <- c(1:3, 4.5, -Inf)
Is.Numeric(x1)                                        # TRUE
Is.Numeric(x1, length.arg = 5)                        # TRUE
Is.Numeric(x1, length.arg = 5, isInteger = TRUE)      # FALSE
Is.Numeric(x1, length.arg = 5, Nnegative = TRUE)      # FALSE

# Example 3. 
# Here, 'cross.gammas' computes Cov(x, y_{t - 1}), Cov(x, y_{t - 2}) and
# Cov(x, y_{t - 3}). 

x <- runif(50)
y <- runif(50)
cross.gammas(x, y, lags = 3)


Run the code above in your browser using DataLab