MoTBFs (version 1.2)

rnormMultiv: Multivariate Normal Sample

Description

Generate a multivariate normal data vector taking into account the real data and the relationships with other variables in the dataset.

Usage

rnormMultiv(n, dataParents, dataChild)

Arguments

n

A "numeric" value which is the size of the prior data to generate.

dataParents

A data set of class "data.frame" giving the data of the set of coditional parent variables.

dataChild

A "numeric" vector containing the original data of the child variable.

Value

A "numeric" vector giving the prior data values.

See Also

generateNormalPriorData

Examples

Run this code
# NOT RUN {
## Data
data(ecoli)
data <- ecoli[,-c(1,9)] ## remove sequece.name and class

## DAG
dag <- LearningHC(data)
plot(dag)
getChildParentsFromGraph(dag)

## 1. Random sample
parents <- "mcg"
child <- "alm1"
n <- 1000
rnormMultiv(n, dataParents = data.frame(data[,parents]), dataChild = data[,child])

## 2. Random sample
parents <- "alm1"
child <- "aac"
n <- 256
rnormMultiv(n, dataParents = data.frame(data[,parents]), dataChild = data[,child])

# }

Run the code above in your browser using DataCamp Workspace