dmvfplot: Draw a graph of diff of mean value functions on discrete time...

View source: R/plot.R

dmvfplotR Documentation

Draw a graph of diff of mean value functions on discrete time domain

Description

This function draws a graph of mean value function with data and NHPP classes.

Usage

dmvfplot(
  time = NULL,
  fault = NULL,
  type = NULL,
  te = NULL,
  data = data.frame(),
  srms = list(),
  xlab = "time",
  ylab = "# of faults",
  datalab = "data",
  xmax = NA,
  ymax = NA,
  colors = mmcolors,
  ...
)

Arguments

time

A numeric vector for time intervals.

fault

An integer vector for the number of faults detected in time intervals. The fault detected just at the end of time interval is not counted.

type

Either 0 or 1. If 1, a fault is detected just at the end of corresponding time interval. This is used to represent the fault time data. If 0, no fault is detected at the end of interval.

te

A numeric value for the time interval from the last fault to the observation time.

data

A dataframe. The arguments; time, fault, type, te can also be selected as the columns of dataframe.

srms

A list of estimated results.

xlab

A character string, indicating the label of x-axis.

ylab

A character string, indicating the label of y-axis.

datalab

A character string, indicating the label of data in legend.

xmax

A numeric value, indicating the maximum value of xlim. If NA, the maximum value is automatically determined.

ymax

A numeric value, indicating the maximum value of ylim. If NA, the maximum value is automatically determined.

colors

A vector of strings, indicating the colors in plot.

...

Other parameters.

Details

The return value is an object of ggplot2, and thus a line is added like dmvfplot(...) + geom_point(stat="identity", position="identity", aes_string(x="x", y="exp", colour=shQuote("exp"))) + geom_line(stat="identity", position="identity", aes_string(x="x", y="exp", colour=shQuote("exp"))).

Value

An object of ggplot.

Examples

data(dacs)
result <- fit.srm.nhpp(fault=tohma, srm.names = c("exp", "gamma"),
            selection = NULL)
dmvfplot(fault=tohma, srms=result)

okamumu/Rsrat documentation built on Feb. 10, 2024, 11:07 p.m.