Variables | ||
BaseTag | static const | Base tags for parallel messaging. |
curdir | static const | |
DIFF_EPS | static const | tolerance level 0: \(10^{-8}\). |
DIFF_EPS1 | static const | tolerance level 1: \(5\times 10^{-6}\). |
DIFF_EPS2 | static const | tolerance level 2: \(10^{-4}\). |
DIFF_EPS3 | static const | tolerance level 3: \(10^{-2}\). |
IIDZpars | static const | IID normal parameter vector. |
mymomlabels | static const | labels for MyMoments |
SQRT_EPS | static const | \(\sqrt{\epsilon_m}\) \(10^{-8}\). |
SSQ_TOLER | static const | Euclidean tolerance, \(10^{-12}\). |
VZero | static const | 0 as a vector . |
ZeroForSure | static const | used in transitions. |
Functions | ||
AV | ActualValue: Returns X->myAV() if it exists or CV(X). | |
ColLogit | The Multinomial logit smoothing function (over columns). | |
CV | Return the Current Value of a Quantity: access X.v, X, X() or X(arg). | |
DeltaV | Row-Difference of a matrix. | |
Dimensions | Return rows() and columns() as a row vector. | |
DiscreteNormal | Return Nx1 vector of values corresponding to the 1/(N+1) percentiles of the normal distribution. | |
DrawOne | Return index of a single draw from the multinomial distribution. | |
Epanechnikov | Compute the Epanechnikov kernel matrix for a data matrix. | |
FLogit | The standard logistic cumulative distribution. | |
GaussianKernel | Compute the Gausian kernel matrix for a data matrix. | |
HTopen | ||
MyMoments | Print Column Moments. | |
RowLogit | The Multinomial logit smoothing function (over rows). | |
SameDims | Check that two objects have same rows and columns. | |
SumToOne | Return the completed simplex of a vector or double. | |
TypeCheck | Check that an object is of a required class, or one of a required class. | |
vararray | Convert an array of strings into a space-separated string. | |
varlist | Parse a string for variable names; return array of strings. | |
Enumerations | ||
AggregatorTypes | Tags for Types of vector-valued objective Aggregation. | |
ConstraintTypes | Tags for Types of Constraints. | |
ConvergenceResults | Code for solutions to Optimization and Non-Linear System solving. | |
Names_for_Integers | Pseudonyms for -3, -2, …. | |
NextTreatmentStates | Possible next treatment phases. | |
NoiseLevels | Levels of output to produce while executing. | |
NormalParams | Tags for parameter vectors of normal distribution. | |
ParallelExecutionModes | Modes of Execution when executing in parallel. | |
StateTypes | Codes for Bellman::Type. |
Public methods | ||
Finalize | static | Finalize the CGI component of the output; Ox output appears below. |
GetVar | static | Find and return the CGI key value |
Initialize | static | Initialize the processing of CGI post data. |
Parse | static | Parse and return the values of a HTML form. |
ParseQ | static | Parse the query |
Public fields | ||
eq | inequalities. | |
ineq | equalities. | |
L | Merit value. | |
Public methods | ||
Vec |
Public fields | ||
actual | corresponding model vals. | |
N | Number of different values | |
vector of prob. | ||
subv | subvector objected belongs to. | |
vals | const | range(0,N-1) |
Public methods | ||
Discrete | Create a discrete quantity . | |
GetN | ||
virtual | ||
SetActual | virtual | Initialize the actual values. |
Track | virtual | |
Update | virtual | The default Discrete Variable update does nothing. |
Public fields | ||
f | 1xM row vector of unique indices into nodes. | |
nodes | const | Quantity object or points. |
p | NxM matrix of weights. | |
pts | N-array of matrices, either 2x1 or 2x2. first row are node indices, second is weight on the node. |
|
Public methods | ||
Approx | Map vector of values into current nodes. | |
Discretized | Map a continuous outcome onto a set of discrete nodes. |
Public methods | ||
Equality | ||
Public fields | ||
J | Jacobian. | |
L | const | array of equation labels |
lam | current multiplier | |
N | const | number of equations |
rlabels | static const | lables for equation elements. |
v | current value | |
Public methods | ||
Equations | Create a system of equations. | |
norm | virtual | |
penalty | virtual | |
virtual |
Public fields | ||
C | const | J-array of Choleski of M[j]Sigma M[j]'. |
CSET | ||
hR | const | half-replication (anti-thetics). |
iseed | static | initial seed. |
J | const | dimensions on integration, number of feasible options. |
L | 1xR upper bounds. | |
M | const | J-array of delta matrices. |
nu | JxR matrix of N(0,1) simulated values. | |
pj | Pj. | |
pk | incremental simulated prob. | |
R | const | number of replications. |
sigs | vector of standard deviations . | |
SimJ | const | J-1. |
u | 1xR uniform values. | |
vj | Evj. | |
Volume | static | output level |
Public methods | ||
GHK | Set constants for GHK. | |
SetC | Update array of choice-specific Choleskie's | |
SetSeed | static | |
SimDP | Use GHK to simulate choice probabilities and Emaxes for a matrix of index values. | |
SimProb | Use GHK to simulate state-contingent choice probability when U() includes additive N(0,Σ) errors. |
GQH::Initialize(8); println("E[x*x] = ", GQH::wght * sqr(GQH::nodes) ); // / M_SQRT2PI
Public fields | ||
nodes | static | the nodes or mantissa values xm |
order | static | currrent order M |
wght | static | corresponding weights ωm |
Public methods | ||
coef | static | Return the polynomial coefficients of Hn polynomial . |
Initialize | static | Set the nodes and weights for Gauss-Hermite Quadrature. |
GQL::Initialize(8); println("E[x*x] = ", GQL::wght * sqr(GQL::nodes) );
Public fields | ||
nodes | static | the nodes or mantissa values xm |
wght | static | corresponding weights ωm |
Public methods | ||
Initialize | static | Gauss-Laguerre nodes and weights. |
Public methods | ||
InEquality | ||
Public fields | ||
step | step length. | |
V | v value . | |
v | obj value. | |
Public methods | ||
Copy | virtual | |
GetV | virtual | |
LinePoint |
Public fields | ||
Dvar | const | |
mix | mixture elements. | |
sp | const | |
W | weight matrix | |
WF | free weights. | |
Public methods | ||
aggregate | virtual | aggregate blackbox objectives into a scalar value. |
Public fields | ||
block | 0 or pointer to param block. | |
DoNotConstrain | Flag to ignore constraints. | |
DoNotVary | Treat as Determined, for now. | |
f | Current free value f. | |
ival | const | Initial passed value. |
NearFlat | static const | tolerance for too near flat part of transformation. |
scale | Scaling value s. | |
start | Value at start of iteration. | |
Public methods | ||
Decode | virtual | Default decoding: no scaling, no constraining. |
Encode | virtual | Default encoding: no scaling, no constraining. |
Menu | virtual | |
Parameter | Create a new parameter. | |
ReadCGI | virtual | |
ReInitialize | Reset the parameter to its hard-coded values. | |
Reset | Reset the starting value of a parameter. | |
SetDoNotVary | virtual | Set the value of DoNotVary. |
ToggleDoNotVary | virtual | Toggle the value of DoNotVary. |
cur
.
Algorithms use a point to store temporary values.
Public fields | ||
AggType | form of aggregation of vfunc() into func(). | |
F | Free vector. | |
G | Gradient | |
H | Hessian | |
J | Jacobian | |
SE | \(\sqrt(diag(H-1f))\). | |
X | Structural vector. | |
Public methods | ||
aggregate | virtual | aggregate blackbox objectives into a scalar value. |
Point | ||
Vstore | virtual |
Public fields | ||
L | const | Label |
logf | Log file dedicated to this qty. | |
pos | position in vector | |
track | Data tracking object. | |
v | Current actual value | |
Volume | Volume of output. | |
Public methods | ||
SetVolume | Control variable-specifc output. |
Public fields | ||
bb | const | |
Kvar | const | |
Public methods | ||
aggregate | virtual | aggregate separable objectives into a scalar value. |
SepPoint |
Public methods | ||
SysPoint |
Public fields | ||
HTopen | static | HTML log is open. |
logdir | static | directory to put log files in. |
MPIserver | static | TRUE if running in parallel and in server mode. |
tmstmp | static | time stamp for log files. |
version | static const | Current niqlow version. |
Public methods | ||
Check | static | Check versions and set timestamp, log directory. |
Enumerations | ||||||||||||||||||||
AggregatorTypes | Tags for Types of vector-valued objective Aggregation.
All objectives in FiveO take the form
$$f = \Omega_{i=1}^N v_i.$$
where \(v\) is the vector returned by the vfunc() method that the user typically
provides for their objective and \(\Omega\) is an aggregator If the objective is a System then this is the system of
equations. The user's objective is called by vobj() and the
the vector is stored. Then fobj aggregates the vector into a real number
using one of the aggregators below.
|
LINEAR, LOGLINEAR, MULTIPLICATIVE, MINUSSUMOFSQUARES, SUMOFSQUARES, Aggregators | ||||||||||||||||||
ConstraintTypes | Tags for Types of Constraints. Used by Constrained objectives. | EQUALITY, INEQUALITY, ConstraintTypes | ||||||||||||||||||
ConvergenceResults | Code for solutions to Optimization and Non-Linear System solving. | NONE, MAXITERATIONS, FAIL, WEAK, SECONDRESET, STRONG, ConvergenceResults | ||||||||||||||||||
Names_for_Integers | Pseudonyms for -3, -2, …. | Zero, One, Two, Three, TrackAll, NotInData, UseCurrent, UseCheckPoint, AggGroup, UseDefault, UseLabel, UnInitialized, Impossible, DoAll, NoMatch, AllFixed, AllRand, UseSubSample, ResetValue, IterationFailed, UseGradient, ErgodicDist, CondProbOne, abbrevsz, xax, yax, zax, Naxes, _lo, _hi, GraphLimits | ||||||||||||||||||
NextTreatmentStates | Possible next treatment phases. | stayinf, gotonextf, exittreatment, NextTreatmentStates | ||||||||||||||||||
NoiseLevels | Levels of output to produce while executing. | SILENT, QUIET, LOUD, NOISY, NoiseLevels | ||||||||||||||||||
NormalParams | Tags for parameter vectors of normal distribution. | Nmu, Nsigma, Nrho, NormalParams | ||||||||||||||||||
ParallelExecutionModes | Modes of Execution when executing in parallel. See BaseTag
|
MultiParamVectors, OneVector, ParallelModes | ||||||||||||||||||
StateTypes | Codes for Bellman::Type. These codes (and their order) determine what calculations to do
at the endogenous state \(\theta\).
|
ORDINARY, INSUBSAMPLE, NOTSAMPLED, IGNOREEXOG, LASTT, LASTNOTSAMPLED, TERMINAL, TERMNOTSAMPLED, StateTypeCutoffs |
X | anything |
... | argument passed to CV() |
X Returns Notes Discrete X->myAV() (any class with the member function defined) Other Object CV(X)
x | m×n matrix. |
rho | double [default=1.0] smoothing factor |
X | a double, integer, static function of the form X() or X(arg), or any object with a member named v. an array of CV compatible elements will return the horizontal concatenation value of the results as matrix. |
... | a single argument can be passed along with X(). Further arguments are ignored
X Returns Notes
ActionVariable X->myCV() X's column of values in \(\alpha\)
Other Object X.v If v is a member
array row of CV(X) recursively call CV() or CV(...) for all elements
function X() or X(...) simply call function sending optional arguments as array
all else X CV() of arithmetic objects is the value itself
|
V | Nx1 x N matrix vector, N > 1. |
A | matrix |
N | number of points to return |
pars | 2x1 vector or array of NormalParams
Nmu mean μ Default=0.0 Nsigma standard deviation σ Default=1.0 |
P | vector of probabilities, p0, p0, … 1-∑pk |
X | RxNd matrix of points |
h | bandwidth |
x | double or vector. |
X | RxNd matrix of points |
h | bandwidth. -1 [default] use Silverman > 0.0 value. |
M | matrix: matrix to compute (column) moments for |
rlabels | (optional), array of labels for variables |
oxf | int, print to screen (default), file, printed to file |
x | m×n matrix. |
rho | double [default=1.0] smoothing factor |
A | matrix |
B | matrix |
v | double or column vector. |
obj | object |
cname | Class nameArray of class names |
Fatal | TRUE [default]= end on the error FALSE , only issue warning. SILENT no message, just return outcome |
msg | Message to print if not SILENT and class fails to match (default message is "Class fails to match") |
sa | a string or an array of strings |
vararray({"A","B","Joe"}) → "A B Joe " vararray("A B Joe ") → "A B Joe "
s | string |
varlist("A B Joe") → {"A","B","Joe"} varlist("Joe") → "Joe"
key | string, CGI post keyword |
title | string, HTML title |
L | string a label or name for the variable. |
N | positive integer, number of values. N=1 is a constant. |
Volume | default=SILENT. NoiseLevels |
MaxV | non-zero double, default = 1.0 N×1 vector, actual |
Report | FALSE [default], do not print out current to actual mapping TRUE, print mapping If a double is sent the actual vector to 0,…, MaxV. |
a = new ActionVariable("att",3); // None, half-time, full-time a -> SetActual(); // AV(a) = 0 .5 1.0 OR: a -> SetActual(40); // AV(a) = 0 20 40 (hours) taxbrack = new StateVariable("s",5); //lower bound on tax rate brackets taxbrack -> SetActual( <0; 20000; 55000; 80000; 165000> );
x | column vector of values |
trans | TRUE, calculate f and p like output of StateVariable::Transit() |
v = new Discretized(<0;1;2;3>); v->Approx(<-1.3;1.2;2>,TRUE);After execution, these value will be set:
v.pts = { < 0 //-1.3 is to left of first node 1.0 >, // all weight on the node < 1 2 // 1.2 is between 2nd and 3rd nodes 0.8 0.2 >, // 20% of the gap between nodes < 2 // 2 is exactly equal to 3rd node 1.0 > } v.f = < 0 1 2 3 > // 4 nodes have positive weight v.p = < 1.0 0.0 0.0 0.0 0.0 0.8 0.2 1.0 0.0 0.0 0.0 1.0 >
LorN | array of strings (labels) string, a list of labels processed by varlist positive integer, number of equations |
R | integer, number of replications |
J | integer, choice dimensions |
Sigma | J×J variance matrix |
V | J×1 vector of choice values |
j | integer, option to simulate probability for |
V | J×1 vector of choice values Cholesky matrices are updated by (internal) calls to NnotIID::SetC simulated probability and Ev for option j are left in vj and pj |
n | the order of the polynomial |
order | integer, M |
GHQ::Initialize(8); println("E[x*x] = ", GQH::wght * sqr(GQH::nodes) ); // / M_SQRT2PI
∫_0+∞ f(x)exp(-x) ≅ ∑m ωm f(xm)
order | integer, 2-6, 8, 10, 20, 32 |
inV=0, | if no argument, V data member holds individual values matrix of separable values to be aggregated within columns |
outv=0, | if no argument, objective stored in this.v address to return objective The matrix passed as inV should be N×M.
|
v = start; scale = 1.0; f = v;
L | parameter label |
ival | initial value Typically a user would create an object of class derived from this base class. This function is called by those derived classes to set common elements of paramters. |
v = start = scale = CV(ival); f = 1.0; Encode();Typically this is called by a method of the Objective to re-initialize some or all of the parameters that belong to it.
newv | value to reset at |
IsCode | TRUE [default] newv is a free value FALSE newv is structural |
setting | TRUE or FALSE |
inV=0, | if no argument, V data member holds individual values matrix of separable values to be aggregated within columns |
outv=0, | if no argument, objective stored in this.v address to return objective The matrix passed as inV should be N×M.
|
Volume | new NoiseLevels Each quantity variable has a volume setting which is initialized to SILENT. If the new Volume is greater than the current value then a log file is opened if one is not already open. If the new Volume is SILENT and a log file is already open then the log file is closed. |
inV=0, | if no argument, V data member holds separable values matrix of separable values to be aggregated within columns |
outv=0, | if no argument, objective stored in this.v address to return objective The matrix passed as inV should be (K×NvfuncTerms)×M. |
logdir | str (default="."). A directory path or file prefix to attach to all log files. All log files will receive the same time stamp, which is set here. |