entropy
module¶
Entropies and their derivatives.
EntropyHessianComponents = tuple[ThreeArrays, TwoArrays]
module-attribute
¶
combines the tuples of the values of the components of the hessians.
EntropyHessianMuMu = Callable[[Matching], ThreeArrays]
module-attribute
¶
The type of a function that takes in a Matching and returns the three components of the hessian of the entropy wrt (\mu,\mu).
EntropyHessianMuMuParam = Callable[[Matching, list[Any]], ThreeArrays]
module-attribute
¶
The type of a function that takes in a Matching and a list of additional parameters and returns the three components of the hessian of the entropy wrt (\mu,\mu).
EntropyHessianMuR = Callable[[Matching], TwoArrays]
module-attribute
¶
The type of a function that takes in a Matching and returns the two components of the hessian of the entropy wrt (\mu,n) and (\mu, m)).
EntropyHessianMuRParam = Callable[[Matching, list[Any]], TwoArrays]
module-attribute
¶
The type of a function that takes in a Matching and a list of additional parameters and returns the two components of the hessian of the entropy wrt (\mu,n) and (\mu, m)).
EntropyHessians = tuple[EntropyHessianMuMu, EntropyHessianMuR]
module-attribute
¶
combines the hessian functions
EntropyHessiansParam = tuple[EntropyHessianMuMuParam, EntropyHessianMuRParam]
module-attribute
¶
combines the hessian functions when additional parameters are used
EntropyFunctions
dataclass
¶
Defines the entropy used, via the derivative e_0 + e \cdot \alpha
Attributes:
Name | Type | Description |
---|---|---|
e0_fun |
MatchingFunction | MatchingFunctionParam
|
required |
parameter_dependent |
bool
|
if |
e_fun |
Optional[MatchingFunction | MatchingFunctionParam]
|
only in entropies that depend on parameters.
Defaults to |
hessian |
Optional[str]
|
defaults to |
e0_derivative |
Optional[EntropyHessians | EntropyHessiansParam]
|
the derivative of |
e_derivative |
Optional[EntropyHessians | EntropyHessiansParam]
|
the derivative of |
additional_parameters |
Optional[list]
|
additional parameters
that define the distribution of errors.
Defaults to |
description |
Optional[str]
|
some text describing the model.
Defaults to |
Examples:
See entropy_choo_siow
in choo_siow.py
Source code in cupid_matching/entropy.py
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 |
|
entropy_gradient(entropy, muhat, alpha=None, additional_parameters=None)
¶
Computes the derivative of the entropy wrt \mu at (\mu, n, m, \alpha, p)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entropy |
EntropyFunctions
|
the |
required |
muhat |
Matching
|
a Matching |
required |
alpha |
Optional[np.ndarray]
|
a vector of parameters of the derivative of the entropy, if any |
None
|
additional_parameters |
Optional[list]
|
a list of additional parameters |
None
|
Returns:
Type | Description |
---|---|
np.ndarray
|
the derivative of the entropy wrt \mu |
np.ndarray
|
at (\mu, n, m, \alpha, p). |
Source code in cupid_matching/entropy.py
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 |
|