MoTBFs (version 1.2)

nVariables: Number of Variables in a Joint Function

Description

Compute the number of variables which are in a 'jointmotbf' object.

Usage

nVariables(P)

Arguments

P

An "motbf" object or a "jointmotbf" object.

Value

A "character" vector with the names of variables of the function.

Examples

Run this code
# NOT RUN {
# 1. EXAMPLE
## Dataset
## Load the mnormt package to generate a multinormal dataset
## Dataset
Mean <- 0; nVar <- 2; ro <- 0
varcov <- matrix(c(rep(c(1, rep(ro, nVar)), nVar-1),1), nrow=nVar)
means <- rep(Mean, nVar)
X <- rmnorm(100,means,varcov) 
data <- standardizeDataset(data.frame(X))

## Joint function
dim <-c(3,2)
param <- parametersJointMoTBF(data, dimensions = dim)
P <- jointMoTBF(param)
P

## Variables
nVariables(P)
# }
# NOT RUN {
##############################################################################
## MORE EXAMPLES #############################################################
##############################################################################
# }
# NOT RUN {
## Dataset
Mean <- 0; nVar <- 3; ro <- 0
varcov <- matrix(c(rep(c(1, rep(ro, nVar)), nVar-1),1), nrow=nVar)
means <- rep(Mean, nVar)
X <- rmnorm(100,means,varcov) 
data <- standardizeDataset(data.frame(X))

## Joint function
dim <- c(2,1,3)
param <- parametersJointMoTBF(data, dimensions = dim)
P <- jointMoTBF(param)

## Variables
nVariables(P)
# }

Run the code above in your browser using DataCamp Workspace