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.105327119 0.493468142 0.336792808 0.110747286 0.043272928 0.068979637
#>    [7] 0.096206328 0.062210048 0.040770182 0.025681798 0.272240569 0.159944236
#>   [13] 0.184740213 0.274381975 0.180737783 0.238960532 0.148292489 0.081820731
#>   [19] 0.094993083 0.330380897 0.649229925 0.559564374 0.131428973 0.156697535
#>   [25] 0.118333077 0.337695208 0.167623621 0.227091349 0.134195482 0.253926427
#>   [31] 0.152779672 0.077458253 0.057523006 0.145462471 0.285036650 0.208005813
#>   [37] 0.151171032 0.435635008 0.481959467 0.144514056 0.094567711 0.272310388
#>   [43] 0.183592420 0.157342800 0.430083379 0.373564568 0.194652775 0.194140348
#>   [49] 0.312701129 0.447957468 0.258028707 0.461668995 0.361142674 0.206533854
#>   [55] 0.453703502 0.392775456 0.639065475 0.334732645 0.282171312 0.277464650
#>   [61] 0.240842926 0.279966564 0.538063061 0.580103115 0.169442959 0.327149236
#>   [67] 0.094704353 0.446157357 0.218528150 0.115205238 0.073038067 0.043895557
#>   [73] 0.389142587 0.047822819 0.120477802 0.399970875 0.322678579 0.209595794
#>   [79] 0.393183842 0.260918503 0.564407219 0.285180229 0.381362657 0.102697449
#>   [85] 0.350276971 0.460664233 0.085174897 0.564563956 0.072123588 0.135108076
#>   [91] 0.098578949 0.263849035 0.132911303 0.134986290 0.059030548 0.094981314
#>   [97] 0.025225685 0.076832128 0.077201572 0.282189097 0.043644383 0.245154103
#>  [103] 0.185204356 0.247352135 0.321925946 0.105056073 0.101177411 0.124737097
#>  [109] 0.205127215 0.051903212 0.362967308 0.356345881 0.162769919 0.363975925
#>  [115] 0.148297062 0.107604276 0.240152686 0.526535080 0.129228864 0.100011554
#>  [121] 0.679607631 0.111318131 0.296700473 0.429381902 0.365333140 0.152871251
#>  [127] 0.135080710 0.377221259 0.174149963 0.085044256 0.090095835 0.330565934
#>  [133] 0.212706925 0.308037134 0.172525350 0.174790835 0.036184079 0.067631561
#>  [139] 0.131887851 0.141695287 0.246937003 0.291543595 0.610320068 0.222998948
#>  [145] 0.089577210 0.442820302 0.400561068 0.055655632 0.088719487 0.354162925
#>  [151] 0.472501010 0.217766287 0.334293924 0.154039399 0.162103107 0.234473211
#>  [157] 0.231591652 0.301327619 0.293009910 0.095222279 0.545559010 0.349098674
#>  [163] 0.225194280 0.360760659 0.139841827 0.192713364 0.093427920 0.473288691
#>  [169] 0.293347043 0.355908867 0.182026600 0.155051034 0.118692138 0.401131626
#>  [175] 0.228781982 0.158225827 0.134845561 0.103448695 0.373418029 0.069705410
#>  [181] 0.265380996 0.146669399 0.253457984 0.222531088 0.335751190 0.239598332
#>  [187] 0.043655864 0.177457507 0.436845667 0.293391015 0.270191393 0.306116897
#>  [193] 0.327188848 0.431951691 0.202036744 0.132243044 0.156605962 0.283816766
#>  [199] 0.284953646 0.089602750 0.032694159 0.163476444 0.108989464 0.157409876
#>  [205] 0.110674570 0.245289216 0.611212589 0.695866998 0.359260954 0.578009337
#>  [211] 0.156646504 0.448154758 0.213996238 0.477921227 0.233296087 0.177144593
#>  [217] 0.250341031 0.241795363 0.278658443 0.477749241 0.269135587 0.185188461
#>  [223] 0.249604923 0.502524870 0.284898715 0.222772664 0.395052976 0.373458186
#>  [229] 0.243318419 0.148716891 0.275329475 0.125888021 0.244163308 0.247693825
#>  [235] 0.408700781 0.283563510 0.232240498 0.171284136 0.149641717 0.389716482
#>  [241] 0.376384931 0.117039456 0.125602955 0.044501298 0.060932117 0.185085115
#>  [247] 0.540925715 0.406786681 0.197345395 0.176836712 0.251254106 0.082582226
#>  [253] 0.240203697 0.231601665 0.173851748 0.124474643 0.141648960 0.100740619
#>  [259] 0.408013155 0.121794988 0.342331852 0.160230817 0.067785132 0.221001683
#>  [265] 0.124541817 0.122787863 0.324415198 0.432753539 0.361235851 0.357038978
#>  [271] 0.077562151 0.437425796 0.208978320 0.293294993 0.157369559 0.122592380
#>  [277] 0.288634226 0.365212609 0.288923084 0.241497267 0.206225738 0.155086669
#>  [283] 0.289004008 0.343215590 0.425235308 0.280860745 0.393485675 0.395004905
#>  [289] 0.138643020 0.250758026 0.116427007 0.105861134 0.115050112 0.130561108
#>  [295] 0.179118222 0.207022407 0.345347860 0.323059386 0.255404811 0.665967652
#>  [301] 0.477201024 0.506876172 0.442367700 0.395072069 0.322956189 0.230812510
#>  [307] 0.127630965 0.063853402 0.060309729 0.073053282 0.305055594 0.247264944
#>  [313] 0.396850813 0.226421723 0.233817866 0.136136837 0.143844559 0.258770188
#>  [319] 0.190951146 0.141701513 0.178962373 0.391736204 0.319857489 0.126810423
#>  [325] 0.240680496 0.313952046 0.656552481 0.205304603 0.306489661 0.279984300
#>  [331] 0.425749229 0.361660404 0.297087752 0.330184696 0.435708340 0.436193009
#>  [337] 0.147113206 0.379929279 0.207138888 0.047261956 0.073958828 0.135410335
#>  [343] 0.296754114 0.370021705 0.131211049 0.224332293 0.119506469 0.174754762
#>  [349] 0.269392962 0.081327275 0.084317832 0.474615754 0.159538055 0.421976347
#>  [355] 0.154585278 0.304425810 0.160631369 0.222050756 0.105502358 0.022502723
#>  [361] 0.009590296 0.089566399 0.292036524 0.132358683 0.525329050 0.341292962
#>  [367] 0.157704381 0.232068626 0.101403724 0.077529617 0.054998300 0.080166455
#>  [373] 0.229327867 0.154584325 0.318734648 0.291800346 0.162632997 0.409653250
#>  [379] 0.367995350 0.131681288 0.230192465 0.237197558 0.051122047 0.114955766
#>  [385] 0.493162632 0.312810369 0.255027904 0.168335242 0.245829854 0.378127697
#>  [391] 0.152568267 0.113266200 0.260214567 0.224593408 0.545660266 0.196062008
#>  [397] 0.029560859 0.323966276 0.220536224 0.244759818 0.154447386 0.105976088
#>  [403] 0.585051306 0.619359826 0.333748926 0.242310577 0.150647668 0.180787273
#>  [409] 0.203923176 0.087243568 0.021660490 0.170598643 0.406093734 0.124527708
#>  [415] 0.297166575 0.121036018 0.055773165 0.129626281 0.226323599 0.384860762
#>  [421] 0.304580069 0.121474315 0.126589480 0.053299364 0.145741699 0.293671833
#>  [427] 0.223451311 0.049171280 0.281866177 0.089055058 0.221074278 0.133410161
#>  [433] 0.092395066 0.410828693 0.236178558 0.130259194 0.757180663 0.758263877
#>  [439] 0.248945496 0.289712870 0.081707053 0.151834590 0.075450185 0.292705506
#>  [445] 0.401178491 0.202780606 0.328908036 0.498967921 0.176960114 0.250826375
#>  [451] 0.401936262 0.116172719 0.449806477 0.415829344 0.183723292 0.164471990
#>  [457] 0.175847216 0.212074010 0.190213835 0.271536803 0.205701145 0.242472396
#>  [463] 0.331317704 0.294123422 0.100145850 0.352052740 0.070627086 0.431833333
#>  [469] 0.154556802 0.266400263 0.053333764 0.130302515 0.100919566 0.241604906
#>  [475] 0.354068506 0.268045771 0.145421183 0.406285053 0.353683204 0.204971937
#>  [481] 0.112251356 0.203216854 0.218113533 0.143403242 0.309068246 0.563085025
#>  [487] 0.260656651 0.489306288 0.064989728 0.111692047 0.301306763 0.047775184
#>  [493] 0.090231655 0.088940879 0.304915583 0.044495544 0.110459507 0.160195632
#>  [499] 0.070000591 0.153593663 0.224359626 0.317136590 0.454008300 0.047739731
#>  [505] 0.385836999 0.262448667 0.330222949 0.304175330 0.144406340 0.124762950
#>  [511] 0.292439808 0.380868216 0.129583399 0.433083204 0.172112767 0.248291210
#>  [517] 0.363542812 0.164179910 0.106078850 0.140794903 0.127291787 0.177643820
#>  [523] 0.382500321 0.517327394 0.316234371 0.222147145 0.100407534 0.459251042
#>  [529] 0.544244263 0.275990919 0.338506667 0.098829073 0.195826405 0.413549691
#>  [535] 0.064289415 0.071854662 0.142795282 0.275569982 0.365473820 0.120581787
#>  [541] 0.359693809 0.250169979 0.247311572 0.237216500 0.099483507 0.112947298
#>  [547] 0.050016762 0.138462395 0.450241527 0.299169969 0.429920146 0.217709891
#>  [553] 0.194102997 0.376979642 0.055743077 0.150945082 0.285240631 0.487684450
#>  [559] 0.219834310 0.222982887 0.246195191 0.436259593 0.089142473 0.235990733
#>  [565] 0.299828644 0.155440832 0.120792931 0.071552489 0.527929587 0.067862395
#>  [571] 0.189388048 0.534397856 0.367646872 0.319869912 0.456848014 0.596152083
#>  [577] 0.251770910 0.268784612 0.280174787 0.147908865 0.257375547 0.361535235
#>  [583] 0.258233806 0.266553397 0.268813510 0.179183042 0.378054961 0.171997816
#>  [589] 0.492823637 0.491647592 0.095133451 0.218231571 0.344125567 0.074886903
#>  [595] 0.192663838 0.179172761 0.439129681 0.427346748 0.203256417 0.257473109
#>  [601] 0.522213604 0.490824493 0.315152681 0.295838163 0.233397584 0.394710709
#>  [607] 0.364692869 0.204867381 0.179360765 0.233570174 0.462237036 0.138293300
#>  [613] 0.137739213 0.179619647 0.247478221 0.075221476 0.370558337 0.242518557
#>  [619] 0.062697134 0.055521990 0.124440389 0.018252989 0.028981864 0.181176824
#>  [625] 0.285871784 0.551541922 0.203351966 0.171151545 0.252696499 0.425286764
#>  [631] 0.080819290 0.024873271 0.013405699 0.008844255 0.007658884 0.144063535
#>  [637] 0.201935126 0.131588222 0.079055166 0.173124168 0.060314149 0.388668443
#>  [643] 0.426091235 0.209265995 0.281324678 0.174691786 0.056671764 0.130266881
#>  [649] 0.218129953 0.196334828 0.063612506 0.191878070 0.413594927 0.728029738
#>  [655] 0.697970699 0.237785139 0.507565636 0.214384746 0.255752948 0.391255312
#>  [661] 0.337651017 0.092242705 0.079195431 0.326963372 0.409592820 0.129703381
#>  [667] 0.263470636 0.242530301 0.125470292 0.304961328 0.158742996 0.115982106
#>  [673] 0.048005458 0.431212755 0.066029648 0.192360323 0.296093231 0.227897478
#>  [679] 0.049355353 0.354870624 0.193961268 0.161642237 0.187448677 0.149942501
#>  [685] 0.169156780 0.161633841 0.069607899 0.207510351 0.235691339 0.672645203
#>  [691] 0.587502243 0.425327650 0.059335797 0.012098688 0.081261345 0.295391343
#>  [697] 0.455178915 0.085992818 0.088578011 0.416954710 0.187828351 0.180937712
#>  [703] 0.457848024 0.459119036 0.299944164 0.143405030 0.108476089 0.167980319
#>  [709] 0.299388561 0.212404459 0.152904077 0.138043239 0.514367232 0.210782636
#>  [715] 0.058022419 0.017142076 0.144020102 0.094630936 0.288072318 0.176065198
#>  [721] 0.251930982 0.294887107 0.142913792 0.044028088 0.148192201 0.281397289
#>  [727] 0.208336880 0.316751851 0.321120143 0.417999830 0.305499085 0.311019815
#>  [733] 0.243415797 0.152076426 0.263427852 0.204509558 0.202562835 0.474575886
#>  [739] 0.170255178 0.073335164 0.492375839 0.207927738 0.133352941 0.258136736
#>  [745] 0.171020879 0.154785565 0.335123535 0.321655857 0.371280682 0.366082834
#>  [751] 0.245370733 0.200631757 0.309732774 0.321273425 0.574054940 0.635437791
#>  [757] 0.190800347 0.232435906 0.381484637 0.161185057 0.117082784 0.303451994
#>  [763] 0.040394381 0.328713782 0.397452552 0.261501356 0.634679843 0.248599152
#>  [769] 0.211678791 0.398419781 0.562918567 0.235303779 0.118301947 0.120891228
#>  [775] 0.329355974 0.198349139 0.331720239 0.344683132 0.288939550 0.251675643
#>  [781] 0.313339824 0.118921469 0.282780534 0.183278461 0.075046672 0.363187328
#>  [787] 0.047312533 0.145660363 0.234112896 0.277521900 0.385664942 0.259150002
#>  [793] 0.247306704 0.230426974 0.174204638 0.158950590 0.049770628 0.421447597
#>  [799] 0.418653907 0.187635615 0.199609661 0.452429504 0.147043939 0.155215997
#>  [805] 0.263760582 0.200092049 0.306782794 0.074839816 0.115250096 0.099899549
#>  [811] 0.160347769 0.078456727 0.078809177 0.083750894 0.379949201 0.183969927
#>  [817] 0.124369901 0.182569275 0.068939036 0.303011927 0.219272298 0.048102225
#>  [823] 0.157475584 0.171692634 0.459326119 0.090279698 0.093834094 0.224985330
#>  [829] 0.195444608 0.222460090 0.273600372 0.220261135 0.446650570 0.137021425
#>  [835] 0.042223508 0.067831383 0.139609571 0.105857749 0.039188955 0.111001257
#>  [841] 0.155101658 0.174796118 0.052703166 0.166682418 0.750377642 0.119653980
#>  [847] 0.359832202 0.313601896 0.189791153 0.126084145 0.136215824 0.173443410
#>  [853] 0.222001937 0.165518827 0.308113002 0.297528764 0.235303607 0.144271038
#>  [859] 0.406463092 0.018143852 0.247103045 0.206849235 0.459630715 0.482817160
#>  [865] 0.522120403 0.216627678 0.060507963 0.537569291 0.485049089 0.087746711
#>  [871] 0.188035511 0.559949895 0.071361757 0.267968930 0.141590259 0.379599596
#>  [877] 0.029860827 0.021306213 0.039910030 0.087053280 0.198256557 0.514835139
#>  [883] 0.139779504 0.156501495 0.445311258 0.571986064 0.336496605 0.266886006
#>  [889] 0.155068813 0.075816324 0.103199319 0.085006311 0.537197607 0.166571596
#>  [895] 0.213183638 0.181849289 0.338454931 0.248194166 0.094622159 0.234818520
#>  [901] 0.139503625 0.205105902 0.190538277 0.098685999 0.136969452 0.410671494
#>  [907] 0.304237977 0.304323988 0.156767012 0.398446902 0.205485668 0.222377288
#>  [913] 0.181644219 0.219943775 0.262780538 0.079023184 0.098059188 0.172671111
#>  [919] 0.164724399 0.253107012 0.102926068 0.211428537 0.419696098 0.293215014
#>  [925] 0.151453581 0.150755994 0.309375133 0.218006569 0.121838807 0.103767232
#>  [931] 0.086103088 0.042678753 0.451980601 0.231996525 0.344627794 0.227969013
#>  [937] 0.241301709 0.070911335 0.043470454 0.209253355 0.119213282 0.209489700
#>  [943] 0.496371228 0.299923305 0.176881762 0.286250190 0.362192423 0.394009914
#>  [949] 0.128125086 0.151229502 0.026152895 0.186989575 0.338330656 0.186735170
#>  [955] 0.218985751 0.486481669 0.095718618 0.091983677 0.088683998 0.043129560
#>  [961] 0.051289224 0.048220951 0.013207078 0.074091086 0.218943048 0.292053137
#>  [967] 0.184186939 0.215726445 0.415680584 0.154762812 0.285548196 0.266397771
#>  [973] 0.129747894 0.051322455 0.042666770 0.289434157 0.401250649 0.330361840
#>  [979] 0.245377987 0.308922171 0.132614564 0.082359211 0.044137196 0.144036293
#>  [985] 0.368262347 0.097264352 0.166659133 0.302631385 0.105948693 0.525806672
#>  [991] 0.364036669 0.161645439 0.074920118 0.050989384 0.419984167 0.305141939
#>  [997] 0.334814846 0.346818178 0.112138678 0.442534251