This morning during the lecture on nonlinear regression, I mentioned (very) briefly the case of convex regression. Since I forgot to mention the codes in R, I will publish them here. Assume that where is some convex function. Then is convex if and only if , , Hidreth (1954) proved that ifthen is unique. Let , then where. I.e....