Assorted functions for visualizing and summarizing the prior and posterior probability distributions associated with ABC analyses.

plotPrior(
  priorFn = match.arg(arg = priorFn, choices = c("fixed", "uniform", "normal",
    "lognormal", "gamma", "exponential"), several.ok = FALSE),
  priorVariables,
  plotQuants = TRUE,
  plotLegend = TRUE
)

plotUnivariatePosteriorVsPrior(
  posteriorCurve,
  priorCurve,
  label = "parameter",
  trueValue = NULL,
  ...
)

getUnivariatePriorCurve(
  priorFn,
  priorVariables,
  nPoints = 1e+05,
  from = NULL,
  to = NULL,
  alpha = 0.8,
  coda = FALSE,
  verboseMultimodal = TRUE,
  ...
)

getUnivariatePosteriorCurve(
  acceptedValues,
  from = NULL,
  to = NULL,
  alpha = 0.8,
  coda = FALSE,
  verboseMultimodal = TRUE,
  ...
)

Arguments

priorFn

Prior Shape of the distribution; one of either "fixed", "uniform", "normal", "lognormal", "gamma", or "exponential".

priorVariables

Variables needed to describe the shape of the distribution, dependent on priorFn:

priorFn = "uniform"

priorVariables = c(min, max)

priorFn = "normal"

priorVariables = c(mean, standard deviation)

priorFn = "lognormal"

priorVariables = c(mean, standard deviation)

priorFn = "gamma"

priorVariables = c(shape, scale)

priorFn = "exponential"

priorVariables = c(rate)

plotQuants

If TRUE, plots line segments at the quantiles

plotLegend

If TRUE, plots legend box with quantile values

posteriorCurve

Kernal density estimates for the posterior distribution from getUnivariatePosteriorCurve.

priorCurve

Kernal density estimates for the prior distribution from getUnivariatePriorCurve.

label

Horizontal X-axis label for the plot.

trueValue

True parameter value, if any such exists and is known (usually only true of simulations).

...

For getUnivariatePriorCurve and getUnivariatePosteriorCurve, this can contain additional arguments passed to density, for use in both calculating the kernal density estimate for finding the curve, and for estimating the highest density interval. A user may want to mess with this to adjust bandwidth, et cetera. For plotUnivariatePosteriorVsPrior, this passes additional commands to the initial call plot, and thus can set things like a main plotting title, among other things.

nPoints

Number of points to draw.

from

Lower bound, if any. By default this is NULL and thus ignored.

to

Upper bound, if any. By default this is NULL and thus ignored.

alpha

The threshold used for defining the highest density frequency cut-off. If the highest density interval is applied to a Bayesian MCMC posterior sample, then the interval is effectively calculated for this value as a posterior probability density.

coda

Default is FALSE. If TRUE, unimodal highest density regions will instead be calculated using HPDinterval from package coda, which is similar to the function quantile in that it calculates only a single interval.

verboseMultimodal

If TRUE, the function will print a message indicating when the inferred highest density interval is discontinuous, and thus likely reflects that the supplied data is multimodal.

acceptedValues

Vector of accepted particle values.

Value

plotPrior and plotUnivariatePosteriorVsPrior produce plots of the respective distributions (see above).

getUnivariatePriorCurve returns a list of x and y density coordinates, mean, and the highest density intervals (HDI) for their respective distribution.

getUnivariatePosteriorCurve does the same for a posterior sample of parameter estimates, returning a list of x and y density coordinates, mean, and the highest posterior density intervals (HPD).

Details

Function plotPrior visualizes the shape of various prior probability distributions available in TreEvo ABC analyses, while getUnivariatePriorCurve returns density coordinates and summary statistics from user-selected prior probability distribution.

Similarly, function getUnivariatePosteriorCurve returns density coordinates and summary statistics from the posterior distribution of an ABC analysis.

Both getUnivariatePriorCurve and getUnivariatePosteriorCurve also calculate the highest density intervals for their respective parameters, using the function highestDensityInterval.

Function plotUnivariatePosteriorVsPrior plots the univariate density distributions from the prior and posterior against each other for comparison, along with the highest density intervals (HDI) for both.

The summaries calculated from getUnivariatePriorCurve and getUnivariatePosteriorCurve are used as the input for plotUnivariatePosteriorVsPrior, hence the relationship of these functions to each other, and why they are listed together here.

See also

Highest posterior densities are calculated via highestDensityInterval.

plotPosteriors Plots multiple posteriors against their priors and potential known values.

Author

Brian O'Meara and Barb Banbury

Examples

data(simRunExample) # examples with plotPrior plotPrior( priorFn = "exponential", priorVariables = c(10))
#> quant quant.value #> 1 0.01 0.001005034 #> 2 0.05 0.005129329 #> 3 0.25 0.028768207 #> 4 0.50 0.069314718 #> 5 0.75 0.138629436 #> 6 0.95 0.299573227 #> 7 0.99 0.460517019
plotPrior( priorFn = "normal", priorVariables = c(1, 2))
#> quant quant.value #> 1 0.01 -3.6526957 #> 2 0.05 -2.2897073 #> 3 0.25 -0.3489795 #> 4 0.50 1.0000000 #> 5 0.75 2.3489795 #> 6 0.95 4.2897073 #> 7 0.99 5.6526957
plotPrior( priorFn = "gamma", priorVariables = c(2, .2), plotQuants = FALSE, plotLegend = FALSE)
#> quant quant.value #> 1 0.01 0.7427737 #> 2 0.05 1.7768076 #> 3 0.25 4.8063938 #> 4 0.50 8.3917350 #> 5 0.75 13.4631726 #> 6 0.95 23.7193226 #> 7 0.99 33.1917603
# examples of getting density coordinates and # summary statistics from distributions priorKernal <- getUnivariatePriorCurve( priorFn = "normal", priorVariables = c(28, 2), nPoints = 100000, from = NULL, to = NULL, alpha = 0.95) postKernal <- getUnivariatePosteriorCurve( acceptedValues = resultsBMExample[[1]]$particleDataFrame$starting_1, from = NULL, to = NULL, alpha = 0.95) priorKernal
#> $x #> [1] 18.91576 18.95042 18.98508 19.01974 19.05440 19.08906 19.12372 19.15838 #> [9] 19.19304 19.22770 19.26236 19.29702 19.33168 19.36634 19.40100 19.43566 #> [17] 19.47032 19.50498 19.53964 19.57430 19.60896 19.64362 19.67829 19.71295 #> [25] 19.74761 19.78227 19.81693 19.85159 19.88625 19.92091 19.95557 19.99023 #> [33] 20.02489 20.05955 20.09421 20.12887 20.16353 20.19819 20.23285 20.26751 #> [41] 20.30217 20.33683 20.37149 20.40615 20.44081 20.47548 20.51014 20.54480 #> [49] 20.57946 20.61412 20.64878 20.68344 20.71810 20.75276 20.78742 20.82208 #> [57] 20.85674 20.89140 20.92606 20.96072 20.99538 21.03004 21.06470 21.09936 #> [65] 21.13402 21.16868 21.20334 21.23801 21.27267 21.30733 21.34199 21.37665 #> [73] 21.41131 21.44597 21.48063 21.51529 21.54995 21.58461 21.61927 21.65393 #> [81] 21.68859 21.72325 21.75791 21.79257 21.82723 21.86189 21.89655 21.93121 #> [89] 21.96587 22.00053 22.03520 22.06986 22.10452 22.13918 22.17384 22.20850 #> [97] 22.24316 22.27782 22.31248 22.34714 22.38180 22.41646 22.45112 22.48578 #> [105] 22.52044 22.55510 22.58976 22.62442 22.65908 22.69374 22.72840 22.76306 #> [113] 22.79772 22.83239 22.86705 22.90171 22.93637 22.97103 23.00569 23.04035 #> [121] 23.07501 23.10967 23.14433 23.17899 23.21365 23.24831 23.28297 23.31763 #> [129] 23.35229 23.38695 23.42161 23.45627 23.49093 23.52559 23.56025 23.59492 #> [137] 23.62958 23.66424 23.69890 23.73356 23.76822 23.80288 23.83754 23.87220 #> [145] 23.90686 23.94152 23.97618 24.01084 24.04550 24.08016 24.11482 24.14948 #> [153] 24.18414 24.21880 24.25346 24.28812 24.32278 24.35744 24.39211 24.42677 #> [161] 24.46143 24.49609 24.53075 24.56541 24.60007 24.63473 24.66939 24.70405 #> [169] 24.73871 24.77337 24.80803 24.84269 24.87735 24.91201 24.94667 24.98133 #> [177] 25.01599 25.05065 25.08531 25.11997 25.15464 25.18930 25.22396 25.25862 #> [185] 25.29328 25.32794 25.36260 25.39726 25.43192 25.46658 25.50124 25.53590 #> [193] 25.57056 25.60522 25.63988 25.67454 25.70920 25.74386 25.77852 25.81318 #> [201] 25.84784 25.88250 25.91716 25.95183 25.98649 26.02115 26.05581 26.09047 #> [209] 26.12513 26.15979 26.19445 26.22911 26.26377 26.29843 26.33309 26.36775 #> [217] 26.40241 26.43707 26.47173 26.50639 26.54105 26.57571 26.61037 26.64503 #> [225] 26.67969 26.71435 26.74902 26.78368 26.81834 26.85300 26.88766 26.92232 #> [233] 26.95698 26.99164 27.02630 27.06096 27.09562 27.13028 27.16494 27.19960 #> [241] 27.23426 27.26892 27.30358 27.33824 27.37290 27.40756 27.44222 27.47688 #> [249] 27.51155 27.54621 27.58087 27.61553 27.65019 27.68485 27.71951 27.75417 #> [257] 27.78883 27.82349 27.85815 27.89281 27.92747 27.96213 27.99679 28.03145 #> [265] 28.06611 28.10077 28.13543 28.17009 28.20475 28.23941 28.27407 28.30874 #> [273] 28.34340 28.37806 28.41272 28.44738 28.48204 28.51670 28.55136 28.58602 #> [281] 28.62068 28.65534 28.69000 28.72466 28.75932 28.79398 28.82864 28.86330 #> [289] 28.89796 28.93262 28.96728 29.00194 29.03660 29.07126 29.10593 29.14059 #> [297] 29.17525 29.20991 29.24457 29.27923 29.31389 29.34855 29.38321 29.41787 #> [305] 29.45253 29.48719 29.52185 29.55651 29.59117 29.62583 29.66049 29.69515 #> [313] 29.72981 29.76447 29.79913 29.83379 29.86846 29.90312 29.93778 29.97244 #> [321] 30.00710 30.04176 30.07642 30.11108 30.14574 30.18040 30.21506 30.24972 #> [329] 30.28438 30.31904 30.35370 30.38836 30.42302 30.45768 30.49234 30.52700 #> [337] 30.56166 30.59632 30.63098 30.66565 30.70031 30.73497 30.76963 30.80429 #> [345] 30.83895 30.87361 30.90827 30.94293 30.97759 31.01225 31.04691 31.08157 #> [353] 31.11623 31.15089 31.18555 31.22021 31.25487 31.28953 31.32419 31.35885 #> [361] 31.39351 31.42818 31.46284 31.49750 31.53216 31.56682 31.60148 31.63614 #> [369] 31.67080 31.70546 31.74012 31.77478 31.80944 31.84410 31.87876 31.91342 #> [377] 31.94808 31.98274 32.01740 32.05206 32.08672 32.12138 32.15604 32.19070 #> [385] 32.22537 32.26003 32.29469 32.32935 32.36401 32.39867 32.43333 32.46799 #> [393] 32.50265 32.53731 32.57197 32.60663 32.64129 32.67595 32.71061 32.74527 #> [401] 32.77993 32.81459 32.84925 32.88391 32.91857 32.95323 32.98789 33.02256 #> [409] 33.05722 33.09188 33.12654 33.16120 33.19586 33.23052 33.26518 33.29984 #> [417] 33.33450 33.36916 33.40382 33.43848 33.47314 33.50780 33.54246 33.57712 #> [425] 33.61178 33.64644 33.68110 33.71576 33.75042 33.78509 33.81975 33.85441 #> [433] 33.88907 33.92373 33.95839 33.99305 34.02771 34.06237 34.09703 34.13169 #> [441] 34.16635 34.20101 34.23567 34.27033 34.30499 34.33965 34.37431 34.40897 #> [449] 34.44363 34.47829 34.51295 34.54761 34.58228 34.61694 34.65160 34.68626 #> [457] 34.72092 34.75558 34.79024 34.82490 34.85956 34.89422 34.92888 34.96354 #> [465] 34.99820 35.03286 35.06752 35.10218 35.13684 35.17150 35.20616 35.24082 #> [473] 35.27548 35.31014 35.34481 35.37947 35.41413 35.44879 35.48345 35.51811 #> [481] 35.55277 35.58743 35.62209 35.65675 35.69141 35.72607 35.76073 35.79539 #> [489] 35.83005 35.86471 35.89937 35.93403 35.96869 36.00335 36.03801 36.07267 #> [497] 36.10733 36.14200 36.17666 36.21132 36.24598 36.28064 36.31530 36.34996 #> [505] 36.38462 36.41928 36.45394 36.48860 36.52326 36.55792 36.59258 36.62724 #> #> $y #> [1] 2.258109e-05 2.262642e-05 2.213393e-05 2.128419e-05 2.033544e-05 #> [6] 1.960778e-05 1.936874e-05 1.982918e-05 2.112418e-05 2.330275e-05 #> [11] 2.632963e-05 3.009666e-05 3.444031e-05 3.916119e-05 4.404197e-05 #> [16] 4.886123e-05 5.340260e-05 5.744105e-05 6.073924e-05 6.316311e-05 #> [21] 6.458051e-05 6.490379e-05 6.410264e-05 6.221515e-05 5.935456e-05 #> [26] 5.571028e-05 5.154199e-05 4.716679e-05 4.293971e-05 3.922900e-05 #> [31] 3.639222e-05 3.486091e-05 3.477744e-05 3.627324e-05 3.939828e-05 #> [36] 4.413798e-05 5.044036e-05 5.824854e-05 6.753258e-05 7.831408e-05 #> [41] 9.067787e-05 1.047668e-04 1.207576e-04 1.388191e-04 1.591997e-04 #> [46] 1.817251e-04 2.060626e-04 2.316902e-04 2.578663e-04 2.836890e-04 #> [51] 3.081993e-04 3.305187e-04 3.499996e-04 3.663640e-04 3.798002e-04 #> [56] 3.909954e-04 4.010894e-04 4.116469e-04 4.244775e-04 4.409683e-04 #> [61] 4.621382e-04 4.884770e-04 5.198795e-04 5.556611e-04 5.946543e-04 #> [66] 6.353718e-04 6.762187e-04 7.157265e-04 7.527802e-04 7.868088e-04 #> [71] 8.178725e-04 8.468971e-04 8.757465e-04 9.065526e-04 9.416968e-04 #> [76] 9.835631e-04 1.034276e-03 1.095438e-03 1.167902e-03 1.251582e-03 #> [81] 1.345366e-03 1.447137e-03 1.553943e-03 1.662311e-03 1.768239e-03 #> [86] 1.868780e-03 1.962298e-03 2.048580e-03 2.128896e-03 2.205833e-03 #> [91] 2.282959e-03 2.364373e-03 2.454259e-03 2.556503e-03 2.674432e-03 #> [96] 2.810696e-03 2.967245e-03 3.146744e-03 3.348961e-03 3.572973e-03 #> [101] 3.817569e-03 4.080617e-03 4.359109e-03 4.649361e-03 4.947357e-03 #> [106] 5.249211e-03 5.551655e-03 5.852475e-03 6.150803e-03 6.447188e-03 #> [111] 6.743566e-03 7.043122e-03 7.348925e-03 7.663718e-03 7.989539e-03 #> [116] 8.327509e-03 8.677784e-03 9.039662e-03 9.411805e-03 9.792533e-03 #> [121] 1.018014e-02 1.057321e-02 1.097092e-02 1.137334e-02 1.178214e-02 #> [126] 1.219960e-02 1.262957e-02 1.307698e-02 1.354757e-02 1.404731e-02 #> [131] 1.458186e-02 1.515588e-02 1.577244e-02 1.643268e-02 1.713574e-02 #> [136] 1.787912e-02 1.865924e-02 1.947461e-02 2.031937e-02 2.119114e-02 #> [141] 2.208870e-02 2.301122e-02 2.395775e-02 2.492662e-02 2.591513e-02 #> [146] 2.691958e-02 2.793553e-02 2.895842e-02 2.998418e-02 3.100987e-02 #> [151] 3.203393e-02 3.305659e-02 3.407924e-02 3.510370e-02 3.613194e-02 #> [156] 3.716597e-02 3.820803e-02 3.926105e-02 4.032900e-02 4.141725e-02 #> [161] 4.253245e-02 4.368203e-02 4.487326e-02 4.611364e-02 4.740735e-02 #> [166] 4.875011e-02 5.013668e-02 5.155899e-02 5.300769e-02 5.447381e-02 #> [171] 5.595047e-02 5.743411e-02 5.892506e-02 6.042737e-02 6.194786e-02 #> [176] 6.349477e-02 6.507660e-02 6.670356e-02 6.837707e-02 7.009963e-02 #> [181] 7.187279e-02 7.369799e-02 7.557706e-02 7.751230e-02 7.950601e-02 #> [186] 8.155967e-02 8.367292e-02 8.584262e-02 8.806225e-02 9.032182e-02 #> [191] 9.260885e-02 9.490458e-02 9.719226e-02 9.945595e-02 1.016811e-01 #> [196] 1.038553e-01 1.059691e-01 1.080164e-01 1.099949e-01 1.119072e-01 #> [201] 1.137604e-01 1.155665e-01 1.173417e-01 1.191066e-01 1.208855e-01 #> [206] 1.226987e-01 1.245621e-01 1.264856e-01 1.284717e-01 1.305151e-01 #> [211] 1.326029e-01 1.347163e-01 1.368324e-01 1.389264e-01 1.409740e-01 #> [216] 1.429538e-01 1.448467e-01 1.466397e-01 1.483391e-01 1.499545e-01 #> [221] 1.515031e-01 1.530074e-01 1.544923e-01 1.559817e-01 1.574944e-01 #> [226] 1.590418e-01 1.606262e-01 1.622406e-01 1.638710e-01 1.654987e-01 #> [231] 1.671018e-01 1.686666e-01 1.701864e-01 1.716619e-01 1.731002e-01 #> [236] 1.745129e-01 1.759136e-01 1.773145e-01 1.787243e-01 1.801467e-01 #> [241] 1.815789e-01 1.830126e-01 1.844352e-01 1.858285e-01 1.871769e-01 #> [246] 1.884680e-01 1.896922e-01 1.908430e-01 1.919169e-01 1.929128e-01 #> [251] 1.938312e-01 1.946738e-01 1.954430e-01 1.961415e-01 1.967720e-01 #> [256] 1.973366e-01 1.978327e-01 1.982587e-01 1.986131e-01 1.988900e-01 #> [261] 1.990824e-01 1.991833e-01 1.991869e-01 1.990897e-01 1.988913e-01 #> [266] 1.985949e-01 1.982078e-01 1.977422e-01 1.972147e-01 1.966468e-01 #> [271] 1.960665e-01 1.955034e-01 1.949817e-01 1.945186e-01 1.941207e-01 #> [276] 1.937818e-01 1.934822e-01 1.931905e-01 1.928679e-01 1.924731e-01 #> [281] 1.919685e-01 1.913255e-01 1.905276e-01 1.895595e-01 1.884458e-01 #> [286] 1.872050e-01 1.858573e-01 1.844209e-01 1.829104e-01 1.813353e-01 #> [291] 1.797014e-01 1.780115e-01 1.762672e-01 1.744704e-01 1.726240e-01 #> [296] 1.707315e-01 1.687949e-01 1.668203e-01 1.648129e-01 1.627776e-01 #> [301] 1.607209e-01 1.586518e-01 1.565817e-01 1.545239e-01 1.524920e-01 #> [306] 1.504972e-01 1.485463e-01 1.466392e-01 1.447681e-01 1.429174e-01 #> [311] 1.410629e-01 1.391804e-01 1.372500e-01 1.352581e-01 1.331997e-01 #> [316] 1.310793e-01 1.289100e-01 1.267117e-01 1.245083e-01 1.223240e-01 #> [321] 1.201802e-01 1.180924e-01 1.160691e-01 1.141114e-01 1.122025e-01 #> [326] 1.103247e-01 1.084571e-01 1.065787e-01 1.046712e-01 1.027213e-01 #> [331] 1.007219e-01 9.867270e-02 9.657940e-02 9.445284e-02 9.230719e-02 #> [336] 9.015813e-02 8.802329e-02 8.591634e-02 8.384727e-02 8.182314e-02 #> [341] 7.984813e-02 7.792395e-02 7.605041e-02 7.422592e-02 7.244792e-02 #> [346] 7.071319e-02 6.901799e-02 6.735825e-02 6.572957e-02 6.412863e-02 #> [351] 6.254980e-02 6.098822e-02 5.944051e-02 5.790409e-02 5.637732e-02 #> [356] 5.485959e-02 5.335140e-02 5.185446e-02 5.037168e-02 4.890706e-02 #> [361] 4.746542e-02 4.605188e-02 4.467238e-02 4.333161e-02 4.202890e-02 #> [366] 4.076342e-02 3.953266e-02 3.833308e-02 3.716099e-02 3.601330e-02 #> [371] 3.488811e-02 3.378486e-02 3.270424e-02 3.164770e-02 3.061694e-02 #> [376] 2.961362e-02 2.864055e-02 2.769559e-02 2.677855e-02 2.588944e-02 #> [381] 2.502886e-02 2.419820e-02 2.339963e-02 2.263583e-02 2.190946e-02 #> [386] 2.122252e-02 2.057568e-02 1.996770e-02 1.939512e-02 1.885376e-02 #> [391] 1.833320e-02 1.782411e-02 1.731750e-02 1.680519e-02 1.628045e-02 #> [396] 1.573855e-02 1.517706e-02 1.459598e-02 1.399766e-02 1.338650e-02 #> [401] 1.276855e-02 1.215094e-02 1.154204e-02 1.094988e-02 1.038003e-02 #> [406] 9.836875e-03 9.323015e-03 8.839393e-03 8.385525e-03 7.959924e-03 #> [411] 7.560577e-03 7.185412e-03 6.832672e-03 6.501144e-03 6.190221e-03 #> [416] 5.900361e-03 5.632548e-03 5.385648e-03 5.159430e-03 4.953083e-03 #> [421] 4.765098e-03 4.593249e-03 4.434668e-03 4.286012e-03 4.143692e-03 #> [426] 4.004160e-03 3.864210e-03 3.721268e-03 3.573642e-03 3.420372e-03 #> [431] 3.262771e-03 3.102786e-03 2.943141e-03 2.786966e-03 2.637355e-03 #> [436] 2.496902e-03 2.367301e-03 2.249066e-03 2.141425e-03 2.042419e-03 #> [441] 1.949193e-03 1.858441e-03 1.766695e-03 1.671298e-03 1.571111e-03 #> [446] 1.466273e-03 1.358166e-03 1.249174e-03 1.142314e-03 1.040798e-03 #> [451] 9.475868e-04 8.650068e-04 7.944722e-04 7.363479e-04 6.899583e-04 #> [456] 6.540617e-04 6.260605e-04 6.029186e-04 5.821205e-04 5.614529e-04 #> [461] 5.391700e-04 5.140880e-04 4.856163e-04 4.537362e-04 4.189385e-04 #> [466] 3.821307e-04 3.445233e-04 3.074994e-04 2.725459e-04 2.412559e-04 #> [471] 2.144517e-04 1.927196e-04 1.762300e-04 1.647428e-04 1.576567e-04 #> [476] 1.540923e-04 1.529974e-04 1.532581e-04 1.538054e-04 1.537048e-04 #> [481] 1.522223e-04 1.488647e-04 1.432153e-04 1.354908e-04 1.259484e-04 #> [486] 1.149691e-04 1.030111e-04 9.055790e-05 7.807598e-05 6.598184e-05 #> [491] 5.462084e-05 4.425632e-05 3.506717e-05 2.715217e-05 2.053904e-05 #> [496] 1.526964e-05 1.121182e-05 8.227213e-06 6.206686e-06 5.047330e-06 #> [501] 4.658675e-06 4.962864e-06 5.888892e-06 7.362181e-06 9.291971e-06 #> [506] 1.155980e-05 1.401261e-05 1.646367e-05 1.868601e-05 2.043643e-05 #> [511] 2.155372e-05 2.192606e-05 #> #> $mean #> [1] 28.00141 #> #> $HPD #> LowerBound_alpha=0.95 UpperBound_alpha=0.95 #> [1,] 24.03837 31.9092 #>
postKernal
#> $x #> [1] 9.480356 9.481626 9.482896 9.484166 9.485436 9.486706 9.487976 #> [8] 9.489246 9.490516 9.491786 9.493057 9.494327 9.495597 9.496867 #> [15] 9.498137 9.499407 9.500677 9.501947 9.503217 9.504487 9.505757 #> [22] 9.507027 9.508297 9.509567 9.510837 9.512107 9.513377 9.514647 #> [29] 9.515917 9.517187 9.518458 9.519728 9.520998 9.522268 9.523538 #> [36] 9.524808 9.526078 9.527348 9.528618 9.529888 9.531158 9.532428 #> [43] 9.533698 9.534968 9.536238 9.537508 9.538778 9.540048 9.541318 #> [50] 9.542588 9.543858 9.545129 9.546399 9.547669 9.548939 9.550209 #> [57] 9.551479 9.552749 9.554019 9.555289 9.556559 9.557829 9.559099 #> [64] 9.560369 9.561639 9.562909 9.564179 9.565449 9.566719 9.567989 #> [71] 9.569259 9.570530 9.571800 9.573070 9.574340 9.575610 9.576880 #> [78] 9.578150 9.579420 9.580690 9.581960 9.583230 9.584500 9.585770 #> [85] 9.587040 9.588310 9.589580 9.590850 9.592120 9.593390 9.594660 #> [92] 9.595930 9.597201 9.598471 9.599741 9.601011 9.602281 9.603551 #> [99] 9.604821 9.606091 9.607361 9.608631 9.609901 9.611171 9.612441 #> [106] 9.613711 9.614981 9.616251 9.617521 9.618791 9.620061 9.621331 #> [113] 9.622602 9.623872 9.625142 9.626412 9.627682 9.628952 9.630222 #> [120] 9.631492 9.632762 9.634032 9.635302 9.636572 9.637842 9.639112 #> [127] 9.640382 9.641652 9.642922 9.644192 9.645462 9.646732 9.648002 #> [134] 9.649273 9.650543 9.651813 9.653083 9.654353 9.655623 9.656893 #> [141] 9.658163 9.659433 9.660703 9.661973 9.663243 9.664513 9.665783 #> [148] 9.667053 9.668323 9.669593 9.670863 9.672133 9.673403 9.674674 #> [155] 9.675944 9.677214 9.678484 9.679754 9.681024 9.682294 9.683564 #> [162] 9.684834 9.686104 9.687374 9.688644 9.689914 9.691184 9.692454 #> [169] 9.693724 9.694994 9.696264 9.697534 9.698804 9.700075 9.701345 #> [176] 9.702615 9.703885 9.705155 9.706425 9.707695 9.708965 9.710235 #> [183] 9.711505 9.712775 9.714045 9.715315 9.716585 9.717855 9.719125 #> [190] 9.720395 9.721665 9.722935 9.724205 9.725475 9.726746 9.728016 #> [197] 9.729286 9.730556 9.731826 9.733096 9.734366 9.735636 9.736906 #> [204] 9.738176 9.739446 9.740716 9.741986 9.743256 9.744526 9.745796 #> [211] 9.747066 9.748336 9.749606 9.750876 9.752147 9.753417 9.754687 #> [218] 9.755957 9.757227 9.758497 9.759767 9.761037 9.762307 9.763577 #> [225] 9.764847 9.766117 9.767387 9.768657 9.769927 9.771197 9.772467 #> [232] 9.773737 9.775007 9.776277 9.777547 9.778818 9.780088 9.781358 #> [239] 9.782628 9.783898 9.785168 9.786438 9.787708 9.788978 9.790248 #> [246] 9.791518 9.792788 9.794058 9.795328 9.796598 9.797868 9.799138 #> [253] 9.800408 9.801678 9.802948 9.804219 9.805489 9.806759 9.808029 #> [260] 9.809299 9.810569 9.811839 9.813109 9.814379 9.815649 9.816919 #> [267] 9.818189 9.819459 9.820729 9.821999 9.823269 9.824539 9.825809 #> [274] 9.827079 9.828349 9.829619 9.830890 9.832160 9.833430 9.834700 #> [281] 9.835970 9.837240 9.838510 9.839780 9.841050 9.842320 9.843590 #> [288] 9.844860 9.846130 9.847400 9.848670 9.849940 9.851210 9.852480 #> [295] 9.853750 9.855020 9.856291 9.857561 9.858831 9.860101 9.861371 #> [302] 9.862641 9.863911 9.865181 9.866451 9.867721 9.868991 9.870261 #> [309] 9.871531 9.872801 9.874071 9.875341 9.876611 9.877881 9.879151 #> [316] 9.880421 9.881691 9.882962 9.884232 9.885502 9.886772 9.888042 #> [323] 9.889312 9.890582 9.891852 9.893122 9.894392 9.895662 9.896932 #> [330] 9.898202 9.899472 9.900742 9.902012 9.903282 9.904552 9.905822 #> [337] 9.907092 9.908363 9.909633 9.910903 9.912173 9.913443 9.914713 #> [344] 9.915983 9.917253 9.918523 9.919793 9.921063 9.922333 9.923603 #> [351] 9.924873 9.926143 9.927413 9.928683 9.929953 9.931223 9.932493 #> [358] 9.933764 9.935034 9.936304 9.937574 9.938844 9.940114 9.941384 #> [365] 9.942654 9.943924 9.945194 9.946464 9.947734 9.949004 9.950274 #> [372] 9.951544 9.952814 9.954084 9.955354 9.956624 9.957894 9.959164 #> [379] 9.960435 9.961705 9.962975 9.964245 9.965515 9.966785 9.968055 #> [386] 9.969325 9.970595 9.971865 9.973135 9.974405 9.975675 9.976945 #> [393] 9.978215 9.979485 9.980755 9.982025 9.983295 9.984565 9.985836 #> [400] 9.987106 9.988376 9.989646 9.990916 9.992186 9.993456 9.994726 #> [407] 9.995996 9.997266 9.998536 9.999806 10.001076 10.002346 10.003616 #> [414] 10.004886 10.006156 10.007426 10.008696 10.009966 10.011236 10.012507 #> [421] 10.013777 10.015047 10.016317 10.017587 10.018857 10.020127 10.021397 #> [428] 10.022667 10.023937 10.025207 10.026477 10.027747 10.029017 10.030287 #> [435] 10.031557 10.032827 10.034097 10.035367 10.036637 10.037908 10.039178 #> [442] 10.040448 10.041718 10.042988 10.044258 10.045528 10.046798 10.048068 #> [449] 10.049338 10.050608 10.051878 10.053148 10.054418 10.055688 10.056958 #> [456] 10.058228 10.059498 10.060768 10.062038 10.063308 10.064579 10.065849 #> [463] 10.067119 10.068389 10.069659 10.070929 10.072199 10.073469 10.074739 #> [470] 10.076009 10.077279 10.078549 10.079819 10.081089 10.082359 10.083629 #> [477] 10.084899 10.086169 10.087439 10.088709 10.089980 10.091250 10.092520 #> [484] 10.093790 10.095060 10.096330 10.097600 10.098870 10.100140 10.101410 #> [491] 10.102680 10.103950 10.105220 10.106490 10.107760 10.109030 10.110300 #> [498] 10.111570 10.112840 10.114110 10.115381 10.116651 10.117921 10.119191 #> [505] 10.120461 10.121731 10.123001 10.124271 10.125541 10.126811 10.128081 #> [512] 10.129351 #> #> $y #> [1] 0.7259185 0.7373552 0.7487218 0.7600071 0.7711568 0.7822484 0.7931688 #> [8] 0.8039969 0.8147051 0.8252384 0.8356955 0.8459245 0.8560463 0.8660106 #> [15] 0.8757707 0.8854395 0.8948300 0.9041051 0.9131893 0.9220515 0.9308108 #> [22] 0.9392514 0.9475758 0.9556823 0.9635606 0.9713271 0.9787512 0.9860632 #> [29] 0.9931390 0.9999919 1.0067207 1.0131155 1.0193993 1.0254397 1.0312730 #> [36] 1.0369757 1.0423682 1.0476559 1.0527050 1.0575715 1.0623082 1.0667718 #> [43] 1.0711412 1.0752897 1.0792867 1.0831624 1.0868124 1.0903828 1.0937623 #> [50] 1.0970254 1.1001837 1.1031705 1.1060954 1.1088702 1.1115650 1.1141789 #> [57] 1.1166783 1.1191357 1.1214923 1.1238041 1.1260649 1.1282673 1.1304483 #> [64] 1.1325834 1.1347053 1.1368102 1.1389082 1.1410052 1.1431128 1.1452335 #> [71] 1.1473729 1.1495496 1.1517439 1.1540033 1.1562955 1.1586410 1.1610585 #> [78] 1.1635095 1.1660738 1.1686839 1.1713781 1.1741682 1.1770042 1.1799921 #> [85] 1.1830321 1.1861808 1.1894381 1.1927547 1.1962396 1.1997819 1.2034493 #> [92] 1.2072279 1.2110751 1.2150925 1.2191682 1.2233760 1.2276888 1.2320746 #> [99] 1.2366197 1.2412202 1.2459503 1.2507722 1.2556662 1.2606990 1.2657809 #> [106] 1.2709809 1.2762554 1.2815958 1.2870480 1.2925409 1.2981331 1.3037809 #> [113] 1.3094837 1.3152691 1.3210853 1.3269774 1.3329067 1.3388774 1.3449024 #> [120] 1.3509482 1.3570449 1.3631631 1.3693081 1.3754832 1.3816702 1.3878853 #> [127] 1.3941100 1.4003484 1.4065993 1.4128553 1.4191220 1.4253914 1.4316652 #> [134] 1.4379419 1.4442199 1.4505001 1.4567810 1.4630631 1.4693472 1.4756323 #> [141] 1.4819227 1.4882161 1.4945157 1.5008248 1.5071389 1.5134736 1.5198176 #> [148] 1.5261822 1.5325708 1.5389739 1.5454238 1.5518929 1.5584067 1.5649646 #> [155] 1.5715527 1.5782218 1.5849232 1.5917030 1.5985501 1.6054490 1.6124685 #> [162] 1.6195355 1.6267228 1.6340014 1.6413588 1.6488779 1.6564610 1.6642121 #> [169] 1.6720767 1.6800514 1.6882265 1.6964824 1.7049568 1.7135627 1.7223123 #> [176] 1.7312954 1.7403746 1.7497218 1.7592130 1.7688807 1.7788063 1.7888409 #> [183] 1.7991875 1.8096834 1.8203854 1.8313583 1.8424494 1.8538864 1.8654704 #> [190] 1.8772832 1.8893669 1.9015732 1.9141446 1.9268530 1.9398028 1.9530097 #> [197] 1.9663378 1.9800312 1.9938447 2.0078986 2.0221821 2.0365855 2.0513186 #> [204] 2.0661558 2.0812158 2.0964654 2.1118273 2.1274566 2.1431704 2.1590708 #> [211] 2.1751099 2.1912419 2.2075614 2.2239391 2.2404469 2.2570342 2.2736816 #> [218] 2.2904222 2.3071885 2.3240075 2.3408415 2.3576884 2.3745240 2.3913474 #> [225] 2.4081256 2.4248526 2.4415309 2.4580876 2.4745898 2.4909304 2.5071552 #> [232] 2.5232560 2.5391242 2.5548927 2.5703678 2.5856673 2.6007556 2.6155045 #> [239] 2.6301071 2.6442732 2.6582118 2.6718428 2.6850367 2.6980382 2.7104538 #> [246] 2.7226006 2.7343375 2.7455531 2.7565324 2.7667763 2.7767224 2.7861551 #> [253] 2.7949991 2.8035667 2.8112564 2.8186325 2.8253949 2.8315210 2.8373221 #> [260] 2.8421450 2.8466378 2.8504252 2.8535502 2.8562909 2.8580090 2.8593757 #> [267] 2.8599592 2.8598760 2.8593554 2.8577995 2.8558801 2.8531184 2.8497070 #> [274] 2.8458153 2.8409068 2.8356327 2.8294805 2.8227152 2.8154401 2.8071969 #> [281] 2.7985961 2.7891082 2.7790608 2.7684906 2.7570280 2.7452259 2.7325572 #> [288] 2.7193959 2.7057179 2.6912461 2.6764624 2.6608628 2.6448473 2.6283415 #> [295] 2.6111581 2.5936990 2.5755047 2.5569763 2.5380050 2.5184841 2.4987311 #> [302] 2.4783515 2.4577205 2.4367138 2.4152915 2.3936862 2.3715874 2.3493166 #> [309] 2.3267554 2.3039122 2.2809389 2.2576246 2.2342110 2.2106072 2.1868490 #> [316] 2.1630137 2.1390066 2.1149615 2.0908369 2.0666748 2.0424914 2.0183053 #> [323] 1.9941340 1.9700000 1.9459303 1.9219019 1.8980205 1.8742029 1.8505398 #> [330] 1.8270251 1.8036179 1.7804833 1.7574563 1.7346961 1.7121488 1.6897749 #> [337] 1.6677724 1.6459144 1.6244253 1.6031935 1.5821974 1.5616431 1.5412624 #> [344] 1.5213380 1.5016957 1.4823440 1.4634764 1.4448032 1.4266546 1.4087956 #> [351] 1.3912712 1.3742470 1.3574292 1.3411828 1.3252181 1.3096192 1.2945129 #> [358] 1.2796166 1.2653151 1.2512750 1.2376175 1.2244250 1.2114383 1.1990461 #> [365] 1.1868862 1.1751103 1.1637562 1.1525967 1.1420089 1.1316186 1.1215985 #> [372] 1.1119463 1.1024739 1.0935251 1.0847391 1.0762957 1.0681597 1.0601946 #> [379] 1.0526673 1.0452788 1.0381932 1.0313525 1.0246662 1.0183280 1.0121028 #> [386] 1.0061314 1.0003443 0.9946880 0.9892923 0.9839830 0.9788722 0.9738898 #> [393] 0.9690099 0.9643089 0.9596684 0.9551686 0.9507482 0.9463991 0.9421568 #> [400] 0.9379508 0.9338285 0.9297451 0.9257010 0.9217032 0.9177206 0.9137686 #> [407] 0.9098242 0.9058886 0.9019518 0.8980126 0.8940576 0.8900881 0.8861001 #> [414] 0.8820769 0.8780376 0.8739451 0.8698243 0.8656632 0.8614450 0.8572013 #> [421] 0.8528776 0.8485191 0.8441045 0.8396224 0.8351093 0.8305005 0.8258561 #> [428] 0.8211467 0.8163688 0.8115582 0.8066469 0.8017036 0.7966932 0.7916205 #> [435] 0.7865137 0.7813166 0.7760908 0.7708025 0.7654625 0.7600906 0.7546453 #> [442] 0.7491765 0.7436550 0.7380951 0.7325085 0.7268687 0.7212118 0.7155159 #> [449] 0.7097954 0.7040557 0.6982837 0.6925014 0.6866959 0.6808786 0.6750509 #> [456] 0.6692102 0.6633657 0.6575141 0.6516613 0.6458073 0.6399561 0.6341069 #> [463] 0.6282652 0.6224301 0.6166021 0.6107887 0.6049816 0.5991938 0.5934172 #> [470] 0.5876547 0.5819135 0.5761816 0.5704770 0.5647854 0.5591123 0.5534631 #> [477] 0.5478245 0.5422167 0.5366216 0.5310466 0.5254945 0.5199528 0.5144412 #> [484] 0.5089404 0.5034587 0.4979961 0.4925427 0.4871152 0.4816955 0.4762919 #> [491] 0.4709022 0.4655200 0.4601562 0.4547978 0.4494507 0.4441122 0.4387788 #> [498] 0.4334560 0.4281362 0.4228228 0.4175132 0.4122063 0.4069034 0.4016016 #> [505] 0.3963019 0.3910029 0.3857044 0.3804062 0.3751078 0.3698090 0.3645097 #> [512] 0.3592100 #> #> $mean #> [1] 9.781236 #> #> $HPD #> LowerBound_alpha=0.95 UpperBound_alpha=0.95 #> [1,] 9.457413 10.09678 #>
# let's compare this (supposed) prior # against the posterior in a plot plotUnivariatePosteriorVsPrior( posteriorCurve = postKernal, priorCurve = priorKernal, label = "parameter", trueValue = NULL)
# cool!