# NOT RUN {
set.seed(162); UV <- simCOP(n=188, cop=PLACKETTcop, para=5.6)
ML <- mleCOP(UV$U, UV$V, cop=PLACKETTcop, interval=c(0.1,40)) # 5.225459 estimated
Thetas <- 10^(seq(log10(0.001),log10(100), by=.005))
MLs <- sapply(Thetas, function(k)
densityCOP(UV$U, UV$V, cop=PLACKETTcop, para=k, sumlogs=TRUE))
plot(Thetas, MLs, log="x", type="l", # draw the pMLE solution process
xlab="Plackett Theta", ylab="sum of log densities")
lines(rep(ML$para, 2), c(ML$objective, par()$usr[3]), col=2) #
# }
# NOT RUN {
# }
# NOT RUN {
set.seed(149); UV <- simCOP(1000, cop=CLcop, para=pi)
# Warning messages about using optim() for 1D solution
mleCOP(UV, cop=CLcop, init.para=2)$para # 3.082031
# No warning message, optimise() called instead.
mleCOP(UV, cop=CLcop, interval=c(0,1E2))$para # 3.081699
# }
# NOT RUN {
# See extended code listings and discussion in the Note section
# }
Run the code above in your browser using DataLab