Skip to contents

[Stable]

LogisticNormal is the class for the usual logistic regression model with a bivariate normal prior on the intercept and slope.

Usage

LogisticNormal(mean, cov, ref_dose = 1)

.DefaultLogisticNormal()

Arguments

mean

(numeric)
the prior mean vector.

cov

(matrix)
the prior covariance matrix. The precision matrix prec is internally calculated as an inverse of cov.

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).$$

Note

Typically, end users will not use the .DefaultLogisticNormal() function.

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] -0.352284523  0.415250546  0.136617271 -0.915800348 -0.956140969
#>   [6] -1.540418459 -1.285320433 -2.814325136 -1.496469415 -1.798868829
#>  [11] -2.089338299  0.229596003 -1.714441377 -0.701358352 -1.692901801
#>  [16] -0.807645567 -1.892518686 -1.228836075  0.309122813 -0.666667003
#>  [21] -2.762690756 -2.684513533 -2.128729847 -3.264671662 -0.596711286
#>  [26]  1.837632346  0.892497172  0.861430035 -0.457767271 -2.284906558
#>  [31] -1.019079928 -1.509552543 -1.456622704 -1.008569509  0.674609645
#>  [36] -0.534690526 -0.890899635 -2.292266693 -1.197535535 -0.852435389
#>  [41] -2.464283431 -1.062254968 -2.134125703  0.336744954 -1.605069838
#>  [46]  0.080323412 -1.930921601  1.610862862 -0.969200803 -2.682920325
#>  [51] -0.820194493  0.728173599 -1.513048855 -0.332817827 -1.464981496
#>  [56] -1.025416127 -0.549320154 -1.376887185 -2.642330491 -1.366118721
#>  [61] -0.633616246 -2.116721136 -1.666967673 -1.507223378 -1.449562668
#>  [66] -0.407292571 -0.502859873 -1.362180188  0.606095384  0.368747143
#>  [71] -0.553848292  0.036548279 -1.854035772 -2.542642276 -0.334132510
#>  [76] -0.011929349 -1.565621026 -1.625801973  0.650488025 -2.544360566
#>  [81] -0.779759786 -0.264910496 -1.344362669 -1.719950056  0.739570682
#>  [86]  0.963061391 -0.270914638 -0.732041482 -2.376616383 -0.425247697
#>  [91] -0.216212947 -2.420244778 -2.303296494 -1.844348959 -1.020397966
#>  [96] -1.762553523 -0.134098379  1.013594961 -1.431302773  0.007853832
#> 
#> $alpha1
#>   [1]  0.54472507  2.38887312 -1.06519858  1.86898530  0.73114002  3.20003656
#>   [7]  0.92144629  1.93252123  1.46744081  2.15623986  1.87182496  0.39835688
#>  [13]  1.63813613  1.51015066  1.32631212  0.41178161  2.61943886 -0.46310071
#>  [19] -0.85145776  0.48787069  3.14054757  2.27826808  3.77078124  3.85203947
#>  [25] -0.65962987 -0.16174630  1.19594776  1.49728016  1.83093724  1.82415190
#>  [31]  2.08299076  0.97492060  0.82449138  0.83274439 -0.23071605  0.47912136
#>  [37]  1.60720763  1.24826227  0.93382229 -0.72222362  1.05070066  3.71185575
#>  [43]  1.43077102  0.07812144  1.45827787  1.21304990  0.39789489 -1.21983582
#>  [49]  0.01595346  1.93595450  0.95409211 -0.79264459  1.17465364  0.98044336
#>  [55]  2.01894252  2.44374141  1.04684582  1.53789934  1.56495120  0.69736444
#>  [61]  0.83687502  1.15925190  1.43917073  2.20371933  2.61206902  0.39803895
#>  [67] -0.54803748  1.46271632  1.70306476  0.48620314  1.49719364  1.71539091
#>  [73]  0.65248721  2.52677133  1.94787293  0.22084220  1.30927020  2.31290893
#>  [79]  0.38559691  3.88570626  0.36527281  0.67692775  2.12591246  2.02792703
#>  [85]  1.14438826  0.44710818  0.04727742  2.47148711  1.34925833  1.54926159
#>  [91]  0.90665050  0.33456291  1.76984145  0.49793820  1.60172068  2.32919679
#>  [97] -0.24619694 -1.34103784  0.17490191  0.58215937
#> 
#> 
#> 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
#> 
#>