fminsearch with integrals and parameters

4 次查看(过去 30 天)
I am new to using fminsearch in matlab. I want to find the minimum value of the following function:
where
For now, I assumed that A_t,B_t,K_t are uniform random between [0,1].
I want to find the value of debt and the value of parameters kappa, theta, chi.
I want to use fminsearch,but I am not able to write down the specification correctly.

回答(1 个)

Saarthak Gupta
Saarthak Gupta 2023-12-15
编辑:Saarthak Gupta 2023-12-15
Hi Prerna,
I understand you wish to minimize your objective function with extra parameters.
It would be helpful if you could provide the context in which the problem is defined, since the problem statement alone does not exhaustively define all variables. Moreover, it is unclear as to why At, Bt, Kt are chosen to be uniformly distributed.
One approach you could use is to parametrize the objective function using an anonymous function. Refer to the following example:
The Rosenbrock function is a non-convex function used as a performance test problem for optimization algorithms. In its two-dimensional form it is defined as:
Suppose we parametrize this function, with the parameter “a”:
This function has a minimum value of 0 at x1=a, x2=a^2
Since these parameters are not variables to optimize, they are fixed values during the optimization, and you may assign them a value of your choice. If, for example, a=3, you can include the parameter in your objective function by creating an anonymous function
% Create the objective function with its extra parameters as extra arguments.
f = @(x,a)100*(x(2) - x(1)^2)^2 + (a-x(1))^2;
% Put the parameter in your MATLAB® workspace.
a = 3;
% Create an anonymous function of x alone that includes the workspace value of the parameter.
fun = @(x)f(x,a);
% Solve the problem starting at |x0 = [-1,1.9]|.
x0 = [-0.5,2];
x = fminsearch(fun,x0)
Please refer to the following answer for solution to a similar problem: https://www.mathworks.com/matlabcentral/answers/517948
Please refer to the following MATLAB documentation for further reference:
Hope this helps!
Best regards,
Saarthak

类别

Help CenterFile Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by