How do I maximize a function in Mathematica which takes in a variable length list as input?
Posted
by Mike
on Stack Overflow
See other posts from Stack Overflow
or by Mike
Published on 2009-09-07T20:00:51Z
Indexed on
2010/04/23
13:13 UTC
Read the original article
Hit count: 275
mathematica
I have a time-series like function which gives an output based on a list of real numbers(i.e. you can run the function on a list of 1,2,3,... real numbers). The issue I'm encountering is how to maximize the function for a given list length(subject to a set of constraints). I could fix the function to a fixed number of real numbers(i.e. f [x_Real, y_Real] instead of f[x_List]) and treat x and y as the first two elements of the list, and call Maximize on the function, but this is not really elegant. I want to be able to easily change the number of elements in the list.
What is the best way to optimize a function like I described, which takes a list as an argument, for a fixed list length?
© Stack Overflow or respective owner