making the next meeting more productive

[This article was first published on R – Xi'an's Og, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

One of the students’ requests I almost invariably reject is code debugging (and they are warned about it from the start). Here is an illustration why, with an R code sent by a student working this summer on the standard estimators of a Cauchy location parameter, asking for debugging help in order “to make the next meeting more productive”. While I could have pointed them to at least four coding mistakes, this would not have helped them towards an autonomous resolution of the issue and it would have almost surely led to further requests for debugging. As it happened, this student showed up with running codes at the following meeting which proved most productive!

    X = rcauchy(n, location = theta, scale = 1)
    delta_function<-function(theta_lb, theta_ub, X){
      #1. delta = best equivariant
      Numerator_function<-function(theta) theta/prod((X-theta)**2 + 1)
      Denominator_function <-function(theta) 1/prod((X-theta)**2 + 1)
      M = integrate(Numerator_function, theta_lb, theta_ub)
      D = integrate(Denominator_function, theta_lb, theta_ub)   
      delta_BE = M/D

      ##2. delta = MLE
      #delta_MLE = argMin(prod((X-theta)**2 + 1)) 
    
      return (delta_BE)
    }
    delta = delta_function(X)

To leave a comment for the author, please follow the link and comment on their blog: R – Xi'an's Og.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)