LogisticNormal
is the class for the usual logistic regression model with
a bivariate normal prior on the intercept and slope.
Arguments
- mean
(
numeric
)
the prior mean vector.- cov
(
matrix
)
the prior covariance matrix. The precision matrixprec
is internally calculated as an inverse ofcov
.- ref_dose
(
number
)
the reference dose \(x*\) (strictly positive number).
Details
The covariate is the natural logarithm of the dose \(x\) divided by the reference dose \(x*\), i.e.: $$logit[p(x)] = alpha0 + alpha1 * log(x/x*),$$ where \(p(x)\) is the probability of observing a DLT for a given dose \(x\). The prior $$(alpha0, alpha1) ~ Normal(mean, cov).$$
Examples
# Define the dose-grid.
empty_data <- Data(doseGrid = c(1, 3, 5, 10, 15, 20, 25, 40, 50, 80, 100))
my_model <- LogisticNormal(
mean = c(-0.85, 1),
cov = matrix(c(1, -0.5, -0.5, 1), nrow = 2)
)
my_options <- McmcOptions(burnin = 10, step = 2, samples = 100)
samples <- mcmc(empty_data, my_model, my_options)
samples
#> An object of class "Samples"
#> Slot "data":
#> $alpha0
#> [1] -2.82949518 -1.02917101 -1.29167752 -1.55700188 -3.22177256 -0.68794857
#> [7] -1.90668250 -0.03341115 -0.31170864 -1.13596284 -0.05913492 -2.57962742
#> [13] 1.34175697 0.19392927 -0.27504979 -1.25661078 -0.62397103 -1.38710576
#> [19] 0.68044132 -0.10687252 -0.12441895 -1.81073385 -2.24296128 -0.07668373
#> [25] -0.78150240 0.61720545 -0.57351003 -0.83516244 -0.53142721 -1.24189773
#> [31] -1.76164563 -0.19342259 -0.05097796 -0.12235362 -2.33678300 -1.86789760
#> [37] -0.56050861 -0.56968101 -0.19358889 0.35596115 -1.42745911 0.25651078
#> [43] -1.20500096 -2.06927133 -2.31728151 0.66557573 -0.47118929 -2.07492020
#> [49] -0.06524878 -0.66118853 -2.32939279 -0.70641193 -0.16073208 0.34878162
#> [55] -1.84884026 0.09941423 -0.96746911 -0.77619353 -1.28263915 -0.22670391
#> [61] -1.29673835 0.04723881 0.03080882 -0.49606501 -1.00477959 -1.69132369
#> [67] -2.59326614 -1.35318552 1.00404536 0.57219418 -0.20959853 -0.87172893
#> [73] 0.16553983 -0.43234660 -0.10204120 -1.55086149 -3.06977530 -0.02385605
#> [79] -0.68243736 -1.05368443 -1.07844373 -0.21310344 -2.93671458 -0.85793555
#> [85] -0.64686322 -0.53472655 0.37263481 -0.27354652 -0.44689751 -0.54590378
#> [91] -2.01692296 -0.52448954 -0.55328782 -0.02215291 -1.04644483 -1.12629486
#> [97] 0.72644346 -2.39596990 -1.48958993 -1.74883842
#>
#> $alpha1
#> [1] 0.84577657 1.13406930 1.27059126 2.70711409 2.97274660 -0.37764901
#> [7] 2.78326246 0.24109395 0.79540947 2.08581480 2.06574877 -0.35203018
#> [13] -1.79562865 0.50644514 0.65996682 2.46493181 0.91621213 0.61156991
#> [19] -0.33779058 1.19729655 0.64951676 1.96070288 1.80584820 0.48180988
#> [25] 1.43023314 0.60321716 0.95677785 0.49153265 1.00047031 0.60421015
#> [31] 1.31537304 2.09064362 3.23369363 0.42050457 2.30590533 2.09369359
#> [37] 0.23392451 1.03794048 1.09473970 -0.39161620 0.39703435 0.19639991
#> [43] 0.91451091 1.71939755 2.50771184 0.78896948 0.21771350 0.08344010
#> [49] 1.62177480 0.53135333 2.17538339 -0.56961772 0.21383861 0.52305069
#> [55] 1.51011486 0.48288176 0.50322867 1.55441013 0.62107274 0.03289801
#> [61] 1.30596390 1.28203479 0.93559990 0.77655385 -0.31092848 2.36944918
#> [67] 1.98287367 1.40987161 -0.13560283 -0.20684955 0.47605104 1.30855065
#> [73] 1.66809661 0.94652497 -0.51491989 1.64276393 2.81480863 -1.10838760
#> [79] -0.11130911 -0.18462476 0.89527352 -1.01018336 1.99963243 1.68116337
#> [85] 2.29545362 0.02711322 0.71887354 0.45310190 0.57046545 1.14708072
#> [91] 1.95629000 1.46083973 2.32648018 -0.47370253 0.83816483 1.82841383
#> [97] 0.17347158 2.01610174 1.39713221 0.49608864
#>
#>
#> Slot "options":
#> An object of class "McmcOptions"
#> Slot "iterations":
#> [1] 210
#>
#> Slot "burnin":
#> [1] 10
#>
#> Slot "step":
#> [1] 2
#>
#> Slot "rng_kind":
#> [1] NA
#>
#> Slot "rng_seed":
#> [1] NA
#>
#>