I have developed a model to replicate human behavior and in doing so, I have used several parameters. I set the parameter values manually so far, but now I want to optimize them to see what the best values are that would produce the closest output to human behavior. I am using fmincon to find the parameter value for each parameter (one parameter at a time), that minimizes my variable of interest. But I am not sure if I am using fmincon correctly. I have read the help examples a hundred times, but I just can't seem to understand the details of it. I don't understand what A, Aeq, b, beq, etc. are in my example. I don't understand if I should define a linear or nonlinear constraint. Every time I run the code, if I start the optimization with a different X0, I get drastically different optimized parameter value. And they are not even the best values all the time, because when I try the suggested optimized parameter value in the model, I see that the output of the model is not close to the behavioral data.
Could someone please help me with a more descriptive explanation of each element of the fmincon function, and what settings I should use to make sure I am doing this correctly?
right now this is my "main" script:
objective = @(x) function(x);
x0 = [0.8];
lb = ;
ub = ;
x = fmincon (objective,x0,,,,,lb,ub,);
this is my "constraint" function:
function [ c,ceq] = constraint( x )
c = x(1) - 0.99;
and function (x) is the function where the actual modeling is happening. It calculates the difference between likelihood of choice in the behavioral experiment and the likelihood of choice in the model. My aim is to find parameters that minimize this difference in the likelihood of choice between model and human behavior. Here I am just passing one parameter to be optimized, but evetually (hopefully and ideally) I'd like to be able to optimize 3-4 parameters at once.
I'd really appreciate any help for this. Thanks!