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.220268321 0.171206930 0.134595406 0.226823973 0.062977157 0.510408531
#>    [7] 0.100153327 0.641290840 0.249084820 0.029341598 0.062558552 0.054927698
#>   [13] 0.027735315 0.588058138 0.201661793 0.099022755 0.221524746 0.337590596
#>   [19] 0.077810951 0.075763783 0.257622525 0.081323211 0.209127172 0.134619590
#>   [25] 0.159544846 0.122486065 0.358412088 0.055536351 0.078110269 0.175681338
#>   [31] 0.204220532 0.140957632 0.243848425 0.367090683 0.351476286 0.261120790
#>   [37] 0.317186163 0.133610627 0.162231361 0.253140276 0.292705633 0.207604519
#>   [43] 0.570167555 0.307209958 0.067351427 0.036252994 0.069593618 0.067847676
#>   [49] 0.191951755 0.217137432 0.083274845 0.054142606 0.088345342 0.125160474
#>   [55] 0.158550063 0.226046524 0.099969729 0.054075039 0.229619918 0.106777967
#>   [61] 0.253250543 0.399002040 0.177743719 0.167937197 0.048343618 0.123907572
#>   [67] 0.277946441 0.363430403 0.527880391 0.673547721 0.086475630 0.298278479
#>   [73] 0.072221008 0.124798193 0.227698340 0.573877132 0.576824054 0.425132229
#>   [79] 0.463071830 0.295258870 0.330080370 0.318914714 0.351192003 0.357466153
#>   [85] 0.280965359 0.365265164 0.367706228 0.276602147 0.084898382 0.209445075
#>   [91] 0.122766964 0.167098433 0.091627232 0.266698786 0.066036161 0.083790538
#>   [97] 0.207697954 0.367193561 0.113695862 0.140423342 0.393191515 0.105244712
#>  [103] 0.231103968 0.131201216 0.028028261 0.110581518 0.147761456 0.209491784
#>  [109] 0.031589043 0.042415187 0.031407538 0.392539929 0.182832054 0.255397326
#>  [115] 0.313286029 0.198323400 0.391524688 0.281252192 0.126956474 0.330137084
#>  [121] 0.330609714 0.087937078 0.251679184 0.294679493 0.173719293 0.184587813
#>  [127] 0.296874907 0.106399331 0.096284753 0.207014351 0.076046373 0.566207548
#>  [133] 0.259616993 0.290535683 0.253755493 0.259708204 0.290939113 0.249783782
#>  [139] 0.345602810 0.094031078 0.048415671 0.173804694 0.090894287 0.164078420
#>  [145] 0.078449031 0.264427150 0.192752646 0.136585513 0.239668342 0.089210102
#>  [151] 0.107809535 0.149096717 0.046246337 0.134455590 0.163927183 0.662113083
#>  [157] 0.404741733 0.090983874 0.194445133 0.153833553 0.087830847 0.443193495
#>  [163] 0.632231331 0.204502159 0.279767733 0.111159868 0.465215085 0.151313915
#>  [169] 0.324293952 0.248491065 0.460782995 0.539113715 0.347662022 0.271831008
#>  [175] 0.537553599 0.259387658 0.166196388 0.026113620 0.075308280 0.129684923
#>  [181] 0.235901416 0.396388734 0.235470097 0.308187191 0.201980656 0.411966043
#>  [187] 0.373271893 0.201814175 0.279301365 0.392002589 0.185673660 0.225866696
#>  [193] 0.517573125 0.244521468 0.209856883 0.239889332 0.147177608 0.192976513
#>  [199] 0.290481164 0.287208856 0.132929024 0.187886629 0.369327847 0.368642298
#>  [205] 0.327525926 0.570373030 0.263722259 0.427751204 0.088620458 0.206420351
#>  [211] 0.030392241 0.409111619 0.134592640 0.180018707 0.149019630 0.072874489
#>  [217] 0.139871329 0.212218249 0.443952634 0.126793745 0.061603033 0.038019562
#>  [223] 0.032479244 0.042837242 0.038264596 0.018292837 0.077481387 0.015200713
#>  [229] 0.044884281 0.112661879 0.060988821 0.396353931 0.281577454 0.139622155
#>  [235] 0.455660647 0.610139395 0.420297050 0.216286061 0.188056616 0.098471944
#>  [241] 0.185283617 0.210416863 0.285783514 0.286803633 0.574354922 0.273878981
#>  [247] 0.153533021 0.334031289 0.363507148 0.262085418 0.549526532 0.270689172
#>  [253] 0.232418689 0.214711767 0.068161695 0.085846907 0.103257301 0.012791658
#>  [259] 0.075853758 0.162514850 0.336535605 0.439508576 0.423769717 0.625717292
#>  [265] 0.239199945 0.495104037 0.039166157 0.197966789 0.378123210 0.105390865
#>  [271] 0.278831074 0.199065514 0.061637699 0.032762026 0.030934002 0.156745803
#>  [277] 0.450366411 0.256909294 0.331835821 0.283443964 0.156854409 0.236824566
#>  [283] 0.155787228 0.253459006 0.465844400 0.422557695 0.100991512 0.136588621
#>  [289] 0.291968921 0.231431759 0.144824746 0.125089581 0.228816247 0.253844774
#>  [295] 0.270127532 0.233887735 0.459596860 0.249978827 0.109769437 0.337218433
#>  [301] 0.366151858 0.125350207 0.252187758 0.209089569 0.063871972 0.137372071
#>  [307] 0.074711050 0.137931198 0.261235886 0.209921608 0.135518609 0.308139088
#>  [313] 0.296642677 0.251053451 0.321172980 0.291046244 0.237520597 0.287639984
#>  [319] 0.207669567 0.376547701 0.244421946 0.066730060 0.218843316 0.157413798
#>  [325] 0.394425671 0.181622171 0.552508265 0.338784407 0.273269481 0.061372348
#>  [331] 0.130684222 0.296740611 0.169108937 0.406782001 0.216408104 0.353716776
#>  [337] 0.494900947 0.159192672 0.250405872 0.163298271 0.318545176 0.278319639
#>  [343] 0.227996826 0.469338834 0.310676671 0.265035096 0.292965984 0.423942781
#>  [349] 0.198387250 0.285605350 0.282033759 0.266770344 0.265156326 0.132284388
#>  [355] 0.373979511 0.399822599 0.245196821 0.150136835 0.130885176 0.233156874
#>  [361] 0.202711411 0.259521126 0.081809488 0.197726897 0.314613118 0.258985579
#>  [367] 0.009822252 0.172111589 0.343690471 0.142771805 0.294007307 0.500115433
#>  [373] 0.317570703 0.366144457 0.226980767 0.102077192 0.098323844 0.040005534
#>  [379] 0.024108591 0.617040973 0.459608513 0.077932632 0.080821258 0.257543412
#>  [385] 0.173435957 0.296608403 0.374159051 0.100169078 0.120882220 0.026998706
#>  [391] 0.043377556 0.170314241 0.419683817 0.298708857 0.121182313 0.171232889
#>  [397] 0.179858240 0.160435184 0.083558393 0.122810178 0.175523329 0.475559291
#>  [403] 0.091381695 0.240073948 0.496468733 0.414002941 0.175220763 0.407250914
#>  [409] 0.343099815 0.126209446 0.225918829 0.139912702 0.106180703 0.061730569
#>  [415] 0.251492723 0.137212555 0.189966839 0.222972442 0.273206035 0.197844993
#>  [421] 0.124947395 0.088773840 0.125767223 0.137400637 0.297350837 0.088458554
#>  [427] 0.134213833 0.169731404 0.184904428 0.137416101 0.129287639 0.103442666
#>  [433] 0.075157950 0.222918179 0.167481918 0.133037374 0.037930393 0.563082874
#>  [439] 0.415226850 0.103244632 0.109196604 0.157009000 0.218368978 0.466498722
#>  [445] 0.287725362 0.247623660 0.419422344 0.357772689 0.158301017 0.215961725
#>  [451] 0.333078942 0.165611102 0.375188359 0.088978524 0.173993158 0.159832693
#>  [457] 0.236169923 0.227267251 0.205784358 0.337094644 0.157460493 0.155037497
#>  [463] 0.284594204 0.052699658 0.155372683 0.279798518 0.252120682 0.085505769
#>  [469] 0.433818109 0.141519873 0.441039802 0.551749507 0.430855167 0.690567894
#>  [475] 0.665352577 0.264527155 0.062358549 0.072016573 0.143164228 0.324896740
#>  [481] 0.178935016 0.342996682 0.130946182 0.402056813 0.264407744 0.038376725
#>  [487] 0.054585937 0.061660438 0.634397575 0.174879412 0.054052449 0.442468028
#>  [493] 0.394598402 0.183331682 0.155669608 0.199698589 0.055253443 0.119305614
#>  [499] 0.085190848 0.474472961 0.565676520 0.254778191 0.086273435 0.186998895
#>  [505] 0.326933250 0.491644739 0.232848775 0.059813742 0.050820107 0.068396044
#>  [511] 0.420134842 0.390454254 0.198434416 0.074412410 0.375630717 0.162504969
#>  [517] 0.596668098 0.491032896 0.269315512 0.310360284 0.324603654 0.250547249
#>  [523] 0.394294689 0.468538863 0.451055338 0.257348772 0.109071340 0.364602466
#>  [529] 0.321820437 0.129296770 0.149793057 0.039087517 0.017552968 0.008840833
#>  [535] 0.145987493 0.106111339 0.052165031 0.067549901 0.186568300 0.166728173
#>  [541] 0.299636214 0.251269248 0.125185669 0.562132080 0.177628222 0.270640351
#>  [547] 0.102962487 0.597041476 0.179946196 0.194136192 0.090418895 0.249849362
#>  [553] 0.145529078 0.046179496 0.239646675 0.235869296 0.109852815 0.104819704
#>  [559] 0.387177258 0.283401313 0.217460117 0.200474030 0.237542214 0.618716976
#>  [565] 0.205718159 0.704855884 0.540580708 0.303655462 0.495402141 0.233049176
#>  [571] 0.060290668 0.217275938 0.243059607 0.038222293 0.177458608 0.381401200
#>  [577] 0.159409188 0.143749377 0.250340827 0.208976710 0.207955820 0.206312182
#>  [583] 0.213583562 0.540956326 0.385364222 0.299335873 0.285609261 0.328365238
#>  [589] 0.166521281 0.226398438 0.274863072 0.340448747 0.345522235 0.298008660
#>  [595] 0.183007995 0.311929435 0.176864196 0.457154805 0.156566676 0.133585627
#>  [601] 0.513439770 0.162147131 0.112523608 0.404046567 0.116022483 0.095873464
#>  [607] 0.070780870 0.454241499 0.147251768 0.309192850 0.562863999 0.448913619
#>  [613] 0.333874677 0.203860252 0.218173837 0.619720252 0.477693413 0.275326011
#>  [619] 0.419091972 0.126714012 0.344057584 0.257295688 0.170217967 0.322661562
#>  [625] 0.166792676 0.158031233 0.261681592 0.280282703 0.271452669 0.103905593
#>  [631] 0.338579895 0.326963422 0.363645609 0.299964445 0.027299320 0.367099358
#>  [637] 0.338612602 0.066876097 0.052234453 0.236876045 0.258167548 0.264341124
#>  [643] 0.120220074 0.049887875 0.094634268 0.131027310 0.026633625 0.025668094
#>  [649] 0.155926457 0.083783344 0.184125163 0.285450909 0.273249571 0.258677586
#>  [655] 0.120539965 0.095313199 0.062258362 0.155808229 0.408373105 0.310009932
#>  [661] 0.060056929 0.378059238 0.423707745 0.535146728 0.235008319 0.052107810
#>  [667] 0.067679888 0.137821053 0.209428508 0.153785477 0.476474007 0.271802508
#>  [673] 0.031386018 0.043716292 0.259611243 0.341597884 0.177450325 0.274744565
#>  [679] 0.267050838 0.306216757 0.302287679 0.314960477 0.445653349 0.050095943
#>  [685] 0.063251853 0.193830633 0.044108738 0.622923688 0.088634678 0.422126370
#>  [691] 0.154998669 0.207764497 0.301450952 0.387923169 0.164755437 0.121322811
#>  [697] 0.386639887 0.307954342 0.085764553 0.192625038 0.098909927 0.256449950
#>  [703] 0.211958473 0.171719689 0.136085996 0.190278187 0.201618946 0.080539002
#>  [709] 0.268244138 0.125763643 0.253666108 0.410013509 0.228266344 0.267899696
#>  [715] 0.268708974 0.224587698 0.395758313 0.443279134 0.126713275 0.120680529
#>  [721] 0.433982889 0.269983903 0.120340285 0.051119471 0.076333415 0.383634032
#>  [727] 0.226377163 0.147683252 0.278810589 0.107244584 0.165388042 0.376035347
#>  [733] 0.426955229 0.461699033 0.285010287 0.118438804 0.047384490 0.090100230
#>  [739] 0.096594271 0.278481111 0.207843176 0.445924677 0.503959143 0.161555468
#>  [745] 0.196493614 0.172392676 0.214259257 0.073790253 0.309586337 0.122493319
#>  [751] 0.117005900 0.108823723 0.116390683 0.263772483 0.224298048 0.185556239
#>  [757] 0.335900540 0.230230471 0.619722001 0.175368405 0.344511631 0.610375646
#>  [763] 0.252474210 0.397999323 0.387248607 0.800617386 0.626737648 0.374106507
#>  [769] 0.267941433 0.239162493 0.169649433 0.531670216 0.490964392 0.128068392
#>  [775] 0.088460652 0.343096449 0.476736028 0.172619594 0.109150842 0.388694721
#>  [781] 0.417257119 0.246073373 0.266271581 0.120470729 0.204456199 0.395354873
#>  [787] 0.373063535 0.327961415 0.186019457 0.445478957 0.318772932 0.199713199
#>  [793] 0.113718660 0.212700547 0.116106176 0.112279372 0.238086486 0.146705546
#>  [799] 0.342446667 0.503423055 0.074490371 0.063080430 0.290129553 0.093874184
#>  [805] 0.211888862 0.386436324 0.269164100 0.123865945 0.050756281 0.590610859
#>  [811] 0.421864179 0.160542104 0.145068211 0.133168710 0.359137320 0.077517180
#>  [817] 0.109215226 0.055308426 0.045202415 0.091398677 0.064583227 0.072213525
#>  [823] 0.265920749 0.186009655 0.300711061 0.257351966 0.188091657 0.033574356
#>  [829] 0.025358056 0.097623554 0.441197023 0.473079651 0.440472759 0.100572736
#>  [835] 0.761044830 0.235495066 0.165825045 0.172165884 0.177993467 0.102107994
#>  [841] 0.174985898 0.282079195 0.440929300 0.235481003 0.089274985 0.125803262
#>  [847] 0.147612322 0.421396893 0.230084218 0.223073938 0.096443061 0.091275167
#>  [853] 0.408954752 0.397550862 0.142597689 0.158361957 0.314421956 0.335862629
#>  [859] 0.189438537 0.581804663 0.250298880 0.663170652 0.241628728 0.317557579
#>  [865] 0.331512036 0.204660283 0.166320164 0.142929843 0.259584788 0.356049995
#>  [871] 0.065115270 0.042114869 0.113734695 0.312214297 0.144731456 0.285280616
#>  [877] 0.186354121 0.163059682 0.140734854 0.091939506 0.071754635 0.197170889
#>  [883] 0.269925916 0.318817189 0.127381740 0.080494534 0.131419230 0.210532978
#>  [889] 0.495121205 0.201321212 0.073953772 0.138851662 0.200619410 0.032214944
#>  [895] 0.100474322 0.532514781 0.290491254 0.306005242 0.057969626 0.293773017
#>  [901] 0.042126168 0.365668060 0.228438985 0.109178254 0.473844438 0.320249351
#>  [907] 0.233000664 0.272003452 0.360341728 0.053145569 0.176091897 0.240597129
#>  [913] 0.197367382 0.132726323 0.170660322 0.071095817 0.067344529 0.050099156
#>  [919] 0.040619752 0.042338610 0.175540124 0.315110491 0.138705615 0.446201896
#>  [925] 0.154566454 0.212963343 0.056893136 0.425423338 0.188421448 0.211226121
#>  [931] 0.048735955 0.364100031 0.508405312 0.260443291 0.326209653 0.287399482
#>  [937] 0.471015273 0.395951436 0.553047802 0.144253553 0.408535900 0.475586875
#>  [943] 0.238391210 0.434050371 0.025674754 0.121543871 0.053313767 0.428778803
#>  [949] 0.355301414 0.232278296 0.229026102 0.101441417 0.155972474 0.380331586
#>  [955] 0.243185795 0.312836436 0.436421632 0.421968565 0.229327376 0.457315854
#>  [961] 0.482215150 0.301144984 0.116422335 0.323362299 0.109498598 0.099817469
#>  [967] 0.435361997 0.271963849 0.471299485 0.258486941 0.204382966 0.277330782
#>  [973] 0.115806345 0.214079875 0.445717236 0.035155568 0.023169839 0.148534666
#>  [979] 0.112893234 0.571619776 0.402765526 0.271648885 0.419168299 0.421658398
#>  [985] 0.110869470 0.554115273 0.224510694 0.136618377 0.214920371 0.278868773
#>  [991] 0.512406545 0.239388217 0.231346722 0.313306963 0.370208429 0.330445104
#>  [997] 0.457384093 0.454429803 0.698899018 0.152799352