|
gdrsclib
|
Go to the source code of this file.
Functions | |
| struct datablock | transform (struct datablock dbin, double(*f)(double), struct appdata ad) |
| Apply a function to a datablock. More... | |
| struct datablock | binop (struct datablock a, struct datablock b, char op, struct appdata ad) |
| Carry out a binary operation (+, -, *, /) on two datablock structures. More... | |
| struct datablock | scalmult (double scalar, struct datablock dbin, struct appdata ad) |
| Multiply a datablock by a scaling factor. More... | |
| double | pnorm (double x) |
| The cumulative standardized normal distribution. More... | |
| double | quick_qnorm (double p) |
| Abramowitz & Stegun approximation to qnorm to get a good first guess. More... | |
| double | qnorm (double p) |
| The inverse cumulative standardized normal distribution. More... | |
| double | dnorm (double x) |
| The standard normal probability density. More... | |
| double | ztransf (double y, double ybar, double sigma) |
| The transformed value \( z = \frac{1}{\sigma} \ln\left(y/\bar y\right) + \frac{1}{2}\sigma\). More... | |
| double | gini2sdlog (double gini) |
| The standard deviation of the log of income corresponding to a given Gini, assuming lognormal. More... | |
| struct timeseries | filter (struct datablock data, struct fixedfactor filter, struct appdata ad) |
| Aggregate data in a datablock using a fixedfactor "filter" to produce a timeseries. More... | |
| double | filteryr (int year, struct datablock data, struct fixedfactor filter, struct appdata ad) |
| Aggregate data in a datablock using a fixedfactor "filter" for a particular year. More... | |
Carry out a binary operation (+, -, *, /) on two datablock structures.
| a | First input datablock |
| b | Second input datablock |
| op | Binary operation to carry out |
| ad | appdata structure with dimensions |
Definition at line 69 of file blockmath.c.
| double dnorm | ( | double | x | ) |
The standard normal probability density.
| x | The value at which the density function is computed |
Definition at line 201 of file blockmath.c.
| struct timeseries filter | ( | struct datablock | data, |
| struct fixedfactor | filter, | ||
| struct appdata | ad | ||
| ) |
Aggregate data in a datablock using a fixedfactor "filter" to produce a timeseries.
| data | Datablock with data |
| filter | Fixed factor with coefficients (typically 1 and 0) to multiply data by before summing |
| ad | appdata with dimensions |
Definition at line 250 of file blockmath.c.
| double filteryr | ( | int | year, |
| struct datablock | data, | ||
| struct fixedfactor | filter, | ||
| struct appdata | ad | ||
| ) |
Aggregate data in a datablock using a fixedfactor "filter" for a particular year.
| year | Year for which to evaluate result |
| data | Datablock with data |
| filter | Fixed factor with coefficients (typically 1 and 0) to multiply data by before summing |
| ad | appdata with dimensions |
Definition at line 279 of file blockmath.c.
| double gini2sdlog | ( | double | gini | ) |
The standard deviation of the log of income corresponding to a given Gini, assuming lognormal.
| gini | The Gini coefficient value at which to evaluate the function (in percentage points, 0..100) |
NaN if out of bounds Definition at line 235 of file blockmath.c.
| double pnorm | ( | double | x | ) |
The cumulative standardized normal distribution.
| x | Value at which to evaluate the function |
Definition at line 128 of file blockmath.c.
| double qnorm | ( | double | p | ) |
The inverse cumulative standardized normal distribution.
| p | The probability at which to evaluate the function |
NaN if exceed max iterationsDefinition at line 167 of file blockmath.c.
| double quick_qnorm | ( | double | p | ) |
Abramowitz & Stegun approximation to qnorm to get a good first guess.
| p | Probability level at which to evaluate the function |
Definition at line 140 of file blockmath.c.
Multiply a datablock by a scaling factor.
| scalar | The factor to multiply dbin by |
| dbin | The input datablock |
| ad | appdata structure with dimensions |
Definition at line 103 of file blockmath.c.
Apply a function to a datablock.
This file implements special mathematical functions, and math operations on data structures
| dbin | The datablock to transform |
| f | A function to apply to each element of the datablock |
| ad | appdata structure with dimensions |
Definition at line 38 of file blockmath.c.
| double ztransf | ( | double | y, |
| double | ybar, | ||
| double | sigma | ||
| ) |
The transformed value \( z = \frac{1}{\sigma} \ln\left(y/\bar y\right) + \frac{1}{2}\sigma\).
| y | The income at which the function is evaluated |
| ybar | Mean income for the country |
| sigma | Standard deviation of the log of income for the country |
Definition at line 213 of file blockmath.c.
1.8.14