Reputation: 1564
I have a function
function [result] = mleGARCH1(r,a0,a1,b1,mu)
which I want to minimize with respect to all the variables apart from r which will be an input.
How should I format the fminsearch
function to obtain that?
Upvotes: 1
Views: 893
Reputation: 1214
Try an anonymous function:
[xmin result] = fminsearch(@(x) mleGARCH1(r,x(1),x(2),x(3),x(4)), [ initial values ]);
Upvotes: 3