requationuncertainty

How to evaluate the error/uncertainty of an equation in R?


I have a dataframe of four columns (https://www.dropbox.com/s/hho5sgwjhlk4185/data.csv?dl=0). I populated the rtp column based on the other ones, using the equation 0.03385*(pp**2)*(mv**0.94500)*(cc**(-0.03047)). Now, I would like to see the uncertainty of this equation and I do not know how to do this. Should I use a form of pseudo dataset or monte carlo and if so, how can I do this for the rtp column? I use R.


Solution

  • As far as I understood your data.csv table, you have one row for each sample. So if I understand it correctly, you already have all the samples with the proper distribution.

    You calculated the rtp column on these samples. Then, if you want the distribution (standard error, confidence intervals) of the rtp, just take it directly from the rtp sample values! :

    dat <- read.csv("data.csv")
    
    mean(dat$rtp)
    # [1] 0.008637943
    median(dat$rtp)
    # [1] 0.005488155
    sd(dat$rtp)
    # [1] 0.01236283
    quantile(dat$rtp, c(0.025, 0.975))
    #         2.5%        97.5% 
    # 0.0007099517 0.0436855541 
    

    As simple as this. This is exactly the same principle as you would do it on the MCMC samples, but you already have the samples in each row so no need to use MCMC to generate them.