MoTBFs (version 1.4.1)

plotConditional: 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().

Value

A plot of the conditional density function.

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.

See Also

conditionalMethod

Examples

Run this code
# NOT RUN {
## 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)

# }

Run the code above in your browser using DataLab