Answers for "r optim"

R
1

r optim

# Optimize the metric
optim(
  # Initially guess 0 intercept and 0 slope
  par = c(intercept = 0, slope = 0), 
  # Use calc_sum_of_squares as the optimization function
  fn = calc_sum_of_squares
)
Posted by: Guest on December-29-2021

Browse Popular Code Answers by Language