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.127236260 0.208063866 0.234828226 0.091794530 0.271798315 0.411711052
#>    [7] 0.306576747 0.167031969 0.170880900 0.176727676 0.336854565 0.420745454
#>   [13] 0.036031093 0.457611074 0.109253902 0.066212412 0.241146894 0.421094465
#>   [19] 0.498936957 0.149707401 0.340516059 0.300999524 0.315988010 0.123023321
#>   [25] 0.302422019 0.349295631 0.184499959 0.136956256 0.255518923 0.391070368
#>   [31] 0.063321338 0.171057786 0.582832372 0.151613069 0.276251679 0.246658918
#>   [37] 0.713104141 0.250879116 0.134683267 0.299086419 0.138111359 0.299912678
#>   [43] 0.138730388 0.138300395 0.153615723 0.255499833 0.428712469 0.065670079
#>   [49] 0.049526086 0.327690829 0.148781164 0.230232040 0.160787403 0.269862047
#>   [55] 0.302648442 0.268319911 0.031418461 0.188568315 0.267145049 0.240465851
#>   [61] 0.080226322 0.036858992 0.149780960 0.300404323 0.291281544 0.304393410
#>   [67] 0.182118156 0.142847406 0.283775682 0.215973887 0.063139817 0.114445046
#>   [73] 0.175801890 0.170417919 0.156141298 0.209677027 0.141392601 0.167610061
#>   [79] 0.384561573 0.353791550 0.429812418 0.258739695 0.188517037 0.336130286
#>   [85] 0.482513689 0.079479362 0.330222392 0.224643280 0.021560889 0.021428838
#>   [91] 0.142968542 0.291441968 0.237003268 0.213231821 0.162898223 0.031457032
#>   [97] 0.073957928 0.204350057 0.243490222 0.169141552 0.153822413 0.056519561
#>  [103] 0.387877408 0.122925792 0.165129812 0.221012984 0.157240576 0.451431260
#>  [109] 0.586978491 0.286602476 0.218820238 0.215471111 0.165948762 0.133804331
#>  [115] 0.374278577 0.235208941 0.372997554 0.077695106 0.467916099 0.308648202
#>  [121] 0.410724616 0.236597103 0.224860095 0.186482252 0.106032097 0.418636022
#>  [127] 0.187650728 0.307804557 0.201053855 0.449595686 0.105028290 0.106725341
#>  [133] 0.477000416 0.393931336 0.184766037 0.554510824 0.090910026 0.089042327
#>  [139] 0.060185692 0.276702003 0.310086757 0.115346732 0.244404393 0.102800807
#>  [145] 0.128730348 0.227532293 0.289403549 0.307473951 0.483854808 0.218275047
#>  [151] 0.184499427 0.371931607 0.199826820 0.267180285 0.353210251 0.089917640
#>  [157] 0.051804783 0.089256653 0.120088095 0.262112960 0.194676310 0.159699445
#>  [163] 0.187291945 0.213327608 0.481952692 0.268737479 0.040047692 0.144817696
#>  [169] 0.313323350 0.299567433 0.134849534 0.235750460 0.172332984 0.052734262
#>  [175] 0.196446850 0.321327432 0.327022920 0.347109493 0.377431583 0.183145256
#>  [181] 0.232055280 0.338766487 0.271494002 0.164646824 0.273372778 0.382640474
#>  [187] 0.254970497 0.233796939 0.276742914 0.089566263 0.072371836 0.127286927
#>  [193] 0.061866867 0.195825799 0.154613425 0.105929830 0.026062892 0.072788702
#>  [199] 0.025623634 0.055105913 0.316215885 0.553346804 0.066094634 0.321860966
#>  [205] 0.288863032 0.336484356 0.164493920 0.135343045 0.142152108 0.099077423
#>  [211] 0.172976062 0.183513117 0.342189620 0.289292787 0.380123910 0.254811623
#>  [217] 0.171269075 0.508501881 0.298299032 0.092778744 0.093389554 0.158071676
#>  [223] 0.447850654 0.227979061 0.246385758 0.097285866 0.114264935 0.203627573
#>  [229] 0.149093690 0.248326134 0.251584398 0.154082312 0.346672432 0.331071727
#>  [235] 0.160845516 0.175542696 0.263104772 0.107643394 0.045907308 0.331426363
#>  [241] 0.140278967 0.123897314 0.511787171 0.318637374 0.419229777 0.180799119
#>  [247] 0.217772588 0.190980414 0.131277434 0.234829523 0.264240272 0.212566995
#>  [253] 0.417190364 0.084600066 0.264005688 0.199300510 0.169083960 0.186956409
#>  [259] 0.274656286 0.154569990 0.169678190 0.373534009 0.292688476 0.183660852
#>  [265] 0.499793529 0.369566807 0.099185697 0.297373881 0.296321250 0.260274442
#>  [271] 0.111265293 0.092000195 0.060942117 0.274283283 0.222940508 0.110444081
#>  [277] 0.254942596 0.179278930 0.563132180 0.377131293 0.390998230 0.295720876
#>  [283] 0.274469181 0.517267613 0.216703479 0.238176678 0.434086845 0.420778953
#>  [289] 0.481499542 0.426708499 0.278779453 0.117012174 0.289931232 0.439882163
#>  [295] 0.184344343 0.013108960 0.253044850 0.045373715 0.104588037 0.183135256
#>  [301] 0.240597454 0.364670476 0.348357071 0.271219209 0.235475535 0.047681940
#>  [307] 0.471420911 0.226740266 0.315666803 0.212897474 0.217742568 0.108998029
#>  [313] 0.098144697 0.401284500 0.201502401 0.382538712 0.048685997 0.497911123
#>  [319] 0.193142821 0.282366758 0.498415645 0.296069932 0.150911473 0.259046965
#>  [325] 0.252147807 0.156854920 0.587960681 0.083370758 0.150584901 0.152663163
#>  [331] 0.277536442 0.167308817 0.341594604 0.409376457 0.316594083 0.098721293
#>  [337] 0.261140311 0.050607725 0.088146159 0.042510560 0.589103184 0.411616434
#>  [343] 0.062926088 0.391634493 0.063939878 0.363851767 0.425290600 0.273929862
#>  [349] 0.158697514 0.139065848 0.558502941 0.077198759 0.279936028 0.365837779
#>  [355] 0.468420262 0.340194648 0.317086192 0.283693422 0.294819501 0.207875728
#>  [361] 0.122573853 0.127691367 0.235030364 0.282992670 0.088966368 0.111975424
#>  [367] 0.103838451 0.415042899 0.185913308 0.179415499 0.185476831 0.145760475
#>  [373] 0.045509302 0.180947848 0.116806938 0.046949657 0.112146138 0.032543301
#>  [379] 0.060930945 0.304564090 0.251500910 0.210572178 0.473996603 0.527886800
#>  [385] 0.385696097 0.081669862 0.055952229 0.232569238 0.200680768 0.075051403
#>  [391] 0.083928504 0.117809380 0.388882431 0.067302035 0.404129508 0.454485550
#>  [397] 0.350640981 0.359189448 0.347474966 0.040153777 0.084220473 0.144460378
#>  [403] 0.250315208 0.229167312 0.140797095 0.287906358 0.251510520 0.328402133
#>  [409] 0.501259696 0.648032612 0.417958535 0.095941215 0.044569236 0.637457115
#>  [415] 0.358347830 0.309505584 0.153562920 0.444627806 0.182599472 0.191590884
#>  [421] 0.116741150 0.067593152 0.099849802 0.088274085 0.106821347 0.112208987
#>  [427] 0.390493486 0.346176558 0.129489899 0.114025223 0.074495953 0.149705683
#>  [433] 0.383841123 0.187388529 0.140944270 0.092737556 0.059468563 0.149793297
#>  [439] 0.195376278 0.287458237 0.198893470 0.008319739 0.011887333 0.007224867
#>  [445] 0.007977880 0.021964522 0.013731486 0.237656586 0.335448191 0.241623504
#>  [451] 0.292076218 0.390758071 0.340357363 0.423993463 0.224956271 0.197531108
#>  [457] 0.197196107 0.276092129 0.287803062 0.047224583 0.254293201 0.323492417
#>  [463] 0.330808580 0.432030761 0.560327018 0.289500898 0.025521895 0.208505423
#>  [469] 0.117532164 0.144009987 0.439189534 0.070010562 0.650187807 0.142602038
#>  [475] 0.290760301 0.160746542 0.291206602 0.114263615 0.078118959 0.055847970
#>  [481] 0.055148262 0.098378442 0.046453252 0.231790879 0.047713950 0.164842865
#>  [487] 0.353632655 0.094848064 0.414135034 0.056980960 0.235726183 0.285664327
#>  [493] 0.046483837 0.202442859 0.109269643 0.169003621 0.131417295 0.098975730
#>  [499] 0.081654336 0.354980307 0.557369423 0.199827053 0.280728573 0.244203064
#>  [505] 0.428276423 0.126352370 0.123507392 0.085212522 0.290200544 0.280562427
#>  [511] 0.234514982 0.163728096 0.060370415 0.446434529 0.264513876 0.192404905
#>  [517] 0.244714389 0.209369346 0.233741603 0.506093918 0.165241991 0.243616630
#>  [523] 0.301484022 0.365909141 0.141983443 0.284449679 0.220579764 0.398734850
#>  [529] 0.020203227 0.029649290 0.033756891 0.658503588 0.026168745 0.150915062
#>  [535] 0.323517868 0.206004013 0.181524866 0.230633115 0.149959331 0.269376612
#>  [541] 0.395923658 0.218330220 0.123882702 0.201866369 0.465555816 0.189458263
#>  [547] 0.347229656 0.228058354 0.184729895 0.245280201 0.345142045 0.053015840
#>  [553] 0.133966945 0.027281364 0.243927134 0.128613808 0.068516534 0.350152703
#>  [559] 0.088756781 0.101448179 0.218112331 0.124263239 0.163067251 0.074933101
#>  [565] 0.119761911 0.250999324 0.423186761 0.336547554 0.284991926 0.195601432
#>  [571] 0.069323377 0.064403233 0.131732695 0.349723491 0.163153030 0.323422784
#>  [577] 0.546405126 0.038975083 0.042399333 0.161780168 0.459024694 0.276226657
#>  [583] 0.257928185 0.177275217 0.427202265 0.180748199 0.360496336 0.155466049
#>  [589] 0.296519879 0.342439392 0.196062756 0.050485905 0.159852065 0.143156231
#>  [595] 0.310376746 0.268145396 0.433581194 0.234746207 0.064226328 0.141298353
#>  [601] 0.308684540 0.210891954 0.394324829 0.182672702 0.174799318 0.167265144
#>  [607] 0.042708361 0.044607291 0.083625438 0.135435552 0.114978131 0.374896482
#>  [613] 0.233812118 0.352743770 0.039175179 0.140780486 0.264832916 0.097686014
#>  [619] 0.261574531 0.362861999 0.171444597 0.214021780 0.127373236 0.218993795
#>  [625] 0.133776884 0.175640184 0.228523682 0.202690471 0.170839243 0.501247148
#>  [631] 0.438119271 0.259487988 0.054557509 0.103024203 0.124154042 0.181345997
#>  [637] 0.083691046 0.533331307 0.093204746 0.313661955 0.232738847 0.349630046
#>  [643] 0.179708629 0.226779960 0.348432053 0.178602215 0.179584958 0.441810579
#>  [649] 0.180761378 0.145062021 0.346322386 0.119965904 0.204862545 0.061692667
#>  [655] 0.205830266 0.078430627 0.106928421 0.545186477 0.427450621 0.357149072
#>  [661] 0.459020294 0.100656190 0.341531250 0.501528753 0.073790399 0.122026900
#>  [667] 0.159158056 0.269382212 0.199349603 0.035733285 0.067237684 0.202616185
#>  [673] 0.212539968 0.411062342 0.267070601 0.252051280 0.247967898 0.145245273
#>  [679] 0.149431327 0.353115377 0.172875526 0.105606192 0.136726921 0.111032972
#>  [685] 0.171566203 0.373065734 0.245202508 0.302734970 0.217660054 0.112582195
#>  [691] 0.462784385 0.292365806 0.203773673 0.158942730 0.177543022 0.257609833
#>  [697] 0.270832313 0.406125744 0.051166209 0.159308448 0.544706579 0.493730260
#>  [703] 0.583232724 0.251396226 0.163491003 0.403611898 0.086788160 0.285636628
#>  [709] 0.441684008 0.192788493 0.316829254 0.328221836 0.490163493 0.466497375
#>  [715] 0.232592536 0.182319803 0.571460424 0.416002474 0.095719244 0.289738991
#>  [721] 0.340631109 0.187395368 0.235255122 0.151273269 0.203039611 0.466681049
#>  [727] 0.190319942 0.497400816 0.365003954 0.131205786 0.166211758 0.159367598
#>  [733] 0.076851021 0.076357970 0.037310242 0.093839676 0.262475367 0.372149556
#>  [739] 0.406652577 0.289868810 0.388802387 0.189637098 0.101895784 0.151725391
#>  [745] 0.208384911 0.113014812 0.276074261 0.322790008 0.270445711 0.369440764
#>  [751] 0.412338620 0.569336778 0.171880234 0.083766528 0.148938300 0.105216420
#>  [757] 0.261439966 0.291863584 0.212756106 0.190642602 0.263050496 0.200888250
#>  [763] 0.109945457 0.218267366 0.428561187 0.487573364 0.178583277 0.255460733
#>  [769] 0.180511940 0.151133341 0.125054488 0.262028279 0.409445066 0.289335771
#>  [775] 0.321979123 0.150632973 0.539714549 0.064074507 0.206265752 0.049118818
#>  [781] 0.309509703 0.361805014 0.173625436 0.270636315 0.197386953 0.147770818
#>  [787] 0.368476021 0.156599347 0.254839271 0.252688458 0.395529067 0.366940813
#>  [793] 0.423348925 0.166648747 0.139949667 0.177709229 0.135939638 0.122387745
#>  [799] 0.190666401 0.316224748 0.059507222 0.189043692 0.520790634 0.499659460
#>  [805] 0.238836879 0.572591248 0.334186946 0.288807239 0.116190952 0.376210453
#>  [811] 0.441656929 0.111321350 0.318310687 0.447904511 0.551563088 0.369673849
#>  [817] 0.272783302 0.114044444 0.100160611 0.156044448 0.136928501 0.252906330
#>  [823] 0.371841275 0.479561327 0.175727632 0.334240658 0.076030523 0.079889211
#>  [829] 0.248660671 0.307864216 0.269010645 0.145147284 0.203066869 0.144974044
#>  [835] 0.070615320 0.194224316 0.111424560 0.082453416 0.307887659 0.176745277
#>  [841] 0.214290622 0.126119582 0.285614930 0.196618420 0.069036141 0.148543763
#>  [847] 0.395920430 0.372983678 0.027722518 0.083101496 0.067703058 0.231079644
#>  [853] 0.181186542 0.293535180 0.079777508 0.397929232 0.132552877 0.363562624
#>  [859] 0.263807534 0.194666081 0.047991842 0.022863295 0.146393861 0.107740775
#>  [865] 0.032607934 0.105148072 0.219225270 0.121794262 0.272109949 0.045376896
#>  [871] 0.072207800 0.282399011 0.267859296 0.212970753 0.252271515 0.214541925
#>  [877] 0.122075253 0.647702992 0.717759568 0.313147940 0.515020082 0.498639415
#>  [883] 0.327476307 0.448558667 0.229411832 0.102035487 0.324369250 0.186938460
#>  [889] 0.282676415 0.197088729 0.412359766 0.081073287 0.214109573 0.181681857
#>  [895] 0.420596452 0.125866859 0.056525038 0.069142613 0.056169318 0.019485073
#>  [901] 0.157103343 0.150544545 0.512704296 0.180485706 0.123971555 0.101419033
#>  [907] 0.290324332 0.025453129 0.056577726 0.075428916 0.071857671 0.412966943
#>  [913] 0.235108199 0.165313645 0.175682136 0.348759734 0.093126925 0.220646418
#>  [919] 0.173128252 0.391091793 0.261004505 0.273001801 0.392142863 0.046017923
#>  [925] 0.060181062 0.104791551 0.317986494 0.153635329 0.275279085 0.164231166
#>  [931] 0.064290056 0.075348407 0.206823129 0.243494815 0.179328517 0.302135825
#>  [937] 0.131806620 0.022512993 0.027030676 0.265964954 0.383899127 0.393545475
#>  [943] 0.399462795 0.348596885 0.189033454 0.394060374 0.103698293 0.129019642
#>  [949] 0.267481316 0.456338712 0.276513832 0.321620778 0.258222374 0.309822335
#>  [955] 0.325102082 0.117626528 0.223805402 0.210168319 0.094578891 0.213771190
#>  [961] 0.083460683 0.398392920 0.415611705 0.213888145 0.276878434 0.266973570
#>  [967] 0.317809253 0.154472234 0.421406250 0.540392757 0.172792191 0.175501280
#>  [973] 0.231690989 0.235000682 0.191426875 0.319863177 0.369781056 0.100408698
#>  [979] 0.654082105 0.356148718 0.341046771 0.431456652 0.212135070 0.437940238
#>  [985] 0.150537365 0.164668829 0.068531825 0.173712385 0.109318357 0.113607007
#>  [991] 0.085587351 0.089362310 0.379258313 0.203533874 0.118788562 0.385731706
#>  [997] 0.049409091 0.103686762 0.306884044 0.063717767