[R] Basic optimization question (I'm a rookie)

Bert Gunter bgunter@4567 @ending from gm@il@com
Wed Nov 28 01:31:18 CET 2018


Of course, this particular example is trivially solvable by hand: x ==y
==p/4 , a square.
Note also that optimization with equality constraints are generally
solvable by the method of Lagrange multipliers for smooth functions and
constraints, so that numerical methods may not be needed for relatively
simple cases.

Cheers,
Bert





On Tue, Nov 27, 2018 at 3:19 PM FAIL PEDIA <
soloparapaginas123456789 using gmail.com> wrote:

> Hello, and thanks to anyone who takes the time to read this
>
> I'm trying to learn to properly optimize a function with a constraint using
> R. For example, maximize the area of a terrain with a maximum perimeter.
> For this example the function would be:
>
>      Area <- function(x,y){x*y}
>
> The restriction would be the following function:
>
>      Perimeter <- function(x,y){2*(x+y)}
>
> The idea is to give a desired value to "Perimeter" and get the values of x
> & y that maximize the area and respect the constraint.
>
> I've searched online for some time, and only found a video of a dude that
> plotted the functions toggling the values to find the tangent optimum point
> (something useless, because the idea is to make the optimization more
> efficiently than using a paper and a pencil)
>
> Thanks again, and sorry if this question is silly.
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list