Learn R Programming

cnmlcd (version 1.2-0)

plotgradient: Plot Gradient Curve

Description

Plots the gradient curve that corresponds to a log-concave dnesity and a data set.

Usage

plotgradient(lcd, x, w = NULL, col="blue", knotcol=col, pch=1,
             lwd=1, lty=1, ...)

Arguments

lcd

an object of class lcd.

x

a vector storing the observations.

w

a vector of frequencies (weights) of values stored in x. If w=NULL, w = 1 is used for each value in x.

col

color of lines.

knotcol

color of knots.

pch

point type for knots.

lwd

width for the gradient curve.

lty

line type for the gradient curve.

...

further arguments passed to or from other methods.

See Also

cnmlcd, lcd, new.lcd, x.weight.

Examples

Run this code
# NOT RUN {
data(logreturn)
r = cnmlcd(logreturn)
plot(r$lcd, logreturn)            # Density
plotgradient(r$lcd, logreturn)    # Gradient
# }

Run the code above in your browser using DataLab