Hi,
i'm trying to fit two correlated model with MVNpdf.
But it seems that the SIGMA of the function cannot set parameters there
mvnpdf(X,mu,SIGMA)
the model as below
%% S for dr_t
%% L for dl_t
Sx=S(1:end-1);Sy=S(2:end);Lx=L(1:end-1);Ly=L(2:end);diffL=Ly-Lx;diffS=Sy-Sx;func=@(theta) -sum(log(mvnpdf([diffL diffS], ... [theta(1)*(theta(2)-Lx)*delta_t theta(4)*(Lx-Sx)*delta_t], ... [theta(3) theta(6);theta(5) theta(6)])));param=fminsearch(func,[0.8 0.01 1 0.2 1 0]);
however, i find it doesn't work
it shows "SIGMA must be a square, symmetric, positive definite matrix" and Error in fminsearch.
Is there any solution ? Thanks !!
Best Answer