我有一个比较复杂的对数似然函数,希望能够通过Matlab做MLE,Matlab的工具包里有一个maxlik.m的函数,函数说明是这个样子的:
% PURPOSE: minimize a log likelihood function
% ------------------------------------------------------------------
% USAGE: result = maxlike(func,b,info,varargin)
% or: result = maxlike(func,b,[],varargin) for default options
% Where: func = function to be minimized
% b = parameter vector fed to func
% info structure containing optimization options
% .delta = Increment in numerical derivs [.000001]
% .hess = Hessian method: ['dfp'], 'bfgs', 'gn', 'marq', 'sd'
% .maxit = Maximium iterations [100]
% .lambda = Minimum eigenvalue of Hessian for Marquardt [.01]
% .cond = Tolerance level for condition of Hessian [1000]
% .btol = Tolerance for convergence of parm vector [1e-4]
% .ftol = Tolerance for convergence of objective function [sqrt(eps)]
% .gtol = Tolerance for convergence of gradient [sqrt(eps)]
% .prt = Printing: 0 = None, 1 = Most, 2 = All [0]
% varargin = arguments list passed to func
% ------------------------------------------------------------------
% RETURNS: results = a structure variable with fields:
% .b = parameter value at the optimum
% .hess = numerical hessian at the optimum
% .bhist = history of b at each iteration
% .f = objective function value at the optimum
% .g = gradient at the optimum
% .dg = change in gradient
% .db = change in b parameters
% .df = change in objective function
% .iter = # of iterations taken
% .meth = 'dfp', 'bfgs', 'gn', 'marq', 'sd' (from input)
% .time = time (in seconds) needed to find solution
我想问一些其中的func是不是要传递一个函数句柄?比方说我的似然函数是L,是不是这里应该用@L?
b应该是待估参数向量吧,比方说我的待估参数有两个sigma和mu,是不是应该用[sigma,miu]?
最后那里的varargin位置怎么填呢?是不是把似然函数里边除了待估参数外的其他变量的符号用[]括起来然后填进去?
这个maxlik函数我没有用过,求各位高手一定帮帮忙啊!!!
[此贴子已经被作者于2005-12-7 17:01:41编辑过]