Skip to contents

[Experimental]

A function that returns a prob() function that computes the toxicity probabilities for a given dose level, based on the model specific parameters.

Usage

probFunction(model, ...)

# S4 method for class 'GeneralModel'
probFunction(model, ...)

# S4 method for class 'ModelTox'
probFunction(model, ...)

# S4 method for class 'LogisticLogNormalOrdinal'
probFunction(model, grade, ...)

Arguments

model

(GeneralModel or ModelTox)
the model.

...

model specific parameters.

grade

(integer)
the toxicity grade for which the dose function is required

Value

A prob() function that computes toxicity probabilities.

Functions

  • probFunction(GeneralModel): Return a probability function for a GeneralModel.

  • probFunction(ModelTox): Return a probability function for a ModelTox.

  • probFunction(LogisticLogNormalOrdinal): Return a grade-specific probability function for a LogisticLogNormalOrdinal model.

See also

Examples

my_model <- LogisticLogNormal(
  mean = c(-0.85, 1),
  cov = matrix(c(1, -0.5, -0.5, 1), nrow = 2),
  ref_dose = 50
)

prob_fun <- probFunction(my_model, alpha0 = 2, alpha1 = 3)
prob_fun(30)
#> [1] 0.6147973
ordinal_data <- .DefaultDataOrdinal()
ordinal_model <- .DefaultLogisticLogNormalOrdinal()
opts <- .DefaultMcmcOptions()
samples <- mcmc(ordinal_data, ordinal_model, opts)

probFunction(
  ordinal_model,
  grade = 2L,
  alpha2 = samples@data$alpha1,
  beta = samples@data$beta
)(50)
#>    [1] 0.262323853 0.429886621 0.121446463 0.230415455 0.301602895 0.220912460
#>    [7] 0.118341932 0.246423438 0.234688113 0.332467367 0.136434596 0.305626923
#>   [13] 0.088908187 0.382344399 0.290762254 0.216448462 0.405471094 0.282480151
#>   [19] 0.286702981 0.223382333 0.247740342 0.129282898 0.148676775 0.097430000
#>   [25] 0.152933184 0.341780464 0.181410266 0.086080194 0.250471080 0.180136451
#>   [31] 0.140836144 0.120476513 0.405568106 0.288974553 0.853345324 0.791631897
#>   [37] 0.678976979 0.735111979 0.667276666 0.083197466 0.186962110 0.195517588
#>   [43] 0.495051331 0.171617298 0.400374165 0.404200137 0.144434326 0.203444169
#>   [49] 0.240046854 0.398395679 0.350310423 0.237725645 0.063071606 0.054988091
#>   [55] 0.120444014 0.161558854 0.106102742 0.105888412 0.051463810 0.053872775
#>   [61] 0.073864869 0.090845642 0.027559301 0.236479186 0.124303778 0.059994463
#>   [67] 0.054886650 0.041491355 0.097724326 0.364047636 0.331449626 0.130969684
#>   [73] 0.426940217 0.136535297 0.364766000 0.184917752 0.398487616 0.304490539
#>   [79] 0.042499675 0.306882356 0.146765901 0.241247859 0.083359534 0.119410753
#>   [85] 0.361419655 0.210044243 0.181626989 0.088926303 0.108244374 0.161166463
#>   [91] 0.334325486 0.119612884 0.172003481 0.108722456 0.551215841 0.449172956
#>   [97] 0.203290781 0.109814768 0.066419553 0.255896524 0.311941834 0.229924587
#>  [103] 0.511465267 0.263861407 0.006018880 0.017980199 0.256966513 0.416711532
#>  [109] 0.072289514 0.130516536 0.155392424 0.195494899 0.220437364 0.205371039
#>  [115] 0.202445689 0.202369808 0.614958123 0.200610898 0.075771227 0.015565788
#>  [121] 0.124003441 0.230229576 0.476431539 0.090693491 0.159106585 0.272216688
#>  [127] 0.155868579 0.147641108 0.115422193 0.201934614 0.317977092 0.131637516
#>  [133] 0.089687695 0.129261261 0.399025424 0.049046942 0.013674719 0.007560310
#>  [139] 0.065623660 0.192765440 0.059207224 0.322677884 0.149388231 0.316784507
#>  [145] 0.250779073 0.087525241 0.117599363 0.248644782 0.062570780 0.163891570
#>  [151] 0.240566903 0.293842742 0.223076752 0.139020888 0.137509874 0.122179693
#>  [157] 0.438221476 0.156416688 0.381776495 0.404492934 0.268768671 0.145862256
#>  [163] 0.235749802 0.519522539 0.246272013 0.112853867 0.366533186 0.238119478
#>  [169] 0.160238215 0.121239201 0.118965464 0.064255238 0.279835255 0.221440376
#>  [175] 0.100478227 0.038881677 0.280194018 0.113759878 0.126570820 0.122219297
#>  [181] 0.239892886 0.705944455 0.392432236 0.291782531 0.261545003 0.101405067
#>  [187] 0.353248605 0.358174733 0.831610898 0.475147115 0.081211358 0.134588265
#>  [193] 0.142195416 0.134867514 0.152422221 0.245329043 0.310970236 0.362324323
#>  [199] 0.422699022 0.269598077 0.273377725 0.386322235 0.143451781 0.410381956
#>  [205] 0.538190469 0.172458158 0.419553697 0.738688290 0.038405469 0.421659569
#>  [211] 0.038227161 0.260069569 0.089171358 0.131205065 0.098712002 0.017151119
#>  [217] 0.010685572 0.121660437 0.171661007 0.100000128 0.064023949 0.413719049
#>  [223] 0.176137565 0.338027671 0.421750074 0.317305482 0.141586663 0.186569812
#>  [229] 0.308247540 0.424314302 0.294569796 0.132780907 0.350286335 0.093763775
#>  [235] 0.243271846 0.182248012 0.277898003 0.223455050 0.340299487 0.304602339
#>  [241] 0.096812088 0.365824240 0.389388815 0.223003975 0.676859604 0.092522258
#>  [247] 0.169010377 0.677907403 0.324439862 0.331661323 0.157815736 0.116516998
#>  [253] 0.346131224 0.390900531 0.055821364 0.087673184 0.327276038 0.121479479
#>  [259] 0.127546202 0.141877563 0.202743096 0.080803726 0.121677149 0.238370035
#>  [265] 0.212335452 0.109271243 0.172990532 0.275807109 0.122780042 0.655107147
#>  [271] 0.327024943 0.114376697 0.143295350 0.383178849 0.547754547 0.079679762
#>  [277] 0.251830529 0.408442889 0.296092945 0.300869101 0.111785023 0.021652397
#>  [283] 0.030548146 0.180843766 0.117744400 0.363748027 0.275631212 0.214228416
#>  [289] 0.104035755 0.355206473 0.217548963 0.495890503 0.279272433 0.207813405
#>  [295] 0.240136014 0.173235723 0.087701118 0.029602834 0.050963272 0.089355857
#>  [301] 0.264744107 0.263457439 0.126608269 0.256190833 0.216671290 0.694201012
#>  [307] 0.339997369 0.425630838 0.287327030 0.184403994 0.142444168 0.147459191
#>  [313] 0.068461771 0.109970403 0.187767608 0.105995799 0.080913672 0.092242348
#>  [319] 0.571282226 0.370486424 0.127000139 0.235260904 0.155346422 0.187105486
#>  [325] 0.107367999 0.221398373 0.065313609 0.175195684 0.115476949 0.253905456
#>  [331] 0.064432907 0.193539054 0.241101527 0.186529145 0.113150252 0.174853350
#>  [337] 0.219004181 0.438610746 0.090470157 0.427013756 0.252206563 0.370961710
#>  [343] 0.136220223 0.168206388 0.054710560 0.059394456 0.082248010 0.012917199
#>  [349] 0.010904840 0.007381804 0.238888814 0.231246198 0.116742122 0.210465071
#>  [355] 0.029087993 0.032339003 0.119278159 0.496039756 0.079917760 0.259546574
#>  [361] 0.418489117 0.145053803 0.319756733 0.179754805 0.458634106 0.243499132
#>  [367] 0.230429217 0.305657710 0.175313029 0.322228396 0.215284568 0.252617027
#>  [373] 0.304469048 0.130368292 0.036285058 0.081650684 0.242891225 0.069276745
#>  [379] 0.280333335 0.204067183 0.324434031 0.123938605 0.517272840 0.070943076
#>  [385] 0.249753252 0.161384309 0.257258757 0.231730872 0.058085693 0.064101001
#>  [391] 0.587290975 0.447469708 0.161195552 0.183571225 0.191399349 0.212543015
#>  [397] 0.275293693 0.366121162 0.230133405 0.293946462 0.488245643 0.410509337
#>  [403] 0.126185964 0.472508418 0.159507645 0.370453484 0.363140341 0.235996811
#>  [409] 0.575060489 0.092760386 0.109129645 0.285633282 0.218659950 0.113154474
#>  [415] 0.129830299 0.212290823 0.130176808 0.058776656 0.346903418 0.212728456
#>  [421] 0.236408804 0.193068065 0.168126583 0.136002446 0.286892095 0.121918090
#>  [427] 0.315995610 0.303313849 0.310899056 0.223622471 0.135898692 0.401138291
#>  [433] 0.453102897 0.199853295 0.081828309 0.192105681 0.074722290 0.148753357
#>  [439] 0.077159141 0.154753880 0.196536892 0.307433365 0.090739289 0.054278950
#>  [445] 0.366316679 0.137505500 0.099408688 0.214214041 0.446437426 0.295575963
#>  [451] 0.208402614 0.227374579 0.343656862 0.383286943 0.388763715 0.176434137
#>  [457] 0.104873068 0.336820161 0.102602467 0.020867226 0.046456981 0.312364878
#>  [463] 0.331979014 0.478233231 0.490374935 0.271977368 0.468339254 0.088069111
#>  [469] 0.031158717 0.056211223 0.445913455 0.376254845 0.267957897 0.112190339
#>  [475] 0.248534298 0.174177586 0.260761178 0.203924130 0.190786824 0.117245510
#>  [481] 0.236173193 0.169572881 0.346029244 0.524835232 0.456377805 0.208369668
#>  [487] 0.127256518 0.233202358 0.036389918 0.300666848 0.295931850 0.271066880
#>  [493] 0.110815409 0.218161608 0.273375205 0.195836992 0.089033188 0.477903453
#>  [499] 0.323485406 0.117075175 0.392487980 0.303260218 0.138899816 0.047495327
#>  [505] 0.521209866 0.482294730 0.013084388 0.072057961 0.145144563 0.237599597
#>  [511] 0.143924980 0.140978185 0.162375840 0.067233383 0.141505664 0.455276728
#>  [517] 0.121347365 0.187792150 0.241027531 0.473983138 0.119082130 0.064106393
#>  [523] 0.094487957 0.110192681 0.138050722 0.335046668 0.271944539 0.272841571
#>  [529] 0.347571267 0.234717191 0.294966042 0.296208223 0.327779821 0.111463682
#>  [535] 0.083459818 0.282516782 0.284412305 0.311801158 0.131215280 0.338049791
#>  [541] 0.324613219 0.071146031 0.236272798 0.279146621 0.152413843 0.217085376
#>  [547] 0.246908009 0.163801850 0.257731287 0.258706747 0.183906535 0.307371920
#>  [553] 0.150358180 0.374148264 0.178858422 0.177821114 0.280465933 0.579012649
#>  [559] 0.206078272 0.174704994 0.172137249 0.205132291 0.185048476 0.336457863
#>  [565] 0.272446721 0.222212720 0.329534296 0.639253117 0.397710498 0.431264577
#>  [571] 0.213820021 0.500100102 0.222873864 0.305447433 0.097037434 0.043937634
#>  [577] 0.129880949 0.111862944 0.387206815 0.179429276 0.271481900 0.347003800
#>  [583] 0.428042081 0.202383531 0.602819050 0.192466610 0.541347155 0.329730686
#>  [589] 0.164966377 0.310564762 0.230985018 0.088944603 0.152998506 0.095835785
#>  [595] 0.051337810 0.153506538 0.441423919 0.510480570 0.255610698 0.307117007
#>  [601] 0.119162422 0.147843117 0.104340386 0.031903969 0.254217875 0.178771986
#>  [607] 0.345603432 0.061468257 0.394079734 0.425695720 0.144820546 0.148207117
#>  [613] 0.439595441 0.232943969 0.265361742 0.076785858 0.181672999 0.092940750
#>  [619] 0.387160505 0.105540758 0.086176505 0.130411957 0.265815040 0.310734763
#>  [625] 0.038509841 0.017342184 0.205388193 0.093565555 0.210162926 0.368479860
#>  [631] 0.177375569 0.140037534 0.201688883 0.273076739 0.078554317 0.606549742
#>  [637] 0.032462603 0.121758842 0.244491851 0.278860110 0.182867689 0.163968825
#>  [643] 0.277536005 0.060704068 0.435967523 0.168635966 0.176378048 0.272226810
#>  [649] 0.397392963 0.239012345 0.194277436 0.184622039 0.599163541 0.094317331
#>  [655] 0.085515259 0.194090892 0.130876629 0.223639874 0.449001224 0.049269618
#>  [661] 0.255045159 0.068138846 0.091341434 0.116283218 0.229485993 0.119147500
#>  [667] 0.205447165 0.253125222 0.091616069 0.320316219 0.292660382 0.186042539
#>  [673] 0.310361002 0.247083628 0.194404547 0.444552006 0.225856126 0.436985436
#>  [679] 0.481023691 0.078292262 0.175957596 0.329880297 0.058649729 0.305921835
#>  [685] 0.025123080 0.096030171 0.227524307 0.134096576 0.305681235 0.194156656
#>  [691] 0.220904994 0.070107956 0.292375295 0.147782248 0.373636722 0.384902273
#>  [697] 0.260374841 0.604610543 0.110057590 0.178948043 0.074677810 0.206845477
#>  [703] 0.342684511 0.143178410 0.063289431 0.253080373 0.513505062 0.275350562
#>  [709] 0.409270162 0.225869875 0.239586675 0.325767948 0.444475157 0.202152743
#>  [715] 0.274150641 0.197307299 0.297475970 0.109683595 0.269720482 0.496178569
#>  [721] 0.220045739 0.321629370 0.245327999 0.419945306 0.217224528 0.188824286
#>  [727] 0.431279281 0.245919848 0.529549303 0.260287575 0.250876141 0.115157101
#>  [733] 0.251741086 0.092159138 0.230843199 0.473814723 0.345038034 0.214060692
#>  [739] 0.291982569 0.137476964 0.326450666 0.107737003 0.257620171 0.508738501
#>  [745] 0.204052338 0.137454851 0.077785673 0.065037479 0.228899128 0.058455455
#>  [751] 0.262529336 0.109067476 0.202434787 0.254389284 0.445024787 0.062785647
#>  [757] 0.008352693 0.057067781 0.200095744 0.241381071 0.183084338 0.099456315
#>  [763] 0.467173295 0.127514015 0.195324894 0.192068986 0.270704976 0.181611052
#>  [769] 0.178339268 0.246035248 0.408167592 0.529597720 0.259515376 0.341859588
#>  [775] 0.202032745 0.361931829 0.300650903 0.125603256 0.184670999 0.078886133
#>  [781] 0.109002358 0.680273962 0.538903554 0.305100058 0.440011491 0.549690924
#>  [787] 0.400887127 0.350128156 0.397720035 0.295212521 0.224313217 0.355189549
#>  [793] 0.125683533 0.566538264 0.095297495 0.260848936 0.055969166 0.090715699
#>  [799] 0.580867040 0.110554862 0.208283888 0.102662469 0.288785072 0.292282741
#>  [805] 0.233595165 0.168995698 0.079872966 0.343546890 0.066316407 0.488330036
#>  [811] 0.047276658 0.079406849 0.039012825 0.069152804 0.098458396 0.214623688
#>  [817] 0.160987496 0.234453354 0.131074157 0.071372860 0.288687367 0.055609121
#>  [823] 0.180666136 0.257792515 0.182446448 0.128326988 0.201553961 0.127880495
#>  [829] 0.224003902 0.181939451 0.130185093 0.205809592 0.217036100 0.167244156
#>  [835] 0.298576666 0.369822455 0.415160887 0.579584172 0.166087099 0.181990963
#>  [841] 0.377686844 0.288843256 0.581019849 0.422571009 0.364253704 0.230298163
#>  [847] 0.245309949 0.292166157 0.274220212 0.217448439 0.149009130 0.069323651
#>  [853] 0.159618334 0.268515896 0.168023397 0.323393708 0.107358647 0.431653464
#>  [859] 0.272845111 0.400017960 0.349005655 0.431984920 0.110435868 0.389980869
#>  [865] 0.258413776 0.497318476 0.326833053 0.263803879 0.095289483 0.154251822
#>  [871] 0.473276376 0.217836317 0.231598652 0.437546274 0.329714048 0.320059844
#>  [877] 0.298751440 0.202578247 0.243858202 0.169078144 0.164222287 0.249653752
#>  [883] 0.440045092 0.121976812 0.022184440 0.045169955 0.225768165 0.173763337
#>  [889] 0.049468822 0.104714520 0.108254410 0.234322397 0.617613635 0.177548366
#>  [895] 0.368580759 0.578397294 0.294333853 0.205204322 0.295230017 0.206190024
#>  [901] 0.094952437 0.114883958 0.183241239 0.051107149 0.052436843 0.249226106
#>  [907] 0.218145649 0.219050727 0.135491759 0.430702785 0.479355274 0.340688185
#>  [913] 0.187370337 0.341817134 0.334368186 0.182453982 0.203998342 0.397328498
#>  [919] 0.266567760 0.307655837 0.356819353 0.238931927 0.175742043 0.185251864
#>  [925] 0.280119021 0.057446523 0.124500685 0.369844651 0.596275835 0.317223319
#>  [931] 0.295995453 0.223982936 0.258741834 0.346793580 0.181528082 0.090019777
#>  [937] 0.249301773 0.272792493 0.137745561 0.134204887 0.176625756 0.556890017
#>  [943] 0.482512761 0.235562200 0.162790352 0.100749712 0.095452813 0.144038894
#>  [949] 0.046575038 0.026281923 0.185122950 0.133553509 0.167037155 0.601953336
#>  [955] 0.215872756 0.332741464 0.202350595 0.245752369 0.135972292 0.064493897
#>  [961] 0.224137554 0.063640893 0.302795361 0.455847139 0.078571907 0.193714852
#>  [967] 0.151240374 0.254848730 0.107358282 0.073699198 0.289757161 0.095300380
#>  [973] 0.089842509 0.492517622 0.081203042 0.342096473 0.278700083 0.112024813
#>  [979] 0.452854582 0.390647790 0.427404647 0.351917676 0.160951078 0.466300097
#>  [985] 0.320848032 0.307049018 0.362082635 0.388280251 0.584202947 0.630079526
#>  [991] 0.142115410 0.066897197 0.140618038 0.157745846 0.447940501 0.311170242
#>  [997] 0.188683071 0.243425700 0.183150033 0.372591191