-
Notifications
You must be signed in to change notification settings - Fork 1
/
tdist_noise.m
48 lines (46 loc) · 20.6 KB
/
tdist_noise.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% AUXILIARY FUNCTIONS FOR NOISE MODELS %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function varargout = tdist_noise(Y,Ym,Sigma,ind)
nu = 2;
if nargout >=1
% J_D
varargout{1} = nansum(-log(gamma(nu./2 + 1./2)./(nu.^(1./2).*pi.^(1./2).*gamma(nu./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))));
if nargout >= 2
% dJ_DdY
varargout{2} = transpose(((2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.*Sigma(ind).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)));
% dJ_DdSigma(ind)
varargout{3} = transpose(-(2.*(nu./2 + 1./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^2)./(nu.*Sigma(ind).^3.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)));
if nargout >= 4
%ddJ_DdYdY
varargout{4} = transpose((2.*(nu./2 + 1./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.*Sigma(ind).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + ((2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2))./(nu.^2.*Sigma(ind).^4.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - ((2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.^2.*Sigma(ind).^4.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)));
%ddJ_DdYdSigma(ind)
varargout{5} = transpose((2.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^2)./(nu.^2.*Sigma(ind).^5.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - (2.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^2)./(nu.^2.*Sigma(ind).^5.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (2.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.*Sigma(ind).^3.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)));
%ddJ_DdSigma(ind)dSigma(ind)
varargout{6} = transpose((6.*(nu./2 + 1./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^2)./(nu.*Sigma(ind).^4.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + (4.*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^4)./(nu.^2.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (4.*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^4)./(nu.^2.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)));
if nargout >= 7
%dddJ_DdYdYdY
varargout{7} = transpose((2.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2))./(nu.^2.*Sigma(ind).^4.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + ((8.*Y - 8.*Ym(ind)).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2))./(nu.^2.*Sigma(ind).^4.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + ((2.*Y - 2.*Ym(ind)).^3.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2))./(nu.^3.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (2.*(2.*Y - 2.*Ym(ind)).^3.*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2))./(nu.^3.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - (2.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.^2.*Sigma(ind).^4.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - ((8.*Y - 8.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.^2.*Sigma(ind).^4.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + ((2.*Y - 2.*Ym(ind)).^3.*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.^3.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)));
%dddJ_DdYdYdSigma(ind)
varargout{8} = transpose((4.*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^2)./(nu.^2.*Sigma(ind).^5.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - (4.*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^2)./(nu.^2.*Sigma(ind).^5.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (4.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2))./(nu.^2.*Sigma(ind).^5.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (4.*(nu./2 + 1./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.*Sigma(ind).^3.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + (4.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.^2.*Sigma(ind).^5.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - (2.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2).*(Y - Ym(ind)).^2)./(nu.^3.*Sigma(ind).^7.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + (4.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^2)./(nu.^3.*Sigma(ind).^7.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - (2.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^2)./(nu.^3.*Sigma(ind).^7.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)));
%dddJ_DdYdSigma(ind)dSigma(ind)
varargout{9} = transpose((6.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.*Sigma(ind).^4.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + (14.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^2)./(nu.^2.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (14.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^2)./(nu.^2.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (4.*(2.*Y - 2.*Ym(ind)).*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2).*(Y - Ym(ind)).^4)./(nu.^3.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (8.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^4)./(nu.^3.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (4.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^4)./(nu.^3.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)));
%dddJ_DdSigma(ind)dSigma(ind)dSigma(ind)
varargout{10} = transpose((36.*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^4)./(nu.^2.*Sigma(ind).^7.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - (36.*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^4)./(nu.^2.*Sigma(ind).^7.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (24.*(nu./2 + 1./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^2)./(nu.*Sigma(ind).^5.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (8.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2).*(Y - Ym(ind)).^6)./(nu.^3.*Sigma(ind).^9.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + (16.*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^6)./(nu.^3.*Sigma(ind).^9.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - (8.*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^6)./(nu.^3.*Sigma(ind).^9.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)));
if nargout >= 11
%ddddJ_DdYdYdYdY
varargout{11} = transpose((12.*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2))./(nu.^2.*Sigma(ind).^4.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (12.*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.^2.*Sigma(ind).^4.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (8.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2))./(nu.^3.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (16.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2))./(nu.^3.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + ((2.*Y - 2.*Ym(ind)).^4.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*(nu./2 - 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 5./2))./(nu.^4.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (3.*(2.*Y - 2.*Ym(ind)).^4.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2))./(nu.^4.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (3.*(2.*Y - 2.*Ym(ind)).^4.*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2))./(nu.^4.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)) + ((2.*Y - 2.*Ym(ind)).*(8.*Y - 8.*Ym(ind)).*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2))./(nu.^3.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (2.*(2.*Y - 2.*Ym(ind)).*(8.*Y - 8.*Ym(ind)).*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2))./(nu.^3.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (8.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.^3.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)) - ((2.*Y - 2.*Ym(ind)).^4.*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*(nu./2 + 7./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.^4.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 9./2)) + ((2.*Y - 2.*Ym(ind)).*(8.*Y - 8.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.^3.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)));
%ddddJ_DdYdYdYdSigma(ind)
varargout{12} = transpose((6.*gamma(nu./2 + 1./2).*(2.*Y - 2.*Ym(ind)).^3.*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2))./(nu.^(7./2).*Sigma(ind).^7.*pi.^(1./2).*gamma(nu./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)) - (4.*gamma(nu./2 + 1./2).*(8.*Y - 8.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2))./(nu.^(5./2).*Sigma(ind).^5.*pi.^(1./2).*gamma(nu./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - (8.*gamma(nu./2 + 1./2).*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2))./(nu.^(5./2).*Sigma(ind).^5.*pi.^(1./2).*gamma(nu./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (4.*gamma(nu./2 + 1./2).*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*(Y - Ym(ind)).^2)./(nu.^(7./2).*Sigma(ind).^7.*pi.^(1./2).*gamma(nu./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)) + (2.*gamma(nu./2 + 1./2).*(8.*Y - 8.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*(Y - Ym(ind)).^2)./(nu.^(7./2).*Sigma(ind).^7.*pi.^(1./2).*gamma(nu./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)) - (2.*gamma(nu./2 + 1./2).*(2.*Y - 2.*Ym(ind)).^3.*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*(nu./2 + 7./2).*(Y - Ym(ind)).^2)./(nu.^(9./2).*Sigma(ind).^9.*pi.^(1./2).*gamma(nu./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 9./2)));
%ddddJ_DdYdYdSigma(ind)dSigma(ind)
varargout{13} = transpose((12.*(nu./2 + 1./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.*Sigma(ind).^4.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + (28.*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^2)./(nu.^2.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + (20.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2))./(nu.^2.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (28.*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^2)./(nu.^2.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - (20.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.^2.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (8.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2).*(Y - Ym(ind)).^4)./(nu.^3.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (16.*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^4)./(nu.^3.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (22.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2).*(Y - Ym(ind)).^2)./(nu.^3.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (44.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^2)./(nu.^3.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (8.*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^4)./(nu.^3.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)) + (22.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^2)./(nu.^3.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)) + (4.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*(nu./2 - 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 5./2).*(Y - Ym(ind)).^4)./(nu.^4.*Sigma(ind).^10.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (12.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2).*(Y - Ym(ind)).^4)./(nu.^4.*Sigma(ind).^10.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (12.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^4)./(nu.^4.*Sigma(ind).^10.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)) - (4.*(2.*Y - 2.*Ym(ind)).^2.*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*(nu./2 + 7./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^4)./(nu.^4.*Sigma(ind).^10.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 9./2)));
%ddddJ_DdYdSigma(ind)dSigma(ind)dSigma(ind)
varargout{14} = transpose((96.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^2)./(nu.^2.*Sigma(ind).^7.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - (96.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^2)./(nu.^2.*Sigma(ind).^7.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (24.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2))./(nu.*Sigma(ind).^5.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (60.*(2.*Y - 2.*Ym(ind)).*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2).*(Y - Ym(ind)).^4)./(nu.^3.*Sigma(ind).^9.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + (120.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^4)./(nu.^3.*Sigma(ind).^9.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - (8.*(2.*Y - 2.*Ym(ind)).*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*(nu./2 - 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 5./2).*(Y - Ym(ind)).^6)./(nu.^4.*Sigma(ind).^11.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + (24.*(2.*Y - 2.*Ym(ind)).*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2).*(Y - Ym(ind)).^6)./(nu.^4.*Sigma(ind).^11.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) - (24.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^6)./(nu.^4.*Sigma(ind).^11.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)) - (60.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^4)./(nu.^3.*Sigma(ind).^9.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)) + (8.*(2.*Y - 2.*Ym(ind)).*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*(nu./2 + 7./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^6)./(nu.^4.*Sigma(ind).^11.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 9./2)));
%ddddJ_DdSigma(ind)dSigma(ind)dSigma(ind)dSigma(ind)
varargout{15} = transpose((120.*(nu./2 + 1./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^2)./(nu.*Sigma(ind).^6.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) + (300.*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^4)./(nu.^2.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (300.*(nu./2 + 1./2).*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^4)./(nu.^2.*Sigma(ind).^8.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (144.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2).*(Y - Ym(ind)).^6)./(nu.^3.*Sigma(ind).^10.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (288.*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^6)./(nu.^3.*Sigma(ind).^10.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (144.*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^6)./(nu.^3.*Sigma(ind).^10.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)) + (16.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*(nu./2 - 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 5./2).*(Y - Ym(ind)).^8)./(nu.^4.*Sigma(ind).^12.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 3./2)) - (48.*(nu./2 - 1./2).*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 3./2).*(Y - Ym(ind)).^8)./(nu.^4.*Sigma(ind).^12.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 5./2)) + (48.*(nu./2 + 1./2).^2.*(nu./2 + 3./2).*(nu./2 + 5./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 - 1./2).*(Y - Ym(ind)).^8)./(nu.^4.*Sigma(ind).^12.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 7./2)) - (16.*(nu./2 + 1./2).*(nu./2 + 3./2).*(nu./2 + 5./2).*(nu./2 + 7./2).*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 1./2).*(Y - Ym(ind)).^8)./(nu.^4.*Sigma(ind).^12.*((Y - Ym(ind)).^2./(nu.*Sigma(ind).^2) + 1).^(nu./2 + 9./2)));
end
end
end
end
end
end