Re: Cost function for a model instead of a function?
- From: "Steven Lord" <slord@xxxxxxxxxxxxx>
- Date: Fri, 11 Sep 2009 10:12:15 -0400
"Green Knight " <GreenKnight50@xxxxxxxxx> wrote in message
news:h8bvjr$2pu$1@xxxxxxxxxxxxxxxxxxxxx
Hello there and thanks for reading:
I've been using MATLAB for about one year, but do not have true knowledge
of what it is capable of. My question is regarding the availability of
any built-in functions to serve as a 'cost function' for my application.
I have a model that simulates the movement of a car on a road. The model
keeps track of the car's position (think like GPS coordinates) and then
after simulation, calculates measurements such as mean distance, maximum
drift left or right, mean velocity, drift area, etc. The simulated values
are then compared to ACTUAL car data obtained through physical
experiments. Both sets of data, the MATLAB simulated & actual real-world
data, are then passed through a T-Test to determine statistical likeness.
If all measurements (mean distance, maximum left drift, etc.) are a match,
then the model is accurate. If say, the model's 'mean velocity' fails the
T-Test (meaning it is 'off' and not accurate), however, I currently
manually adjust 1 of 25 different model parameters (raising or lowering
the value), re-run the simulation and observe the T-Test results for
similarities.
This method works, but takes a very long time, as adjusting one parameter
to fix, say, the 'mean velocity' mismatch may resolve that T-Test value,
but it may then offset another value, say 'left drift' to a T-Test
mismatch. …so I then adjust another parameter, but then three
different mismatches result and etc. etc. This often becomes a vicious
'fixing the fix' cycle, but eventually, I get all of the parameters
tweaked to result in a successful model.
QUESTION: Is there a 'cost function' available in MATLAB to help me
automatically solve for this model's parameters? I have been exploring
different solvers in the Optimization Toolbox, but these seem to require a
straight-forward FUNCTION that I cannot provide, as my equation in
question is rather a model instead.
The Optimization Toolbox solvers do not require you to be able to write down
an explicit equation for the quantity you want to optimize; as long as you
can write a function that accepts some parameters, performs some
calculations, and returns the objective value ('cost') that you're trying to
optimize, it can accept that function. [Depending on how well-behaved your
function is, the optimization problem may be easy or difficult to solve. If
your objective function "value" is rand(size(theinput)), for instance ...
then you're going to have lots of trouble.] Take a look at this example in
the documentation that doesn't have an explicit function to solve, but
instead uses a Simulink simulation to calculate the value of the "function"
to be optimized.
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brn4noo.html
If your model is a Simulink model, you might also want to look at the
Simulink Design Optimization product, as suggested by the note that's around
the middle of the above page.
http://www.mathworks.com/access/helpdesk/help/toolbox/sldo/ug/ug_intropage.html
--
Steve Lord
slord@xxxxxxxxxxxxx
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
.
- References:
- Cost function for a model instead of a function?
- From: Green Knight
- Cost function for a model instead of a function?
- Prev by Date: Re: Need help with some MATLAB coding problems
- Next by Date: Re: Exactly matching images?
- Previous by thread: Re: Cost function for a model instead of a function?
- Next by thread: Test points when calling simulink model using sim command
- Index(es):
Relevant Pages
|
Loading