making the next meeting more productive

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)

One Response to “making the next meeting more productive”

  1. […] 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 […]

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.