Info

此问题已关闭。 请重新打开它进行编辑或回答。

Calculate Numerical hessian of predefined function

1 次查看(过去 30 天)
I have the following function with two variables alha and beta :
function MSE=mseFunction(alpha,beta,Donnee_6_jours)
moyenneMobile=zeros(240,1);
%Calcul de la moyenne mobile
for i=1:240
moyenneMobile(i)=1/48.*((Donnee_6_jours(i)/2)+sum(Donnee_6_jours(i+1:i+47))+(Donnee_6_jours(i+48)/2));
end
moyenneMobileCentree = padarray(moyenneMobile,24,'both');
composanteSaisonniaire=Donnee_6_jours(25:264)./moyenneMobileCentree(25:264);
composanteSaisonniaireV2 = padarray(composanteSaisonniaire,24,'both');
MatriceComposanteSaisonniaire = reshape(composanteSaisonniaireV2,[48,6]);
MatriceComposanteSaisonniaire(1:24,1)=NaN;
MatriceComposanteSaisonniaire(25:48,6)=NaN;
MedianneComposantsSaisonniers = nanmedian(MatriceComposanteSaisonniaire,2);
LES=zeros(288,1);
LES(25)=moyenneMobileCentree(25);
for i=26:264;
LES(i)=alpha.*moyenneMobileCentree(i)+(1-alpha).*LES(i-1);
end
S=zeros(264,1);
S(1:48,:)=MedianneComposantsSaisonniers;
for j=49:264;
S(j)=beta.*(Donnee_6_jours(j)./LES(j))+(1-beta).*S(j-48);
end
PREV=zeros(264,1);
PREV(26:264)=S(26:264).*LES(25:263);
PREV2=padarray(PREV(:),24,'post');
MSE = mean((Donnee_6_jours(26:264)-PREV2(26:264)).^2);
is there a way in Matlab to calculate the numerical hessian of this function?
Thanks!

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by