Module estimate¶
This platecurie
module contains the following functions:
bayes_estimate_cell()
: Set uppymc
model and estimate the parameters of the magnetic layer model using a probabilistic Bayesian inference method.get_bayes_estimates()
: Explore the output of sampling thepymc
modelL2_estimate_cell()
: Set up non-linear curve fitting to estimate the parameters of the magnetic layer model using non-linear least-squares from the functionscipy.optimize.curve_fit()
.get_L2_estimates()
: Explore the output the non-linear inversioncalculate_psd()
: Calculate the analytical PSD function.
An internal function is available to calculate predicted power-spectral density data
with a theano
decorator to be incorporated as pymc
variables. These functions are
used within Project
methods as with plotting
functions.
-
platecurie.estimate.
bayes_estimate_cell
(k, psd, epsd, fix_beta=None, prior_zt=None, draws=500, tunes=500, cores=4)¶ Function to estimate the parameters of the magnetic model at a single cell location of the input grids.
Can incorporate 2 (‘A’, and ‘dz’), 3 (either ‘A’, ‘zt’ and ‘dz’ or ‘A’, ‘dz’, and ‘beta’) or 4 (‘A’, ‘zt’, ‘dz’, and ‘beta’) stochastic variables.
- Parameters
k (
ndarray
) – 1D array of wavenumberspsd (
ndarray
) – 1D array of wavelet scalogram (wavelet PSD)epsd (
ndarray
) – 1D array of error on wavelet scalogram (wavelet PSD)fix_beta (float, optional) – Fixed
beta
parameter or estimate it ifNone
prior_zt (float, optional) – Fixed
zt
parameter or estimate it ifNone
draws (int) – Number of samples to draw from the posterior
tunes (int) – Number of samples to discard (burn-in)
cores (int) – Number of computer cores to use in calculating independent markov chains
- Returns
- (tuple): Tuple containing:
trace
MultiTrace
Posterior samples from the MCMC chains
summary
DataFrame
Summary statistics from Posterior distributions
map_estimate
dictContainer for Maximum a Posteriori (MAP) estimates
-
platecurie.estimate.
get_bayes_estimates
(summary, map_estimate)¶ Extract useful estimates from the Posterior distributions.
- Parameters
summary (
DataFrame
) – Summary statistics from Posterior distributionsmap_estimate (dict) – Container for Maximum a Posteriori (MAP) estimates
- Returns
- (tuple): tuple containing:
mean_A (float) : Mean value of the constant term
A
std_A (float) : Standard deviation of the constant term
A
best_A (float) : Most likely value of the constant term
A
mean_dz (float) : Mean value of the magnetic layer thickness
dz
std_dz (float) : Standard deviation of magnetic layer thickness
dz
best_dz (float) : Most likely magnetic layer thickness
dz
mean_zt (float, optional) : Mean value of the depth to top of layer
zt
std_zt (float, optional) : Standard deviation of the depth to top of layer
zt
best_zt (float, optional) : Most likely value of the depth to top of layer
zt
mean_beta (float, optional) : Mean value of the fractal parameter
beta
std_beta (float, optional) : Standard deviation of fractal parameter
beta
best_beat (float, optional) : Most likely fractal parameter
beta
-
platecurie.estimate.
L2_estimate_cell
(k, psd, epsd, fix_beta=None, prior_zt=None)¶ Function to estimate the parameters of the magnetic model at a single cell location of the input grids.
- Parameters
k (
ndarray
) – 1D array of wavenumberspsd (
ndarray
) – 1D array of wavelet scalogram (wavelet PSD)epsd (
ndarray
) – 1D array of error on wavelet scalogram (wavelet PSD)fix_beta (float, optional) – Fixed
beta
parameter or estimate it ifNone
prior_zt (float, optional) – Fixed
zt
parameter or estimate it ifNone
- Returns
- (tuple): Tuple containing:
summary
DataFrame
Summary statistics from L2 estimation
-
platecurie.estimate.
get_L2_estimates
(summary)¶ Returns digestible estimates from the L2 estimates.
- Parameters
summary (
DataFrame
) – Summary statistics from Posterior distributions- Returns
- (tuple): tuple containing:
mean_A (float) : Mean value of the constant term
A
std_A (float) : Standard deviation of the constant term
A
mean_dz (float) : Mean value of the magnetic layer thickness
dz
std_dz (float) : Standard deviation of magnetic layer thickness
dz
mean_zt (float, optional) : Mean value of the depth to top of layer
zt
std_zt (float, optional) : Standard deviation of the depth to top of layer
zt
mean_beta (float, optional) : Mean value of the fractal parameter
beta
std_beta (float, optional) : Standard deviation of fractal parameter
beta
rchi2 (float) : Reduced chi-squared value
-
platecurie.estimate.
calculate_psd
(k, A, zt, dz, beta)¶ Calculate analytical expression for the power-spectral density function.
- Parameters
k (
ndarray
) – 1D array of wavenumbersA (float) – Constant (i.e., DC) value for PSD [1., 30.]
zt (float) – Depth to top of magnetized layer (km) [0., 10.]
dz (float) – Thickness of magnetized layer (km) [1., 50.]
beta (float) – Power-law exponent for fractal magnetization
- Returns
(
ndarray
): Power-spectral density function (shapelen(k)
)- Rubric
References
Audet, P., and Gosselin, J.M. (2019). Curie depth estimation from magnetic anomaly data: a re-assessment using multitaper spectral analysis and Bayesian inference. Geophysical Journal International, 218, 494-507. https://doi.org/10.1093/gji/ggz166
Blakely, R.J., 1995. Potential Theory in Gravity and Magnetic Applications, Cambridge Univ. Press.
-
platecurie.estimate.
calculate_bouligand
(k, A, zt, dz, beta)¶ Calculate the synthetic power spectral density of magnetic anomalies Equation (4) of Bouligand et al. (2009)
- Parameters
k (
ndarray
) – 1D array of wavenumbersA (float) – Constant (i.e., DC) value for PSD [1., 30.]
zt (float) – Depth to top of magnetized layer (km) [0., 10.]
dz (float) – Thickness of magnetized layer (km) [1., 50.]
beta (float) – Power-law exponent for fractal magnetization
- Returns
(
ndarray
): Power-spectral density function (shapelen(k)
)- Rubric
References
Bouligand, C., J. M. G. Glen, and R. J. Blakely (2009), Mapping Curie temperature depth in the western United States with a fractal model for crustal magnetization, J. Geophys. Res., 114, B11104, doi:10.1029/2009JB006494