# NOT RUN {
# }
# NOT RUN {
x <- seq( 0, 100, length=100)
# ------ UNIFORM
# Plots showing effects of parameter a
plot(x, uniform.like(c(25,15), x))
plot(x, uniform.like(c(75,15), x))
# Plots showing effects of parameter b
plot(x, uniform.like(c(50,20), x))
plot(x, uniform.like(c(50,0.5), x))
# Plots showing effects of expansion terms
plot(x, uniform.like(c(50,20,3), x, expansions=1))
plot(x, uniform.like(c(50,20,3,-3), x, expansions=2))
plot(x, uniform.like(c(50,20,3), x, expansions=1, series="hermite"))
# ------ HALF-NORMAL
# Plots showing effects of parameter a
plot(x, halfnorm.like(c(25), x))
plot(x, halfnorm.like(c(75), x))
# Plots showing effects of expansion terms
plot(x, halfnorm.like(c(50,3), x, expansions=1))
plot(x, halfnorm.like(c(50,3,-3), x, expansions=2))
plot(x, halfnorm.like(c(50,3), x, expansions=1, series="hermite"))
# ------ NEGATIVE EXPONENTIAL
# Plots showing effects of parameter a
plot(x, negexp.like(c(25), x))
plot(x, negexp.like(c(75), x))
# Plots showing effects of expansion terms
plot(x, negexp.like(c(50,3), x, expansions=1))
plot(x, negexp.like(c(50,3,-3), x, expansions=2))
plot(x, negexp.like(c(50,3), x, expansions=1, series="hermite"))
# ------ HAZARD RATE
# Plots showing effects of parameter a
plot(x, hazrate.like(c(25,25), x))
plot(x, hazrate.like(c(75,25), x))
# Plots showing effects of parameter b
plot(x, hazrate.like(c(50,20), x))
plot(x, hazrate.like(c(50,0.5), x))
# Plots showing effects of expansion terms
plot(x, hazrate.like(c(50,25,3), x, expansions=1))
plot(x, hazrate.like(c(50,25,3,-3), x, expansions=2))
plot(x, hazrate.like(c(50,25,3), x, expansions=1, series="hermite"))
# ------ Estimate distance functions and plot
# Generate half-norm data
set.seed(8383838)
x <- rnorm(1000) * 100
x <- x[ 0 < x & x < 100 ]
un.dfunc <- F.dfunc.estim( x, likelihood="uniform", w.hi = 100)
hn.dfunc <- F.dfunc.estim( x, likelihood="halfnorm", w.hi = 100)
ne.dfunc <- F.dfunc.estim( x, likelihood="negexp", w.hi = 100)
hz.dfunc <- F.dfunc.estim( x, likelihood="hazrate", w.hi = 100)
par(mfrow=c(2,2))
plot(un.dfunc)
plot(hn.dfunc)
plot(ne.dfunc)
plot(hz.dfunc)
# }
Run the code above in your browser using DataLab