jensdebruijn / Bayesian-updating-of-hurricane-vulnerability-functions

Using rapid damage observations from social media for Bayesian updating of hurricane vulnerability functions: A case study of Hurricane Dorian
MIT License
2 stars 0 forks source link

Posterior plots do not align with the paper #2

Open sandiemann opened 1 year ago

sandiemann commented 1 year ago

Hi Jens,

After running the R script to estimate posterior, we were analyzing the posterior theta files and comparing them against the graphs in the paper to further understand the model. However we noticed that the values did not exactly line up, especially for theta4 and theta6. Could you explain why this discrepancy came about? Was there any further transformation done to the files before these trace plots were made?

Values per iteration for low-quality building:

Screenshot 2023-06-30 at 17 00 49
jensdebruijn commented 1 year ago

Mmm, that is strange. How do the graphs of the posterior's look like? A non-exact match is expected as it is a random process, and I don't think I set a fixed seed (I think as it has been a while). However, as you point out, a large deviation is not expected. I will try to run the scripts myself again sometime in the next few weeks to see if I can find out what happens.

sandiemann commented 1 year ago

@jensdebruijn did you get a chance to check this out?

jensdebruijn commented 1 year ago

To debug this, could you let me know what the posteriors look like? Are they similar to the paper? Thanks!

jensdebruijn commented 1 year ago

For me a quick plot posterior plots with the mean output of a new run match well with the paper (of course a slight deviation due to random processes)

image

sandiemann commented 1 year ago

the posterior plot are matching with the paper with slight deviation but the issue is regarding the values. I am attaching the "bad" building type plots w.r.t. your paper.

paper: Screenshot 2023-08-16 at 15 47 38

result:

Screenshot 2023-08-16 at 15 47 25

Please note the discrepancy in the values range scale.

jensdebruijn commented 1 year ago

Ok, I believe I got it, but I will try to confirm by finding my old files. Trying to dig out what I did and why. (Again, it has been a while). The key seems to be here:

image

This normalization is performed with norm_factor in the R-script.

When I correct the theta values for this normalization (what I believe should be correct is divide theta_3, and theta_6 by the norm_factor, and multiply theta_1 by the norm factor), I get similar theta values to what I reported in the paper. So probably I also did this for the plots in the paper. Again, slight deviation due to random processes.

Moreover, when I test a few of these "corrected" theta values and plug them directly into equations 5-7 in the paper, I indeed get the expected damage ratios.

Unfortunately, I cannot find the script that I used to plot the values right now, but I will try if I can find them on an old hard drive. However, in the mean time, I believe that this is correct. Please let me know whether this indeed solves your issue so that I can fix the R script accordingly.

Thanks!

sandiemann commented 1 year ago

This would also explain why we were getting equiprobable solutions ans we had to update distribution parameters,

Screenshot 2023-08-17 at 17 50 53