-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathPairCopulaAIC.cpp
118 lines (100 loc) · 2.97 KB
/
PairCopulaAIC.cpp
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#include "VineCopulaCPP_header.hpp"
void PairCopulaAIC_Rotated_Obs(double *AIC, double *theta,int family, int rotation, double *U,double *V,unsigned int n)
{
std::vector<double> bounds(120);
LoadDefaultBounds(&bounds[0]);
PairCopulaAIC_Rotated_Obs(&bounds[0],AIC,theta,family,rotation,U,V,n);
return;
}
void PairCopulaAIC_Rotated_Obs(double *bounds,double *AIC, double *theta,int family, int rotation, double *U,double *V,unsigned int n)
{
PairCopulaFit_Rotated_Obs(bounds,theta,family,rotation,U,V,n);
double CLL = PairCopulaNegLL_Rotated_Obs(family,rotation,theta,U,V,n);
switch(family){
case 3: case 4: case 5: case 6: case 12: case 16: case 17: case 19:
{
//*AIC = 2*CLL+4;
*AIC = 2*CLL+4+12/(n-3);
break;
}
case 18:
{
//*AIC = 2*CLL+6;
*AIC = 2*CLL+6+24/(n-4);
break;
}
default:
{
//*AIC = 2*CLL+2;
*AIC = 2*CLL+2+4/(n-2);
break;
}
}
return;
}
void PairCopulaAIC(double *AIC, double *theta,int family, int rotation, double *U,double *V,unsigned int n)
{
std::vector<double> bounds(120);
LoadDefaultBounds(&bounds[0]);
PairCopulaAIC(&bounds[0],AIC,theta,family,rotation,U,V,n);
return;
}
void PairCopulaAIC(double *bounds,double *AIC, double *theta,int family, int rotation, double *U,double *V,unsigned int n)
{
PairCopulaFit(theta,family,rotation,U,V,n);
double CLL = PairCopulaNegLL_Rotated_Obs(family,rotation,theta,U,V,n);
switch(family){
case 3: case 4: case 5: case 6: case 12: case 16: case 17: case 19:
{
//*AIC = 2*CLL+4;
*AIC = 2*CLL+4+12/(n-3);
break;
}
case 18:
{
//*AIC = 2*CLL+6;
*AIC = 2*CLL+6+24/(n-4);
break;
}
default:
{
//*AIC = 2*CLL+2;
*AIC = 2*CLL+2+4/(n-2);
break;
}
}
return;
}
void PairCopulaAIC(double *AIC, double *theta,int family, double *U,double *V,unsigned int n)
{
std::vector<double> bounds(120);
LoadDefaultBounds(&bounds[0]);
PairCopulaAIC(&bounds[0],AIC,theta,family,U,V,n);
return;
}
void PairCopulaAIC(double *bounds, double *AIC, double *theta,int family, double *U,double *V,unsigned int n)
{
PairCopulaFit(bounds,theta,family,U,V,n);
double CLL = PairCopulaNegLL(family,theta,U,V,n);
switch(family){
case 3: case 4: case 5: case 6: case 12: case 16: case 17: case 19:
{
//*AIC = 2*CLL+4;
*AIC = 2*CLL+4+12/(n-3);
break;
}
case 18:
{
//*AIC = 2*CLL+6;
*AIC = 2*CLL+6+24/(n-4);
break;
}
default:
{
//*AIC = 2*CLL+2;
*AIC = 2*CLL+2+4/(n-2);
break;
}
}
return;
}