p <- c(10 , 0.1 , 0.1)
data <-rdavies(50,p)
system.time(print(maximum.likelihood(data)))
#observe how long this takes.
#The time is taken in repeated calls
#to pdavies(), which uses uniroot().
system.time(print(least.squares(data)))
#Much faster.
Run the code above in your browser using DataLab