knitr::opts_chunk$set(fig.width = 7, fig.height = 5)

This packages provides real-world data on porosity. In this vignette, we are going to exemplify the use of this package using these data.

First, we should load the libraries to get access to this function:

library(devtools)
load_all()
library(exPrior)

Let us start by importing data on porosity in sandstone aquifers.

load(file="data/df_porosity.rda")

These real-world data can now be used to compute the prior.

resExPrior = genExPrior(exdata = df_porosity, theta = seq(from=0, to=1, by=0.01))

Here, the range of the theta vector reflects the common-sense intuition that porosity values can only be found between 0 and 1.

After the completion of exPrior, we can visualize both the uninformative and informative distribution of $\theta$ using plotExPrior. This function again takes as input the output from genExPrior as well as a Boolean asking whether to additionally plot the used data.

plotHyperDist(resExPrior)

Compared to the introductory example, the hyper prior distributions are much narrower, indicating extremely small uncertainty about their values. This small uncertainty is caused by the large amount of data used for the inference. Next, let us look at the predicted prior distribution.

plotExPrior(resExPrior, plotExData = TRUE)

As can be seen, the prior distribution for porosity values in sandstone is strongly peaked between 0.2 and 0.3 as determined by the available data. Using this prior can therefore provide a sound foundation for statistical inference.



kcucchi/gPrior documentation built on Jan. 27, 2020, 5:03 a.m.