plotConditional: Plot Conditional Functions

View source: R/conditional.R

plotConditionalR Documentation

Plot Conditional Functions

Description

Plot conditional MoTBF densities.

Usage

plotConditional(
  conditionalFunction,
  data,
  nameChild = NULL,
  points = FALSE,
  color = NULL,
  ...
)

Arguments

conditionalFunction

the output of function conditionalMethod. A list containing the the interval of the parent and the final conditional density (MTE or MOP).

data

An object of class data.frame, corresponding to the dataset used to fit the conditional density.

nameChild

A character string, corresponding to the name of the child variable in the conditional density. By default, it is NULL.

points

A logical value. If TRUE, the sample points are overlaid.

color

If not specified, a default palette is used.

...

Additional graphical parameters passed to filled.contour().

Details

If the number of parents is greater than one, then the error message "It is not possible to plot the conditional function." is reported.

Value

A plot of the conditional density function.

See Also

conditionalMethod

Examples

## Data
X <- rnorm(1000)
Y <- rnorm(1000, mean=X)
data <- data.frame(X=X,Y=Y)
cov(data)

## Conditional Learning
parent <- "X"
child <- "Y"
intervals <- 5
potential <- "MTE"
P <- conditionalMethod(data, nameParents=parent, nameChild=child, 
numIntervals=intervals, POTENTIAL_TYPE=potential)
plotConditional(conditionalFunction=P, data=data)
plotConditional(conditionalFunction=P, data=data, points=TRUE)


MoTBFs documentation built on April 18, 2022, 5:06 p.m.