if (FALSE) {
emu <- vec2par(c(.19,2.3), type="emu")
lmomemu(emu)
par <- vec2par(c(.67, .5), type="emu")
lmomemu(par)$lambdas
cdf2lmoms(par, nmom=4)$lambdas
system.time(lmomemu(par))
system.time(cdf2lmoms(par, nmom=4))
# This extensive sequence of operations provides very important
# perspective on the L-moment ratio diagram of L-skew and L-kurtosis.
# But more importantly this example demonstrates the L-moment
# domain of the Kappa-Mu and Eta-Mu distributions and their boundaries.
#
t3 <- seq(-1,1,by=.0001)
plotlmrdia(lmrdia(), xlim=c(-0.05,0.5), ylim=c(-0.05,.2))
# The following polynomials are used to define the boundaries of
# both distributions. The applicable inequalities for these
# are not provided for these polynomials as would be in deeper
# implementation---so don't worry about wild looking trajectories.
"KMUup" <- function(t3) {
return(0.1227 - 0.004433*t3 - 2.845*t3^2 +
+ 18.41*t3^3 - 50.08*t3^4 + 83.14*t3^5 +
- 81.38*t3^6 + 43.24*t3^7 - 9.600*t3^8)}
"KMUdnA" <- function(t3) {
return(0.1226 - 0.3206*t3 - 102.4*t3^2 - 4.753E4*t3^3 +
- 7.605E6*t3^4 - 5.244E8*t3^5 - 1.336E10*t3^6)}
"KMUdnB" <- function(t3) {
return(0.09328 - 1.488*t3 + 16.29*t3^2 - 205.4*t3^3 +
+ 1545*t3^4 - 5595*t3^5 + 7726*t3^6)}
"KMUdnC" <- function(t3) {
return(0.07245 - 0.8631*t3 + 2.031*t3^2 - 0.01952*t3^3 +
- 0.7532*t3^4 + 0.7093*t3^5 - 0.2156*t3^6)}
"EMUup" <- function(t3) {
return(0.1229 - 0.03548*t3 - 0.1835*t3^2 + 2.524*t3^3 +
- 2.954*t3^4 + 2.001*t3^5 - 0.4746*t3^6)}
# Here, we are drawing the trajectories of the tabulated parameters
# and L-moments within the internal storage of lmomco.
lines(.lmomcohash$EMU_lmompara_byeta$T3,
.lmomcohash$EMU_lmompara_byeta$T4, col=7, lwd=0.5)
lines(.lmomcohash$KMU_lmompara_bykappa$T3,
.lmomcohash$KMU_lmompara_bykappa$T4, col=8, lwd=0.5)
# Draw the polynomials
lines(t3, KMUdnA(t3), lwd=4, col=2, lty=4)
lines(t3, KMUdnB(t3), lwd=4, col=3, lty=4)
lines(t3, KMUdnC(t3), lwd=4, col=4, lty=4)
lines(t3, EMUup(t3), lwd=4, col=5, lty=4)
lines(t3, KMUup(t3), lwd=4, col=6, lty=4)
}
Run the code above in your browser using DataLab