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.406104198  0.732515263  1.097123919 -0.383898820 -1.189107304
#>   [6]  0.591995617 -0.265435328  0.648585505 -1.121026001  1.532607126
#>  [11] -0.084981322 -2.298299692 -0.902681809 -2.591620308 -3.719050579
#>  [16] -0.724114462 -0.841962691 -1.649367272  0.997023331  1.263043415
#>  [21] -0.574627336 -1.206864876 -0.349072575 -0.696964324  1.044847558
#>  [26] -1.100518801  0.514290427 -0.933883675 -1.565528255 -2.023245937
#>  [31] -1.039454854 -0.988174911 -0.253465400 -1.089776476 -1.471952210
#>  [36] -0.737585898 -1.028530069 -0.469983037 -0.001092752  0.686136213
#>  [41] -0.740051500 -3.045960719 -0.486850811 -0.505964930 -2.036683053
#>  [46] -1.722963765 -0.884179975 -1.021072088 -2.384539554 -1.139855056
#>  [51] -2.179717869 -0.304431093 -0.739666526 -1.702908543  0.152230762
#>  [56] -1.116851906 -1.297483417 -0.940353388 -1.320901208 -1.253373738
#>  [61] -0.916510429 -0.723718625 -0.039420831  0.038662007  1.044179410
#>  [66] -0.366465313 -0.860392348 -1.182965122 -1.273167705  0.677844681
#>  [71] -3.463876055 -0.372840372 -0.320749446  0.129452636  0.675847791
#>  [76] -1.675715638 -0.501076143  0.114831950  0.492109528 -0.285325462
#>  [81]  0.251561211  0.611435319  0.296438748 -0.246927923 -1.036127238
#>  [86] -1.869681008 -2.165609271 -0.854484672 -2.662183109 -1.132798248
#>  [91] -1.043034890  1.459625161 -1.571768097 -1.294869055 -0.982150317
#>  [96] -0.444754549 -0.996320147 -0.795358182 -0.585987177 -0.858874811
#> 
#> $alpha1
#>   [1]  0.29655312 -0.83520224  1.17147418  0.36279689  1.17644080 -0.02725459
#>   [7] -0.04733869  0.54586358  1.48357275 -1.07077087  1.27019293  2.56287745
#>  [13]  1.11241584  0.76706813  0.40521619  0.96394229  0.76917258  1.76944204
#>  [19]  1.32563601 -0.21400357 -0.60931063  1.31386312  0.23413655  0.60879322
#>  [25]  0.06848188  0.50006310  0.94675755 -0.15213709  1.82954976  0.30621656
#>  [31]  3.08026250  0.50315354  1.17243108  0.94869555  0.01660033  0.88542173
#>  [37]  0.20302384  1.15334492  0.65058158  0.39260808  1.04850803  1.41670756
#>  [43]  0.02105337  0.87468226  2.61196636  1.37148207  0.80042941  2.69321100
#>  [49]  3.25339674  1.57004001  2.23880775 -0.23544201  0.48034507  2.97783401
#>  [55]  0.88352440  2.47649594  1.19919145  2.99833338  1.79402432  1.45884977
#>  [61]  0.58929005  1.25785865  0.62037789 -0.93335162  0.30949436  1.82067931
#>  [67]  0.78294612  1.81860445  1.66436683 -0.45620833  4.15182112  1.79469983
#>  [73]  0.44432811 -0.52369833  0.91039091  1.12188835  1.34820651  1.66305622
#>  [79]  0.41277080  0.48511386  0.34431235 -1.15157443  1.10685097  1.43200378
#>  [85]  0.03088063  1.73176540  1.97924602  1.62980369  0.89626455  0.70846183
#>  [91]  1.08013999  1.15583542  2.15132696  1.53187726  0.73196455  0.55889071
#>  [97] -0.38526753 -1.05768424  0.65253986  1.80313692
#> 
#> 
#> 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
#> 
#>