plot.LogN {DELTD}R Documentation

Density Plot by Lognormal kernel

Description

Plot Kernel density by using Lognormal Kernel.

Usage

## S3 method for class 'LogN'
plot(x, ...)

Arguments

x

An object of class "LogN"

...

Not presently used in this implementation

Value

Nothing

Author(s)

Javaria Ahmad Khan, Atif Akbar.

References

Jin, X.; Kawczak, J. 2003. Birnbaum-Saunders & Lognormal kernel estimators for modeling durations in high frequency financial data. Annals of Economics and Finance 4, 103-124.

See Also

For further kernels see plot.Beta, plot.Erlang, plot.Gamma and plot.BS. To calculate MSE use mse and for estimated values for density estimation see LogN.

Examples

n <- 1000
y <- abs(rlogis(n, location = 0, scale = 1))
xx <- seq(min(y) + 0.05, max(y), length =90)
h <- 0.00003
den <- LogN(x = xx, y = y, k = 90, h = h)
plot(den, type = "l")

##other details can also be added
y <- abs(rlogis(n, location = 0, scale = 1))
h <- 3
gr <- LogN(x = xx, y = y, k = 90, h = h)
plot(gr, type = "s", ylab = "Density Function", lty = 1, xlab = "Time")

## To add true density along with estimated
d1 <- density(y, bw = h)
lines(d1, type = "p", col = "green")
legend("topleft", c("Real Density", "Density by Lognormal Kernel"),
col = c("green", "black"), lty = c(1,2))

[Package DELTD version 2.6.8 Index]