Do you know if there is any R package or function could help solve "min y=x^3 - 3*x^2 + 4" like the following SAS code?
proc optmodel;
var x;
min y=x**3 - 3*x**2 + 4;
solve;
print x;
quit;
PROC OPTMODEL is documented here: http://support.sas.com/documentation/cdl/en/ormpug/67517/HTML/default/viewer.htm#ormpug_optmodel_toc.htm
I am looking for the value of x that minimizes y. Thanks in advance!
optimize(function(x)x^3 - 3*x^2 + 4, interval=c(0, 5))
not good enough? – Khashaamin
on that interval. – Khashaa