Interestingly enough, I had done that with an earlier version of the model, and it worked very well, returning parameters fairly close to those used to generate the data.
That is interesting. I had a closer look at the model today.
It looks like this Johnson and Cook model is defined in terms of the plastic strain (epsilon - sigma / E). I wouldn't try to estimate the Young's modulus E (is that what it's called?) at the same time as doing this fit. Reason being:
For the E parameter, you get the plastic strain as:
plastic_strain = epsilon - sigma / E
Then this goes into the Johnson-Cook model like:
sigma ~ normal((A + B * plastic_strain^n)..., stdDev)
The first issue is that if you're estimating B and E, you can put this all together and get:
sigma ~ normal((A + B * (epsilon - sigma / E)^n)..., stdDev)
And since we don't really care about the value of B, we could write that like a different parameter C and bring it inside the power:
sigma ~ normal((A + (C * epsilon - C * sigma / E)^n)..., stdDev)
So we are kindof trying to estimate C and E in the ratio C/E, so that could easily lead to some nonidentifiability. It's my understanding that B as a parameter here is just to make the fit good and we really don't care about its value. It really looks like all it's doing is reversing the transformation
plastic_strain = epsilon - sigma / E.
Another issue is I'm not sure what sigma is doing on both sides of the equation here :D. So I think if we need to use the Johnson-Cook model, we need to be comfortable in transforming our data to plastic strain before it goes in.
If you actually have reasonably clear elastic deformation in your data (where sigma = e E), then I think you should just chop of those bits of the curves and do a separate fit to get an estimate of the elastic constants. Do you think you have enough data to get good estimates on these Young's Moduli for your samples?
I think the issue you were originally talking about is that you still have some uncertainty in E (from sample to sample or whatever), so you'd like to pass that through the rest of the analysis. I'm not sure with the Johnson-Cook stuff (where we infer a value of B) we can really do that (the values of B will just adjust to whatever value of E we feed in).
This is where my unfamiliarity with Stan will show, but I don't think there's a way to do like a random likelihood thing here? Every random variable in Stan gets inferred (there's no way to say for each sample let E come from a normal(0, 1) not influenced by anything else -- the prior can be like that but Stan explores the posterior and we don't control that), and this is a non-identifiable model so these inferences will go south. I don't think there's anything we can do here other than fix E and pray or fix B and pray. Neither seem particularly delightful cause we don't get that uncertainty we are after.
I think you can make the argument that Tm might try to cancel itself out (and not even matter). If we try to estimate the melting temperature parameter, we're messing with a factor:
(1 - ((T - Troom) / (Tm - Troom))^m)
If m is 1 (and I think you expect it to be near 1?) then that simplifies to:
(Tm - T) / (Tm - Troom)
The derivative of this with respect to
Tm is proportional to
1 / (Tm - Troom), so if
Tm - Troom is large, this isn't even really going to change the log probability of the problem much? Maybe it's canceling itself out? It's probably dangerous thinking to handwave the math like this. Either way I wouldn't expect it to accomplish much, because there's a big factor of A that you could pull out front that is just going to adjust to be whatever it needs to be to fit the curves.
The way to actually verify I'm not just making stuff up (and I could be cause I didn't run the models) is to check out pairplots of the traceplots and see if things are really tightly correlated. I think B and E would be (and this will lead to crazy estimates of each of these parameters in the posterior). You might check A and Tm as well.
Any chance you have a simpler model as an option? Do they all work on this plastic strain thing?
Hopefully there's not too much wrong with this wall of text. I haven't told you anything you didn't already know haha. No closer to having meaningful posteriors. I'll try to play around with simulated data on this sometime in the near future so I can do more than speculate.