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.332865829 0.101420301 0.104553103 0.094391404 0.242304191 0.081787052
#>    [7] 0.164194891 0.251733251 0.211599787 0.326329512 0.154424713 0.287161082
#>   [13] 0.340751196 0.114645014 0.136409048 0.295717619 0.167729205 0.111535320
#>   [19] 0.240351098 0.067263776 0.267338305 0.107281100 0.146811930 0.190254156
#>   [25] 0.203411771 0.032459877 0.426135491 0.360266458 0.527882380 0.429851856
#>   [31] 0.116937828 0.067494150 0.151765942 0.424439094 0.145436091 0.266728433
#>   [37] 0.268841514 0.252714657 0.317396775 0.312884260 0.273910933 0.623445513
#>   [43] 0.503988790 0.072144784 0.141114021 0.255999711 0.478243633 0.666963560
#>   [49] 0.225693061 0.134385278 0.169372806 0.147295027 0.281899713 0.158753027
#>   [55] 0.422104960 0.473462997 0.295899706 0.045956255 0.192120772 0.127230792
#>   [61] 0.169368226 0.142404193 0.127315556 0.175851001 0.184173543 0.391875447
#>   [67] 0.136785511 0.398711269 0.166583965 0.445883091 0.179360697 0.081989954
#>   [73] 0.122065081 0.658398754 0.495623368 0.230277030 0.206950492 0.129796729
#>   [79] 0.121758677 0.138071203 0.155952303 0.092111557 0.174999497 0.159607664
#>   [85] 0.324769918 0.291853960 0.157501536 0.071215458 0.268026258 0.154662911
#>   [91] 0.395601379 0.320954414 0.189745918 0.126484398 0.268440156 0.091581920
#>   [97] 0.570862235 0.403981754 0.460911676 0.290567872 0.237628037 0.227077704
#>  [103] 0.334796707 0.138974029 0.207110709 0.374153641 0.119516308 0.256095656
#>  [109] 0.068541431 0.086128321 0.292177095 0.528518675 0.231860184 0.300278595
#>  [115] 0.056689718 0.400477682 0.369860202 0.073797575 0.151512280 0.337166924
#>  [121] 0.041170271 0.104330899 0.197233211 0.256355989 0.321176425 0.485486019
#>  [127] 0.357368855 0.426314129 0.257258872 0.272754208 0.188988414 0.131862543
#>  [133] 0.026867782 0.216682403 0.223938391 0.578227444 0.169942857 0.445548659
#>  [139] 0.385708986 0.569998089 0.179964771 0.484606883 0.367151969 0.530705323
#>  [145] 0.253964576 0.080180417 0.279343214 0.137891090 0.055115333 0.123473889
#>  [151] 0.105010859 0.182160164 0.346496320 0.364931570 0.164465160 0.176758977
#>  [157] 0.447158713 0.218766047 0.436803824 0.339846829 0.304721251 0.450748649
#>  [163] 0.205284581 0.148421239 0.477146029 0.416755059 0.122384523 0.201927669
#>  [169] 0.380896203 0.414138519 0.285162436 0.388847901 0.155043993 0.213369753
#>  [175] 0.227245345 0.161524149 0.345056158 0.099280631 0.371544342 0.143735198
#>  [181] 0.402997549 0.188279565 0.378498799 0.023720467 0.432488465 0.430051644
#>  [187] 0.274704058 0.507590525 0.626025253 0.063191860 0.128364670 0.469009515
#>  [193] 0.052710834 0.082010760 0.298637379 0.298599495 0.243441002 0.386801635
#>  [199] 0.081581396 0.167826887 0.191917911 0.344604845 0.387449115 0.237450257
#>  [205] 0.036160513 0.257744000 0.143365863 0.108512644 0.020114496 0.141027119
#>  [211] 0.593955888 0.321194541 0.408049924 0.308331428 0.122732705 0.111286390
#>  [217] 0.065190061 0.128789220 0.521199094 0.411602714 0.121879625 0.277352480
#>  [223] 0.179746319 0.066401419 0.262618265 0.286517889 0.178680124 0.145515993
#>  [229] 0.066973526 0.524779852 0.347893599 0.065640432 0.067866808 0.092960558
#>  [235] 0.068773463 0.376363750 0.158093544 0.137003389 0.289956459 0.095359993
#>  [241] 0.330055304 0.055332144 0.093486766 0.115891354 0.361159329 0.374067052
#>  [247] 0.201255580 0.105635001 0.131278691 0.123455677 0.179764239 0.158816416
#>  [253] 0.437279821 0.425986042 0.359159696 0.156761654 0.520288645 0.286983781
#>  [259] 0.364266070 0.309305267 0.232548625 0.200482589 0.334425941 0.203228131
#>  [265] 0.291007368 0.215596956 0.233314594 0.200275488 0.257397542 0.049614001
#>  [271] 0.042357969 0.596129662 0.201640521 0.386532795 0.316481122 0.273950592
#>  [277] 0.482427403 0.724901368 0.198386843 0.380333357 0.388250919 0.184293467
#>  [283] 0.107439643 0.494472595 0.139697618 0.374161725 0.147918437 0.221342903
#>  [289] 0.289138092 0.414146354 0.187701943 0.198004967 0.434043345 0.372729998
#>  [295] 0.141372530 0.213064550 0.459483789 0.119735346 0.054685068 0.148742450
#>  [301] 0.233599221 0.199777303 0.094849849 0.131481295 0.398437310 0.338742024
#>  [307] 0.328433022 0.247701580 0.474087933 0.156277968 0.124088290 0.054874509
#>  [313] 0.272138422 0.172123781 0.065013055 0.095668494 0.131781504 0.237693713
#>  [319] 0.244976738 0.091544572 0.190507868 0.028746383 0.359905233 0.027108760
#>  [325] 0.383870770 0.161888637 0.398906932 0.416311479 0.160559457 0.239936769
#>  [331] 0.245590369 0.151732999 0.177687616 0.235533315 0.297496551 0.120164312
#>  [337] 0.475021163 0.126850346 0.031681590 0.313467579 0.248805498 0.440785094
#>  [343] 0.266579650 0.364868458 0.359819998 0.159580236 0.161183992 0.246486157
#>  [349] 0.064615285 0.145188060 0.274925080 0.289895922 0.285228042 0.253769910
#>  [355] 0.315533780 0.171769359 0.273220883 0.106365704 0.325450433 0.149843539
#>  [361] 0.319949043 0.182470135 0.159711969 0.378714711 0.267911897 0.122412870
#>  [367] 0.109159407 0.148300373 0.348118751 0.141082517 0.193437148 0.464130236
#>  [373] 0.320563315 0.208057786 0.248623805 0.160345741 0.183425577 0.187244735
#>  [379] 0.189537214 0.101833199 0.341430493 0.256101889 0.244733956 0.234042089
#>  [385] 0.368058895 0.316025503 0.224343752 0.042801432 0.110065031 0.147462613
#>  [391] 0.048939329 0.052931641 0.294369228 0.091213570 0.203751396 0.179833310
#>  [397] 0.182143300 0.078604817 0.073845612 0.496711797 0.546324726 0.067563261
#>  [403] 0.208710262 0.272120822 0.555977534 0.412041221 0.275474881 0.278180094
#>  [409] 0.372747005 0.243936122 0.288840343 0.185904369 0.282747034 0.311817589
#>  [415] 0.385691424 0.364701312 0.345461407 0.130849540 0.306715594 0.111461885
#>  [421] 0.176187215 0.264110242 0.126663703 0.174952573 0.155484459 0.068404832
#>  [427] 0.143234662 0.100366114 0.053018969 0.009055621 0.065806769 0.127215332
#>  [433] 0.228652368 0.174323119 0.521006675 0.183009570 0.118341350 0.163805877
#>  [439] 0.206427054 0.227009622 0.139757979 0.319105515 0.313406348 0.435677608
#>  [445] 0.403286801 0.474397289 0.457858663 0.160425171 0.166326625 0.189736876
#>  [451] 0.293492768 0.247788756 0.113668250 0.423587562 0.456067167 0.148687345
#>  [457] 0.277779605 0.535233514 0.311495931 0.385050203 0.236500583 0.115074482
#>  [463] 0.257251686 0.079712893 0.572387583 0.129342458 0.388042990 0.050334312
#>  [469] 0.085441509 0.135983979 0.094529358 0.059170267 0.398191574 0.190818004
#>  [475] 0.299861028 0.184327644 0.094780916 0.300254827 0.355493140 0.093286732
#>  [481] 0.119844388 0.377450818 0.197594691 0.167921351 0.068413718 0.072040925
#>  [487] 0.210062702 0.182505315 0.123512791 0.216191046 0.239887796 0.236686505
#>  [493] 0.322876751 0.325646684 0.495483011 0.688311627 0.254617507 0.142291633
#>  [499] 0.168860276 0.313529950 0.312082409 0.214979684 0.416634227 0.180109923
#>  [505] 0.435758894 0.415485227 0.057538523 0.159511285 0.227129481 0.308024546
#>  [511] 0.305352854 0.290041858 0.358991684 0.085391252 0.060009682 0.327896647
#>  [517] 0.089076876 0.335811647 0.180810303 0.231996323 0.293721418 0.160101970
#>  [523] 0.282713331 0.146670879 0.229992812 0.122079467 0.122025894 0.068881038
#>  [529] 0.079308340 0.106597765 0.101495929 0.183395735 0.188771149 0.250464279
#>  [535] 0.236624747 0.291225116 0.180490245 0.225346249 0.485481402 0.159544277
#>  [541] 0.221144104 0.376538942 0.066567839 0.179826014 0.403415361 0.103586266
#>  [547] 0.236493669 0.197949130 0.141158772 0.186157562 0.192309672 0.254902024
#>  [553] 0.357016819 0.101488170 0.310500624 0.316357920 0.229627960 0.269902553
#>  [559] 0.394075120 0.188746209 0.511960015 0.635326643 0.131589863 0.104947614
#>  [565] 0.560520094 0.097960814 0.248027959 0.472804562 0.177027312 0.163278438
#>  [571] 0.083138905 0.261835150 0.392017812 0.501157353 0.477918428 0.394959109
#>  [577] 0.275961995 0.175522762 0.575529291 0.273543090 0.322285878 0.274680246
#>  [583] 0.073597301 0.100929336 0.203073550 0.391911686 0.086383285 0.710760833
#>  [589] 0.104308178 0.071457596 0.192558416 0.179387819 0.279550441 0.286793633
#>  [595] 0.256097998 0.087882151 0.411286779 0.080649367 0.131392087 0.329448714
#>  [601] 0.323411072 0.155643194 0.126009765 0.130732883 0.138891109 0.165978873
#>  [607] 0.186550590 0.409221062 0.066119191 0.293828218 0.149797607 0.124508964
#>  [613] 0.096647460 0.086645913 0.073772064 0.065887973 0.253938802 0.262419053
#>  [619] 0.050731958 0.034772880 0.205611030 0.170135691 0.236528691 0.424819868
#>  [625] 0.284085904 0.301582496 0.278713701 0.116899292 0.342428920 0.187326367
#>  [631] 0.250620643 0.532169407 0.187976924 0.295262085 0.493669490 0.518136937
#>  [637] 0.108451033 0.065849816 0.070060208 0.150150335 0.309871259 0.169108066
#>  [643] 0.368404210 0.208839953 0.131893231 0.557064095 0.359641118 0.123186426
#>  [649] 0.119750622 0.113456450 0.381358374 0.273665014 0.356933384 0.024631317
#>  [655] 0.027579063 0.058418331 0.048324822 0.186325001 0.154328906 0.303887677
#>  [661] 0.501537328 0.172358822 0.203538804 0.149521420 0.258714512 0.126672401
#>  [667] 0.396767975 0.334199323 0.300310381 0.500101198 0.441986832 0.120723429
#>  [673] 0.393029582 0.259687529 0.438782038 0.101394394 0.515844531 0.142382236
#>  [679] 0.300981647 0.107647134 0.376867317 0.270951587 0.167491671 0.096302539
#>  [685] 0.110847604 0.171073019 0.336039380 0.078495023 0.105594815 0.148523268
#>  [691] 0.057593323 0.207131473 0.180647176 0.100954788 0.069702381 0.045772707
#>  [697] 0.272989509 0.100959578 0.098620155 0.261555552 0.385089570 0.060413085
#>  [703] 0.067437716 0.564523683 0.668917718 0.634436204 0.376608113 0.233075072
#>  [709] 0.294297597 0.270040730 0.327665774 0.118126765 0.410208437 0.164574706
#>  [715] 0.152945533 0.230766140 0.165754870 0.256054362 0.164811486 0.145752142
#>  [721] 0.209133941 0.307503913 0.184286605 0.148751822 0.262126946 0.085481384
#>  [727] 0.262959930 0.230236500 0.356700619 0.343914755 0.312514025 0.478400499
#>  [733] 0.230961774 0.068290811 0.123741827 0.341687102 0.378244589 0.228113867
#>  [739] 0.206760172 0.231717600 0.259248461 0.284047034 0.346584456 0.265810135
#>  [745] 0.446754301 0.353056027 0.098297028 0.273976616 0.267602222 0.244809060
#>  [751] 0.149789681 0.595431060 0.470692271 0.325055602 0.298959689 0.318575816
#>  [757] 0.252121927 0.125922386 0.131245666 0.168032141 0.125147067 0.268636156
#>  [763] 0.174592132 0.138098775 0.218015880 0.189436109 0.349707667 0.246166182
#>  [769] 0.161076706 0.118310518 0.167944629 0.224586897 0.291399681 0.206501353
#>  [775] 0.290301174 0.122146779 0.353091318 0.552773113 0.187207671 0.159508756
#>  [781] 0.187683747 0.382738644 0.191398801 0.277608543 0.298587090 0.214837347
#>  [787] 0.232238926 0.604953810 0.159341010 0.325792522 0.144449229 0.207497599
#>  [793] 0.234485167 0.050508006 0.241882497 0.108118800 0.072481446 0.102580181
#>  [799] 0.083260442 0.182469600 0.174894168 0.353430708 0.305132002 0.219346995
#>  [805] 0.031868828 0.157278622 0.124416747 0.269784748 0.380279791 0.250114169
#>  [811] 0.307006570 0.193544872 0.636207244 0.331939116 0.278112560 0.271902341
#>  [817] 0.125680762 0.257326313 0.362441288 0.188785093 0.080437627 0.073110483
#>  [823] 0.137749987 0.213520416 0.480513639 0.549325418 0.225422199 0.334060401
#>  [829] 0.221064732 0.167368450 0.248101562 0.289667008 0.252373374 0.385096402
#>  [835] 0.272035751 0.252533826 0.343707548 0.053517318 0.275760829 0.210459660
#>  [841] 0.202456381 0.194210814 0.307602420 0.294835701 0.179168781 0.157738446
#>  [847] 0.245127957 0.136387203 0.358711720 0.222021838 0.308534762 0.272427712
#>  [853] 0.203300369 0.347094854 0.143147409 0.147268300 0.264711392 0.266872806
#>  [859] 0.170057565 0.353816954 0.606542256 0.308434361 0.309231960 0.279056733
#>  [865] 0.275716601 0.261305976 0.244690358 0.316640314 0.321630851 0.221722740
#>  [871] 0.145919819 0.095874919 0.152037284 0.148390350 0.218573120 0.192401346
#>  [877] 0.264547540 0.286051386 0.464012727 0.314603707 0.286028301 0.366579612
#>  [883] 0.246747306 0.090895491 0.125786358 0.255792720 0.351872762 0.268513028
#>  [889] 0.086877113 0.240091987 0.110340954 0.165736450 0.237289154 0.304795029
#>  [895] 0.542947477 0.308216942 0.297220140 0.176862587 0.084260407 0.327470729
#>  [901] 0.214345029 0.235751745 0.172357988 0.092790642 0.587622473 0.716742159
#>  [907] 0.258791889 0.381461144 0.111956141 0.206133266 0.037678588 0.163469647
#>  [913] 0.250600144 0.232486365 0.146196832 0.445614554 0.307917061 0.380930686
#>  [919] 0.253889281 0.294712532 0.102561394 0.233751809 0.203195614 0.618308936
#>  [925] 0.463136416 0.488016686 0.163994455 0.409838646 0.067085038 0.131701378
#>  [931] 0.204925856 0.085158785 0.112473800 0.166031278 0.080184479 0.295487036
#>  [937] 0.204196472 0.110653393 0.248595960 0.603652830 0.141729647 0.219571297
#>  [943] 0.322944774 0.311929300 0.066282588 0.116505642 0.253021081 0.259969073
#>  [949] 0.086030619 0.139017267 0.105224295 0.192474008 0.435018310 0.124636054
#>  [955] 0.148187480 0.147001710 0.382806478 0.057439026 0.043899396 0.173352262
#>  [961] 0.131340495 0.157089758 0.195714164 0.495089651 0.125976618 0.203499507
#>  [967] 0.072887388 0.117244982 0.050554086 0.104246894 0.125458951 0.255484713
#>  [973] 0.239418284 0.176299172 0.207313762 0.197391720 0.189374896 0.008369715
#>  [979] 0.058999710 0.193900247 0.613608484 0.324406994 0.149613759 0.264350042
#>  [985] 0.077276408 0.342049262 0.166203184 0.483374270 0.159779625 0.265792172
#>  [991] 0.279352834 0.276515772 0.099661220 0.148508677 0.492191445 0.031507317
#>  [997] 0.367502450 0.178705757 0.106985993 0.185766228