Methods¶
Summary
A numerical method is written into the signature of the operator it serves. Beside its field component, the functions or measures an operator reads and writes, the signature carries two further components, the operator's method and its grid, each written as a typing of the operator's name. Operators compose over their field components alone; the labels of a composite are kept as a list and never combined. The methods an operator admits are those of its operation kind, the grid is the finite set of points at which a function is stored, and the handler, the program that computes the method, stands outside the calculus. Two erasures recover the model: one forgets the labels, the other forgets the methods file. Nothing is differentiated by the language.
Relationship with other documents
Builds on — Operators and builders: the operations and builders whose signatures the components extend; The stage term: the many-sorted signature of a stage; Fields, functions and types §1.2: the derivative term; Bellman-SYM's Appendix C: the interpretation rules that fix the meaning of each operation. Formal account — Functional programming §§5, 7 and 8: the term category, the binding maps with the two erasures, and the numerical realization; Kinds and sorts §§3 to 5: the classifier, the settings with their admissible set, and the grids as a kind of their own. Used by — Methodization: what the economist writes in a methods file; Method types: the catalogue of method words with the keyword arguments each reads; the wiki entries methods, grid, addition and settings.
Key terminology
| Term | Meaning on this page |
|---|---|
| operator, occurrence | One operation of a stage, such as an expectation or an evaluation, or a builder composed of such operations; it reads and writes functions or measures. An occurrence is one operator with its identity, one box of the stage's builders graph. |
| operation kind | The kind of an operation in the operator catalogue: Pullback, Aggregation, Expectation, Evaluation, Argmax and the rest. It is a value of a classifier of the operators, and not a kind of Kinds and sorts §3, which holds every object of one nature. |
| field component | The inputs and outputs of an operator, \(X \to Y\), which decide what composes with what. |
| label, method component, grid component | The label of an operator is the pair of its method label and its grid label: a method word with its arguments and a grid word with its arguments. The method component is the label's first part, written policy.method : !egm; the grid component its second, written policy.grid : !Cartesian(…). |
| signature of an operator | Its field component with its method component and its grid component. The signature of a stage in Kinds and sorts §6 is another object, in which a label changes no rank. |
| identity label | The label of an operator that no entry names: the list with no entries, which adds nothing when the labels of a composite are concatenated. |
| Evaluation | The operation that stores a builder's result and closes the builder; a representation stands on it. |
| handler | The program that computes a method, named by a binding beside the term, written policy.handler : "cons-port:egm". |
| addition | A methods file: a .bl file unioned with the stage file before elaboration, which adds entries and lines and removes nothing (addition). |
| rows | The lines a solution method supplies, by which a builder is computed. |
| declared level, operative level | The stage file's own lines, and the lines a solution method puts in their place for computation. |
perch marks [<], [~], [>] |
The mark after a field names its perch: V[<] the value at the arrival perch, c[~] the consumption at the decision perch, V[>] the value at the continuation perch (perch). |
| erasure | A map that forgets the labels, or forgets the addition, and returns the model. |
1 A method and its place¶
A stage file states a model: its fields, their laws of motion, its values and its maximization (Stages and perches). Computing the model requires choices the model does not make: how an expectation over a shock is integrated, how a function is stored between the points at which it is computed, how a maximization is carried out. A method is one such choice, named by a word. The word !gauss_hermite integrates an expectation by Gauss–Hermite quadrature, !Linear stores a function by piecewise linear interpolation, and !egm computes the policy by the endogenous grid method. A method serves one operator of the stage, an operation such as an expectation or an evaluation, or a builder composed of such operations (Operators and builders §6), and it is written on that operator's name and on nothing else: not on a field, which is a quantity and not a computation, and not on a side of a block header, the inputs before the arrow or the outputs after it, whose perch word types the states and the values listed on it (Kinds and sorts §5).
The economist writes the method in a methods file, an addition to the stage file, as a typing of the operator's method component, policy.method : !egm, and the operator's grid beside it, policy.grid : !Cartesian(a=(a_min, a_max, n_a)); the Bellman-SYM page on methodization gives the written forms. This page gives the mathematics of the two entries: the signature of an operator with its components (§2), how such operators compose (§3), what a method is (§4) and what a grid is (§5), where the settings and the handler stand (§§6, 7), how the model is recovered from the methodized stage (§8), what a solution method changes in a stage (§9), and what no method may do (§10).
A method is not an argument of its operator. Two methods at one operator read the same inputs and write the same outputs, and they differ in the numbers they produce. Piecewise linear interpolation of \(x^2\) on the grid \(\{0, \tfrac12, 1\}\) gives \(\tfrac18\) at \(x = \tfrac14\), where the function is \(\tfrac1{16}\); on the grid \(\{0, \tfrac14, \tfrac12, \tfrac34, 1\}\) it gives \(\tfrac1{16}\), since \(\tfrac14\) is then a node, and a cubic interpolant on the first grid gives a third number. The stored function changes with the method and the grid, while its domain and codomain, \(\mathbb R \to \mathbb R\), do not.
2 The signature with its components¶
Every operator of a stage has a field component, written \(X \to Y\): \(X\) is the sort of what it reads and \(Y\) the sort of what it writes, each the name of a space of functions or of the finite measures on the state space of a perch (The stage term §1). For a builder it is the rank of the builder in the operator signature of the stage (Kinds and sorts §6); an operation inside a builder has its rank in the finer signature of The stage term §3. The expectation of the buffer-stock arrival builder reads a function of the decision state and the shocks and writes a function of the arrival state; the policy builder reads the continuation value and writes the policy. The field component decides what composes with what, and it is the only component of the signature that the model fixes.
The signature of a methodized operator \(\omega\) carries two further components,
the method component \(M\) and the grid component \(G\). Each is a classifier in the sense of Kinds and sorts §3, D6, as Kinds and sorts §6 applies it to the operators: a function from the operators of the stage to a set of labels, whose fibers are the operators that share a label. \(M\) names the numerical method, chosen among the methods admitted at an operator of \(\omega\)'s operation kind (§4), and \(G\) names the grid on the domain of the function the operator stores or evaluates (§5). Each is assigned by one typing entry of the operator's name, policy.method : !egm and policy.grid : !Cartesian(a=(a_min, a_max, n_a)). An operator that no entry names carries the identity label in that component, with one exception: the Evaluation of an !explicit builder carries the closed form generated from the builder's entry (§5). The handler, the program that computes the method, is no component of the signature; it is a binding beside the term (§7).
Formally, let \(\Sigma\) be the free category on the stage's operators: the graph whose vertices are the sorts of the wires with their perches, products of sorts among them, and whose edges are the operation symbols, each from its input sort to its output sort (The stage term §1). A morphism of \(\Sigma\) is a finite path of operation symbols, composed by concatenation, and a functor out of \(\Sigma\) is fixed by its values on the vertices and the edges, since a path is a finite sequence of edges (Kinds and sorts §6). A path is a term in which each operation reads one wire and no wire is read twice. In general an operation may read several wires and a wire may be read twice, and the terms of a stage are then the arrows of the free category with finite products on the same sorts and symbols, tuples of terms composed by substitution (Functional programming §5). The construction that follows is stated for paths. The label of an operator is the pair of its method label and its grid label: a method word with its arguments and a grid word with its arguments. Let \(\mathcal M\) be the free monoid on the labels, the finite lists of labels with concatenation as the tensor, written \(\odot\), and the list with no entries as the unit, the identity label; read \(\mathcal M\) as a strict monoidal category whose only morphisms are identities, acting trivially on \(\Sigma\), \(M \bullet X = X\). The parametrized morphisms of Capucci, Gavranović, Hedges and Rischel (2022, Definition 2, p. 236) form the bicategory \(\mathrm{Para}_{\mathcal M}(\Sigma)\):1 its objects are those of \(\Sigma\), and a 1-cell from \(X\) to \(Y\) with parameter \(M\) is an object \(M\) of \(\mathcal M\) together with a morphism \(M \bullet X \to Y\), which under the trivial action is a path \(X \to Y\) carrying the list \(M\). Its 2-cells are identities, \(\mathcal M\) having no others, so it is a category. The parameter of a parametrized morphism is here a list of labels, and it is no parameter of the stage (Kinds and sorts §4). The methodized signature is \(\Sigma_m = \mathrm{Para}_{\mathcal M}(\Sigma)\), and a labeled generator is an operation symbol \(\omega\) with the one-element list \([\ell]\), \(\ell\) a label admitted at \(\omega\) (§4), or with the identity label. A methodized operator is therefore its field component together with its label. In a term that is no path, each occurrence of an operation symbol carries its label in the same way, one label for each occurrence and none composed with another. The label is a factor of its own beside \(X\) and no classifier of \(X\): a method is written on the operator, never on the field it reads, and never on the output field, since a wire carries no label.
3 Composition over the field component¶
Two operators compose when the output sort of the first is the input sort of the second, \(\operatorname{cod}(\omega_1) = \operatorname{dom}(\omega_2)\), and the condition reads the field components alone. The field component of the composite is the composite of the two maps. Its method component is the list of the two methods, kept and not composed, and its grid component the list of the two grids. A builder composed of a pullback, an aggregation and an evaluation carries the three labels of those operations; the stage operator carries the labels of its builders. Nothing of the model is lost in a composite, because the erasure of §8 returns the composite of the field components.
The labels are not composed because two labels have no product that is again a method: the catalogue admits a method at a generator of one of the operation kinds of §4, and a composite formed in \(\Sigma_m\) is of none of those kinds. A builder that admits a solution method, such as the policy builder under !egm, is one generator at the operative level, whose lines the method supplies (§9).
Formally, the composite of \(X \to Y\) with parameter \(M_1\) and \(Y \to Z\) with parameter \(M_2\) is the morphism \(X \to Z\) with parameter \(M_2 \odot M_1\), the two base morphisms composed and the two parameters tensored (Capucci, Gavranović, Hedges and Rischel 2022, Definition 2, item 3, p. 236).1 With concatenation as the tensor, the parameter of a path of labeled generators is the list of their labels, the later generator's first, and the identity label of a generator without an entry adds nothing to it. The list is the ruling's collection: each label stands in it beside the others, and none is composed with another.
4 The method as a type over the kind of operator¶
Which methods an operator admits depends on its operation kind. A quadrature rule is admitted at an expectation, an interpolant at the Evaluation that stores a builder's result, a solution method such as the endogenous grid method at the policy builder, a root finder at a maximization written as a first-order condition, and a discretization of a law at the expectation that integrates against it. The derivative operator D admits no method, because the language differentiates nothing (§10).
Formally, \(\mathrm{Method}\) is a family of sets indexed by the operation kinds: \(\mathrm{Method}(\kappa)\) is the set of the methods admitted at an operator of operation kind \(\kappa\), and the method component of an operator \(\omega\) of operation kind \(\kappa\) is a member of \(\mathrm{Method}(\kappa)\) or the identity label. The set in which the label lies depends on the operator it labels, which is all that a dependent type means here: the type system of the calculus has no dependent function types and is no dependent type theory (Kinds and sorts §1). The family is indexed by the operators through their operation kinds: the labels a method assignment may place on a generator \(\omega\) of operation kind \(\kappa\) are those of \(\mathrm{Method}(\kappa)\) and the identity label, the fiber of the family over \(\omega\), in the sense in which a family of sets indexed by a set is displayed as a map onto the index set, each set standing over its index (Jacobs 1999, §1.1, pp. 20–21).2 A method is a member of the fiber, written by its word with keyword arguments: !gauss_hermite(n_ψ=n_ψ_nodes, n_ξ=n_ξ_nodes) is a member of \(\mathrm{Method}(\mathrm{Expectation})\) at an expectation over two shocks, !Linear(extrapolate=extrap_policy) a member of \(\mathrm{Method}(\mathrm{Evaluation})\), and !egm a member of the set at the policy builder. The value after each equals sign in these words is the name of a setting that the methods file declares, as in extrap_policy : {0, 1}. In a methods file the method word is the type that the entry writes after its colon (Kinds and sorts §§2 and 6), and the entry asserts that the operator has that method. The catalogue of method words with the operation kinds each admits is the Bellman-SYM reference page on method types. Methods have no subtyping: no method stands for another.
Every argument of a method word is a keyword argument, written key=value, whose value is the name of a declared setting (§6), a quoted string, or a word with its own arguments. No number is written in a method's entry, as none is written in a grid's (§5): every number that a method reads is a declared setting, which the entry names and the settings file values. Two versions of a stage that differ only in such a number therefore have one method assignment and differ in their configuration. The catalogue row lists the keywords the package reads, each with the set in which its value lies; a further keyword is read by the handler that computes the method (§7), so that an argument a handler needs can be written without a change to the language. What a method does outside its grid, such as extrapolation or clamping at the bounds, is a keyword argument of the method word and no part of the grid.
A method does one of three things to the stage, according to the operator it stands on. A representation, such as !Linear, !pchip or !closed_form, stores a function from the data its family accepts, among them its values on the grid its grid component names (§5): at the Evaluation that closes a builder, one entry for everything the Evaluation stores or one entry per stored object, evaluate[V[<]].method and evaluate[D_{k}V[<]].method, each with its own grid; or at a line marked !node, a computation inside a block that the author names so that a method can stand on it; or at a declared function. A solution method, such as !egm, stands on a builder and supplies the lines by which the builder is computed (§9); !vfi is a solution method that supplies no lines. A method of an operator of a line fixes how that operation is computed: a quadrature or a discretization of a law at an expectation, !gauss_hermite or !tauchen, and a root finder or a search at a maximization.
5 The grid as the discretized domain¶
A grid is the finite set of points of a function's domain at which a method computes and stores the function; between the points the representation supplies the values. The grid is written as its own component of the operator's signature, the discretized domain, by the entry policy.grid : !Cartesian(a=(a_min, a_max, n_a)): the grid word !Cartesian names a product of one node set per coordinate, keyed by the coordinate's name, and a factor is a triple of declared settings, the lower bound, the upper bound and the count, with an optional spacing word, or a declared node set, or the expectation operator whose quadrature nodes the coordinate takes, or, for a control, its feasible set with a count. The wiki entry grid lists the four shapes of a factor with their spellings. Two further grid words stand in the same entry. !Points(nodes=P) is the finite set of the declared points P, each written in the domain's declared coordinate order, and !Points alone is the empty grid. !Fibred(base=…, fibre=!Cartesian(c=(Γ_c, n_c))) pairs each state of a finite base grid with the finite grid of the control's feasible set at that state, so that its points lie in the graph of the feasible set, the feasible pairs of state and control. Each grid word may carry require= with one predicate word, or a tuple of them, among !Empty, !Cartesian, !NonCartesian and !UniformCartesian: properties the resulting grid must have, not further components. No number stands in the entry: the bounds, the counts and the points of !Points are settings declared in the methods file (§6), or the points are a finite set the stage defines.
A grid's coordinates follow the arguments of the function held at its place, in declared order, including shock coordinates where present. Omitting a grid entry supplies no numerical bounds, counts or nodes. A partial entry leaves omitted coordinates in the function's domain. The endogenous grid method uses continuation-state coordinates for its solution grid, the predetermined end-of-period assets from which policy pairs are generated (Carroll 2006, §2.2, p. 315).3 An interpolant built from those pairs uses their decision-state nodes, not another independent policy grid. An authored evaluate(knots, values, x) instead reads its supplied table. Each representation family records the data sources it accepts, and the stage selects one in this order: an authored table; the policy pairs of !egm at the closing Evaluation of its builder, for a family that accepts them, where a representation grid is refused; a complete authored expression, which !closed_form reads without a grid and which the Evaluation of an !explicit builder takes where no entry names another representation; and otherwise the values of the function sampled on the representation's own grid. stage.methods[place].source names the selected source.
A grid is a numerical object and no part of the model. A discrete set that belongs to the economics, such as the set of housing sizes a household chooses among, is the declared set of a field, written in the stage file, and the scalars that define it are parameters (Kinds and sorts §§4 and 5; the catalogue Parameters and settings); a grid approximates a continuous domain and names settings.
When configure binds the settings, the package checks each bound pair ordered and inside the coordinate's declared set, each count at least two, each node set strictly increasing, each declared point's shape, finite coordinates and, where it is decided, membership of the declared sets, and each written requirement that the bound values decide. Numerical construction establishes the remaining requirements and the feasible grids of !Fibred before the grid is used and reports a requirement it cannot establish; a builder’s kernels(inputs=values).grids holds the constructed grid of each place or that report.
A bound such as L + extra_grid reads the supplied constant L and the configured setting extra_grid; it is not a new calibration. The required input is checked before constructing the grid. It checks nothing about accuracy or about the region of the domain the model's distribution visits; those are propositions about the method, which the package does not check.
Formally, a grid on a domain \(X\) is a finite subset \(G \subseteq X\) with its inclusion \(\iota : G \to X\). Fix admitted functions \(\mathcal F\subseteq\mathbb R^X\) and nodal data \(\mathcal A\subseteq\mathbb R^G\) such that restriction \(r(f)=f\circ\iota\) maps \(\mathcal F\) into \(\mathcal A\). An interpolating representation supplies \(s:\mathcal A\to\mathcal F\) reproducing those data,
so that \(s\) is a section and \(r\) a retraction in the sense of Adámek, Herrlich and Strecker (2004, Definitions 7.19 and 7.24, pp. 106–107).4 Thus \(\mathcal A\) is a retract of \(\mathcal F\). The composite \(e=s\circ r\) on \(\mathcal F\) is idempotent, \(e\circ e=s\circ(r\circ s)\circ r=e\), and its fixed points are exactly the functions in the image of \(s\).
On at least two strictly ordered real nodes, piecewise linear and shape-preserving cubic interpolation can give different sections when their common admitted functions, data and evaluation domain satisfy these conditions. Evaluation beyond the knot interval requires a specified extension. Other fitting criteria need not reproduce nodal data, so the section law and this idempotence argument do not apply to every representation. The inclusion \(\iota\) is a map of sets and establishes no subsort relation between the grid and the domain; by Kinds and sorts §5 the grids form a kind of their own.
6 Settings¶
A setting is a name declared with a set in a methods file, whose value a method or a grid reads: a bound or a count of a grid, a tolerance, the number of quadrature nodes, a rule chosen among finitely many names (Kinds and sorts §4). The methods file declares each setting it reads at file level, in the form a stage file declares a parameter, with its set and a description, n_a : ℕ, a_min : Xa for a bound on the set Xa the stage declares for the savings coordinate, tol_v : ℝ₊₊.
The values stand in the settings file, and configure binds them as calibrate binds a parameter's value, refusing a value outside the declared set and a name with no value. The values bound form a configuration, one point of the admissible set of the settings at the bound calibration (Kinds and sorts §4). The declared sets of the settings define that set together with the conditions that a method word (§4) and a grid word (§5) put on the settings they name.
A setting is told from a parameter by the file that declares it: a parameter is declared by the stage file, a setting by the methods file. A derived parameter, which a methods file may also define, as in the perfect-foresight methods’ h_lim : ℝ₊₊ := 1/(1 - Γ/R) under Γ < R, is defined by := and is no setting (Kinds and sorts §4; the wiki entry parameters).
No value of a setting is part of a signature, and no number is: the grid component and the method word name the settings, and the configured values stand in the bindings. The wiki entry settings gives the declarations, the scope of a name and the table stage.settings.
7 The handler and the realization¶
A handler is the program that computes a method, named by its package and its function and written as a binding beside the term, policy.handler : "cons-port:egm", at any operator that admits a method, with or without a method word. The handler is no classifier of the signature, because it names a program and gives the operator no label. The calculus says what an operator means and which method labels it; the handler realizes the labeled operator under Ρ, the passage from the mathematical operations to their numerical representations (Ρ), written \(\mathrm P\) in the formulas below.
Formally, the exact semantics \(\Upsilon : \Sigma \to \mathcal B\) assigns each operation symbol its operation in the target algebra \(\mathcal B\) of the calculus, fixed on the edges by the interpretation rules of Bellman-SYM's Appendix C and extended to every path by composition. A label denotes nothing under \(\Upsilon\): the meaning of a methodized term is \(\Upsilon \circ U_m\), the meaning of its erasure (§8), which is the precise form of the statement that the model does not depend on its labels. A label is read by the numerical semantics \(\mathrm P\), a functor from the methodized terms, the paths of labeled generators that \(M_m\) of §8 produces, into the category \(\mathcal D\) of representations, whose value on a labeled generator \((\omega, M, G)\) is a morphism \(\mathrm P(\omega, M, G) : \mathrm P X \to \mathrm P Y\) of \(\mathcal D\), the routine the handler computes; since a methodized term is a path of labeled generators, \(\mathrm P\) is fixed on every one by its values on them. This is the shape of a handler of an algebraic effect in Plotkin and Pretnar (2009): each handler "corresponds to a model of the theory", and handling a term is the homomorphism the model induces (abstract; §3.2 for operation symbols with parameters, in that paper the values of base types that an operation symbol takes).5 Their model satisfies the equations of the effect theory; \(\mathrm P\) satisfies the arities of the labeled generators and nothing more, so it is a model of the signature, the theory without its equations. Functional programming §8 writes the realization of a fully specified expression \(e\) as \(\mathrm P_{c,m,s}(e)\), which is \(\mathrm P\) applied to the term \(K_s\, M_m\, \mathcal C_c(e)\) with its calibration \(c\), its method assignment \(m\) and its configuration \(s\) bound, as they stand in the configured version of the stage (Kinds and sorts §6).
Exact Evaluation carries the stored function unchanged. For an interpolating representation satisfying §5's law on its admitted functions and data, restriction followed by reconstruction is the idempotent \(s\circ r\) on \(\mathcal F\), and \(r\circ s\) is the identity on \(\mathcal A\). These conclusions depend on nodal reproduction; they are not general properties of every representation or fitting algorithm.
Whether the realized operator is close to the exact one, a relation between \(\Upsilon\) and \(\mathrm P\) composed with the maps that decode a representation, is the semiconjugacy of Semi-conjugacy: a proposition to be proved for each method under its conditions, and no typing fact.
8 The two erasures¶
Two things can be forgotten. Forget the labels: every operator keeps its inputs, outputs and equations, and its method and grid components become empty, while the lines a methods file added, the derivative lines and the rows of a solution method, remain. Forget the methods file: everything it added is removed, and the stage file's own term returns. The first says that the meaning of the operations does not depend on the labels; the second returns the model itself, the stage file.
Formally, the erasure of the labels \(U_m : \Sigma_m \to \Sigma\) is the functor that is the identity on objects and forgets the parameter of every morphism. A method assignment \(m\), the entries of a methods file read after the union with the closed forms that !explicit entries generate (§5), defines the methodization \(M_m : \Sigma \to \Sigma_m\) on each operation symbol \(\omega\) as \(\omega\) with the parameter \([m(\omega)]\), and with the identity label on every generator without an entry, so that \(M_m\) is total; it extends to every path by composition, the labels concatenated as §3 states, and is a functor because \(\Sigma\) is free on its operation symbols. The section law
holds on every path, since forgetting the parameter of \(\omega\) with parameter \([m(\omega)]\) returns \(\omega\) and a path's parameter is the concatenation of its generators' parameters: \(M_m\) is a section and \(U_m\) a retraction (Adámek, Herrlich and Strecker 2004, Definitions 7.19 and 7.24, pp. 106–107).4 \(U_m\) is many-to-one, and no isomorphism between a method and anything else is claimed.
The erasure of the addition \(U_a\) acts on the term before elaboration. A methods file is an addition \(A\), and the union \(S \sqcup A\) of the stage file \(S\) with it keeps the provenance of every item, the file and position it was written at (addition). \(U_a\) removes the items whose provenance is \(A\), so that
The union is associative with the empty addition as its unit, and \(S\) stands as its leftmost operand, so several additions apply in the order the recipe of the stage's trellis lists them (specification factory) and \(U_a\) removes them together. \(U_a\) removes what \(U_m\) keeps: the derivative lines, the rows of a solution method, the declared settings and any coordinate an addition appends to a signature. On the elaborated stage the result of \(U_a\) is the declared level of §9, which the stage stores.
9 The two levels of a stage¶
A solution method computes a builder by lines of its own. The endogenous grid method computes the policy by the Euler equation inverted by the inverse marginal utility, the line of the endogenous grid and the identification of the policy with its candidate,
[id=policy, policy.method : !egm | policy.grid : !Cartesian(a=(a_min, a_max, n_a))
| evaluate.method : !Linear] {
c[>] = 𝑑𝑢𝑖𝑛𝑣(β*D_{a}V[>]) :: [id=InvEuler]
m[>] = a + c[>] :: [id=g_cntn_to_dcsn]
c[~] = c[>] :: [id=cons_choice]
}
where 𝑑𝑢𝑖𝑛𝑣 is the inverse of the marginal utility 𝑑𝑢 the stage defines, in place of the maximization c = argmax_{cp : Γ_c(m)}(𝑢(cp) + β*V[>]) the stage file declares, with Γ_c(m) the feasible set of consumption at resources m. The stage holds both. The declared level is the stage file's own lines, read by stage.declared; the operative level is the stage as it is computed, in which the rows of an addition's block whose method component holds a solution method stand in place of the declared lines of that block. A derivative line, D_{m}V = 𝑑𝑢(c), stands at both levels: it states a property of the value the model defines, the envelope condition, true under the conditions of §10, and defines no new field; the author may write it in the stage file or in the methods file, where derivatives are read, and it adds no step of computation. A solution method that supplies no rows, !vfi, leaves the declared lines in place at both levels. Where a block's method component holds no solution method, an appended line is an authored line of the block, and a second definition of a field is refused. The declared level is stored and not reconstructed, so the erasure of §8 returns it exactly. The stage's graphs as elaborated from the stage file, its two initial diagrams and its declared builders (semgraph), are unchanged by any binding; what a method changes stands in the operative builders alone, the builders as computed.
The condition under which the method's lines compute the maximization, the first-order condition being necessary and sufficient and the envelope condition holding, is an obligation: the stage lists it, under egm-eligibility, and checks nothing. Under that condition the operative builder denotes the declared operation; without it the two levels denote different operators. Whether two methods compute the same policy is a separate proposition with its own conditions, and no component of a signature claims it.
10 Nothing is differentiated¶
The language differentiates no expression: no derivative rule is attached to any operation kind, the derivative operator D admits no method, and the only analytic statement of a derivative is a line the author writes. The derivative of a value is read by the derivative term, D_{a}V[>], the derivative operator applied to a value field in the coordinate of its subscript (Fields, functions and types §1.2), and it is stated by a derivative line, D_{m}V = 𝑑𝑢(c), the envelope condition of the decision value. A row of a method that reads a derivative term declares a reading and nothing more.
Two facts about stored numbers are not differentiation of an expression. At realization, a handler that meets a derivative term no line states evaluates it through the representation the methods file fixed for that value, reading the slope of the stored interpolant, which for piecewise linear interpolation is a step function. Where a value passes through a builder whose lines are identities, expectations or scalings of the value it reads, the realization applies the same linear map to the stored derivative values, so that the envelope line of the decision value serves the stage before it; for an expectation this asserts that the derivative of the expectation is the expectation of the derivative, which holds under a dominating bound. The condition under which a stated derivative line holds, that the value is differentiable and the envelope theorem applies, is an obligation the stage lists under marginal-reading and checks nothing; the exchange of the derivative and the expectation is a condition recorded under the name differentiation-under-the-integral for the arrival builder it concerns, and no stage lists it yet. Where the law of motion between two perches is not the identity in the differentiated coordinate, the author writes the derivative line with the law's factor, as the buffer-stock arrival builder writes D_{k}V[<] = E_{ψ,ξ}(R * (Γ*ψ)^(-ρ) * D_{m}V), with Γ the growth factor of permanent income.
11 Related documents¶
- Across: Operators and builders, Semi-conjugacy, Functional programming §§5, 7 and 8, Kinds and sorts, Ingredients.
- In the wiki: methods, grid, addition, settings, handler, Ρ.
-
M. Capucci, B. Gavranović, J. Hedges and E. F. Rischel (2022), "Towards Foundations of Categorical Cybernetics," Electronic Proceedings in Theoretical Computer Science 372 (Applied Category Theory 2021), 235–248, Definition 2, p. 236: for a category \(\mathcal C\) acted on by a strict monoidal category \(\mathcal M\), the objects of \(\mathrm{Para}_\bullet(\mathcal C)\) are those of \(\mathcal C\), a 1-cell \(X \to Y\) is an object \(M\) of \(\mathcal M\) with a morphism \(M \bullet X \to Y\), the composite of \(X \to Y\) with parameter \(M\) and \(Y \to Z\) with parameter \(N\) has parameter \(N \odot M\), and a 2-cell is a morphism of \(\mathcal M\). The trivial action used here, \(M \bullet X = X\) with identities for the coherence maps, satisfies the paper's Definition 1 of an actegory (p. 236). ↩↩
-
B. Jacobs (1999), Categorical Logic and Type Theory, Studies in Logic and the Foundations of Mathematics 141, Elsevier, §1.1, pp. 20–21: a family of sets indexed by \(I\) is displayed as a map \(\varphi : X \to I\) whose fibers over \(i\) are the sets of the family, and a fibration is the categorical structure that captures indexing and substitution. ↩
-
C. D. Carroll (2006), "The method of endogenous gridpoints for solving dynamic stochastic optimization problems," Economics Letters 91(3), 312–320, §2.2, p. 315: "the gridpoints for the policy functions are not predetermined; instead they are endogenously generated from a predetermined grid of values of end-of-period assets." ↩
-
J. Adámek, H. Herrlich and G. E. Strecker (2004), Abstract and Concrete Categories: The Joy of Cats, free online edition (originally Wiley, 1990), Definition 7.19, p. 106: a morphism \(f : A \to B\) is a section provided there is \(g : B \to A\) with \(g \circ f = \mathrm{id}_A\); Definition 7.24, p. 107: \(f\) is a retraction provided there is \(g\) with \(f \circ g = \mathrm{id}_B\), and \(B\) is then a retract of \(A\). ↩↩
-
G. Plotkin and M. Pretnar (2009), "Handlers of Algebraic Effects," in Programming Languages and Systems (ESOP 2009), Lecture Notes in Computer Science 5502, 80–94, abstract: "Each such handler corresponds to a model of the theory for the effects at hand. The handling construct […] is interpreted using the homomorphism induced by the universal property of the free model"; §3.2: operation symbols take parameters of base types. ↩