-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtrame_docs_arums_empirical.html
187 lines (131 loc) · 5.02 KB
/
trame_docs_arums_empirical.html
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Transportation Methods for Econometrics">
<meta name="author" content="Alfred Galichon and Keith O'Hara">
<meta name="keywords" content="TraME, Transportation Methods, Optimal Transport, R, C++, Cpp, Econometrics, Research, Alfred Galichon, Keith O'Hara, NYU, New York University" />
<link rel="shortcut icon" type="image/x-icon" href="siteicon.ico">
<title>Transportation Methods for Econometrics (TraME)</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/modern-business.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- Additional Settings -->
<link href="css/trame_settings.css" rel="stylesheet">
<!-- Syntax Highlighter -->
<script type="text/javascript" src="js/syntaxhighlighter.js"></script>
<link type="text/css" rel="stylesheet" href="css/swift_theme.css">
<script src="js/jquery.js"></script>
<script>
$(function(){
$("#mynavbar").load("navbar.html")
$("#myheader").load("trame_technical_header.html")
$("#myfooter").load("footer.html")
});
</script>
</head>
<body>
<!-- Navigation -->
<div id="mynavbar"></div>
<!-- Page Content -->
<div class="container">
<div id="myheader"></div>
<h3 style="text-align: center;"><strong style="font-size: 130%;">Additive Random Utility Models (ARUMs)</strong></h3>
<hr>
<p>   </p>
<h3 style="text-align: left;"><strong style="font-size: 120%;">Empirical Class</strong></h3>
<div class="row">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body">
<a href="#CD">Class Definition</a> <br>
<a href="#MO">Member Objects</a> <br>
<a href="#MF">Member Functions</a> <br>
<a href="#NTS">Notes</a> <br>
<a href="#EX">Example</a> <br>
</div>
</div>
</div>
</div>
<hr>
<h3 style="text-align: left;" id="DL"><strong style="font-size: 120%;">Class Definition</strong></h3>
<p>Class Definition:</p>
<pre class="brush: cpp;">
class empirical
{
public:
// build objects
int nbX;
int nbY;
int nbParams;
int aux_nbDraws;
int nbOptions;
bool xHomogenous;
bool outsideOption;
arma::cube atoms;
// input objects
arma::mat U;
arma::mat mu;
// equilibrium objects
arma::mat U_sol;
arma::mat mu_sol;
// member functions
~empirical(){};
empirical(){};
explicit empirical(int nbX_inp, int nbY_inp);
explicit empirical(int nbX_inp, int nbY_inp, const arma::cube& atoms_inp, bool xHomogenous_inp, bool outsideOption_inp);
void build(int nbX_inp, int nbY_inp);
void build(int nbX_inp, int nbY_inp, const arma::cube& atoms_inp, bool xHomogenous_inp, bool outsideOption_inp);
double G(const arma::vec& n);
double G(const arma::vec& n, const arma::mat& U_inp, arma::mat& mu_out);
double Gx(const arma::mat& U_x_inp, arma::mat& mu_x_out, int x);
double Gstar(const arma::vec& n);
double Gstar(const arma::vec& n, const arma::mat& mu_inp, arma::mat& U_out);
double Gstarx(const arma::mat& mu_x_inp, arma::mat &U_x_out, int x);
double Gbar(const arma::mat& Ubar, const arma::mat& mubar, const arma::vec& n, arma::mat& U_out, arma::mat& mu_out);
double Gbarx(const arma::vec& Ubar_x, const arma::vec& mubar_x, arma::mat& U_x_out, arma::mat& mu_x_out, int x);
private:
/*
* these private member objects are mostly used by LP solvers
*/
void presolve_LP_Gstar();
void presolve_LP_Gbar();
bool TRAME_PRESOLVED_GSTAR = false;
bool TRAME_PRESOLVED_GBAR = false;
int k_Gstar;
int n_Gstar;
int numnz_Gstar;
int* vind_Gstar;
int* vbeg_Gstar;
double* vval_Gstar;
int k_Gbar;
int n_Gbar;
int numnz_Gbar;
int* vind_Gbar;
int* vbeg_Gbar;
double* vval_Gbar;
};</pre>
<hr>
<h3 style="text-align: left;" id="MO"><strong style="font-size: 120%;">Member Objects</strong></h3>
<hr>
<h3 style="text-align: left;" id="MF"><strong style="font-size: 120%;">Member Functions</strong></h3>
<hr>
<h3 style="text-align: left;" id="NTS"><strong style="font-size: 120%;">Notes</strong></h3>
<hr>
<h3 style="text-align: left;" id="EX"><strong style="font-size: 120%;">Examples</strong></h3>
<hr>
<!-- Footer -->
<div id="myfooter"></div>
</div>
<!-- /.container -->
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>