The two branches agree in value and in slope at |r| = k, both giving k^2/2 and slope k, which is what makes the loss convex and continuously differentiable.
References
Huber (1964), Annals of Mathematical Statistics 35(1):73-101. doi:10.1214/aoms/1177703732
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Hubrho(V)
#> $estimate
#> [1] 41.24341
#>
#> $loss
#> [1] 0.500000 1.785488 3.130488 4.475487 5.820487 7.165487 8.510487 9.855487
#>
#> $psi
#> [1] 1.000 1.345 1.345 1.345 1.345 1.345 1.345 1.345
#>
#> $mean_loss
#> [1] 5.155427
#>
#> $k
#> [1] 1.345
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "rho(r) = r^2/2 for |r| <= k else k(|r| - k/2), Huber (1964)"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
