Archive for summer project

apply for a Warwick Statistics summer research experience

Posted in Statistics with tags , , , , , , on November 24, 2024 by xi'an

making the next meeting more productive

Posted in Kids, R, Statistics, University life with tags , , , , , , on August 25, 2023 by xi'an

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)