Request for review of formula -> code translation

I’ve attempted to translate a previously published algorithm into R code, but I’m not sure if I’ve got it right. I’d be very grateful for some feedback. I’ve posted the algorithm and my code here: http://stats.stackexchange.com/q/249525/7744

Thanks!

Ben

thanks @benmarwick so it looks like you’ve sorted it out now given http://stats.stackexchange.com/a/249786/24293 ?

Yes, case closed! Think I’ve got it correct now.

great, glad its sorted