# NOT RUN {
# use the optimPenaLik function on a simulated dataset, with given lamda and w.
# }
# NOT RUN {
set.seed(14)
beta <- c(3, 2, -1.6, -1)
noise <- 5
simData <- SimData(N=100, beta=beta, noise=noise, corr=TRUE)
# use BFGS
before <- Sys.time()
PenalQN <- optimPenaLik(Data=simData, lamda=1.5, w=0.7,
algorithms=c("QN"))
(tot <- Sys.time()-before)
PenalQN
# use Hooke-Jeeves algorithm
before <- Sys.time()
Penalhjk <- optimPenaLik(Data=simData, lamda=1.5, w=0.7,
algorithms=c("hjk"))
(totRun <- Sys.time() - before)
# total run of approx 0.25sec
Penalhjk
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab