The length $a$ of a crack after $N$ fatigue cycles $N$ is
$$a(N;C,m) = \left(a_0^{\left(1-\frac m 2\right)}+ C\left(1-\frac m 2\right)B^mN\right)^{\frac{2}{2-m}}$$
where $a_0$ is the initial crack length, $B$ is a value which depends on the range of stresses applied during a fatigue cycle, and $C$ and $m$ are unknown model parameters. We have a dataset $D$ of iid measurements $D=(N_i, a_i)_{i=1}^{n}$ ($n$ is the number of measurements, not to be confused with the number of cycles $N$), where, for fixed $a_0$ and $B$, each time we perform a different number of fatigue cycles $N_i$ and we measure the corresponding final crack length $a_i$.
The goal of the analysis is to estimate the number of cycles $N_c$ such that the probability $Pr\left(a(N;C,m)>a_c\right)$ is equal to a threshold value $p_c$. We work in a Bayesian framework, so we assume Gaussian priors $\ln{C}\sim\mathcal{N}(\mu_C, \sigma_C)$, $m\sim\mathcal{N}(\mu_m, \sigma_m)$ for the model parameters, and measurements errors $\epsilon\sim\mathcal{N}(0, \sigma_{\epsilon})$. In other words, we assume that the likelihood $\mathcal{L}(D|C,m)$ of the data $D$ under our crack growth model is
$$\mathcal{L}(D|C,m)=\frac{1}{(2\pi\sigma_{\epsilon}^2)^{n/2}}e^{-SS/2\sigma_{\epsilon}^2}$$
where the residual sum of squares is
$$SS=\sum_{i=1}^n(a_i-a(N_i;C,m))^2 $$
How can I estimate $N_c$?
A possible solution (if I'm not forgetting something important) could be to:
- use MCMC to compute the posterior distribution of random parameters $C, m$ $$p(C,m|D)=\frac{\mathcal{L}(D|C,m)p(C)p(m)}{\int\mathcal{L}(D|C,m)p(C)p(m)dCdm}$$
- sample $C_i, m_i$ from $p(C,m|D)$ (actually, MCMC generates samples from $p(C,m|D)$, so I already have such samples from step 1)
- substitute the samples $C_i,m_i$ into $a(N;C,m)$, for an array of values $N_j=0,\dots,N_{max}$. For each $N_j$, I thus have a set of samples $a_{ij}=a(N_j;C_i,m_i)$
- for each value $N_j$ I estimate $Pr\left(a(N;C,m)>a_c\right)$ as $\frac{\#(a_{ij}>a_c)}{\#a_{ij}}$, i.e., the number of samples $a_{ij}>a_c$ divided by the total number of samples $a_{ij}$ (apologies if the notation is awkward/nonstandard: feel free to suggest improvements).
- I estimate $N_c$ as the smallest $N_j$ such that $\frac{\#(a_{ij}>a_c)}{\#a_{ij}}>p_c$
However, I have two doubts:
- This isn't really much of an estimate. Ideally, given a dataset $D$, a statistical estimation procedure of $N_c$ should return an estimated values as well as some measure of the estimation uncertainty. Here I just got a value for $N_c$. What am I missing?
- for a series of reasons, I'd need to implement this in Python, and to have the whole procedure run really fast (ideally, a few seconds). It looks like MCMC can be slow even for these simple problems, so I was wondering if there could be an alternative way to sample from $p(C,m|D)$. I could compute the normalization factor $Z=\int\mathcal{L}(D|C,m)p(C)p(m)dCdm$ using the tensor product of two 1D Gauss-Hermite quadrature rules, similar to what it's illustrated here. However, how would I then sample from the posterior?