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.193790791 0.105739360 0.160790615 0.127107733 0.147849968 0.338861437
#>    [7] 0.511522358 0.156009514 0.122848639 0.467263926 0.316249844 0.372705639
#>   [13] 0.459543266 0.251102145 0.399648749 0.053398000 0.252790103 0.338803663
#>   [19] 0.139431068 0.179717338 0.423755003 0.218667615 0.273049730 0.413820687
#>   [25] 0.198598311 0.291866756 0.440707136 0.174939551 0.242466547 0.119786434
#>   [31] 0.261156017 0.219580632 0.411063777 0.252586268 0.077663367 0.394423086
#>   [37] 0.466881340 0.382666243 0.335072165 0.529825539 0.288399033 0.382710227
#>   [43] 0.353495532 0.054091221 0.047711291 0.323668483 0.276999042 0.300239506
#>   [49] 0.221330362 0.171415034 0.411800504 0.344900118 0.447910193 0.114206492
#>   [55] 0.218188070 0.338518434 0.375480388 0.282900398 0.129711504 0.421256640
#>   [61] 0.390967053 0.515957670 0.084840243 0.561576022 0.281051819 0.247278150
#>   [67] 0.163932524 0.183401058 0.526397856 0.125698789 0.419477929 0.209256304
#>   [73] 0.115863019 0.451529415 0.486729941 0.408308715 0.190103749 0.281451356
#>   [79] 0.206128332 0.180574853 0.061046020 0.063669145 0.227673609 0.264715050
#>   [85] 0.140514620 0.086573649 0.054988643 0.138145029 0.142512013 0.188680190
#>   [91] 0.720423024 0.126812540 0.407218025 0.464355516 0.429268052 0.222978215
#>   [97] 0.279871833 0.300987478 0.283136942 0.114373569 0.258158641 0.104669051
#>  [103] 0.151320661 0.238451957 0.251406544 0.075188855 0.130268628 0.163711662
#>  [109] 0.028756122 0.581642057 0.510623271 0.142618440 0.229148122 0.171441191
#>  [115] 0.219075522 0.107387614 0.214118108 0.233509659 0.486543218 0.107463753
#>  [121] 0.070939861 0.287810732 0.467340936 0.458327748 0.171363012 0.680668365
#>  [127] 0.287059744 0.178721683 0.205356851 0.165937892 0.127830984 0.055831740
#>  [133] 0.628596727 0.103323095 0.207596752 0.254640001 0.184423963 0.250112632
#>  [139] 0.107679945 0.098855614 0.231555422 0.350634062 0.394230747 0.060610546
#>  [145] 0.071040640 0.098646497 0.100633922 0.135236189 0.264256802 0.057514240
#>  [151] 0.036015175 0.040240866 0.113814826 0.265004789 0.175204822 0.186052548
#>  [157] 0.172028785 0.292353197 0.323884640 0.223882447 0.118947293 0.250597984
#>  [163] 0.090883777 0.157696258 0.028594313 0.173982647 0.088324155 0.357732491
#>  [169] 0.194326359 0.155114313 0.388101678 0.086708047 0.257602612 0.041719860
#>  [175] 0.439575309 0.353675217 0.233161787 0.323532999 0.252682481 0.290569684
#>  [181] 0.146031738 0.418367150 0.141544751 0.262832270 0.233787444 0.359239979
#>  [187] 0.389931814 0.151391737 0.412446177 0.326087257 0.319171609 0.146774478
#>  [193] 0.401962297 0.076170814 0.141370817 0.453955027 0.411050552 0.109883490
#>  [199] 0.429677559 0.283386580 0.115655501 0.401477333 0.103093558 0.600601981
#>  [205] 0.545107665 0.659701017 0.153586155 0.073388494 0.164207004 0.425133292
#>  [211] 0.197009109 0.318423429 0.441153148 0.355459298 0.154968103 0.039790699
#>  [217] 0.311300998 0.450454243 0.568817103 0.403019726 0.071342330 0.168975233
#>  [223] 0.143456215 0.586137147 0.109897979 0.249601963 0.269149109 0.259735038
#>  [229] 0.166885606 0.421322494 0.186280348 0.168426083 0.188351851 0.201721809
#>  [235] 0.169252838 0.081715944 0.096220432 0.117642537 0.184373076 0.289112597
#>  [241] 0.344614222 0.293913036 0.293444572 0.283293896 0.378023328 0.497137745
#>  [247] 0.516817176 0.513672603 0.062969300 0.388407320 0.150005044 0.653999333
#>  [253] 0.113195188 0.072041428 0.214680235 0.119931838 0.141650422 0.010669613
#>  [259] 0.219208874 0.389110918 0.074122073 0.114186378 0.104429082 0.218983864
#>  [265] 0.212238193 0.287242244 0.207895792 0.409433304 0.182664109 0.521397612
#>  [271] 0.592518549 0.335251546 0.442690433 0.196832692 0.068836565 0.125196753
#>  [277] 0.127388001 0.064792215 0.157897090 0.204382500 0.215968439 0.419606109
#>  [283] 0.211302058 0.056860864 0.049187806 0.218304161 0.121921118 0.235130049
#>  [289] 0.263873279 0.114277831 0.292746609 0.136794541 0.046995730 0.140096223
#>  [295] 0.188078276 0.414306001 0.088820621 0.217058841 0.250545765 0.163149770
#>  [301] 0.197864488 0.161208908 0.320151976 0.282660282 0.623150232 0.398005927
#>  [307] 0.191607364 0.379370971 0.304646629 0.125466051 0.418833842 0.444402468
#>  [313] 0.169517891 0.125760458 0.414134986 0.252783493 0.142891902 0.465769638
#>  [319] 0.367261941 0.289094482 0.146252496 0.246770694 0.259205341 0.084213561
#>  [325] 0.187906789 0.162031892 0.071796779 0.167665781 0.262229935 0.262132482
#>  [331] 0.218970235 0.696964810 0.375000022 0.072470463 0.209459312 0.283756178
#>  [337] 0.282330134 0.273714422 0.157374087 0.123782401 0.326893576 0.187966273
#>  [343] 0.294064913 0.266758258 0.041036861 0.223176690 0.252095249 0.318724142
#>  [349] 0.215160156 0.434872348 0.317017247 0.148238312 0.408262476 0.636514773
#>  [355] 0.418976251 0.311064048 0.226681116 0.160473213 0.316168540 0.124932926
#>  [361] 0.180722777 0.460621028 0.324418858 0.470146397 0.340330181 0.422227359
#>  [367] 0.497112537 0.456865943 0.096765319 0.069859072 0.101925675 0.333587284
#>  [373] 0.361594591 0.346180998 0.141755407 0.465695243 0.154336978 0.292101271
#>  [379] 0.168013018 0.109316235 0.385562525 0.220378343 0.486331917 0.011079865
#>  [385] 0.368832538 0.174491444 0.128879991 0.194976988 0.378380203 0.044325979
#>  [391] 0.172382731 0.168077636 0.370910463 0.370150881 0.168503841 0.390436084
#>  [397] 0.265205911 0.110446890 0.143990453 0.483087492 0.292007595 0.353422388
#>  [403] 0.178739883 0.454477722 0.122872947 0.380596343 0.112903518 0.242480964
#>  [409] 0.536845324 0.180600621 0.081672438 0.366172993 0.405851340 0.426490394
#>  [415] 0.470015838 0.229765101 0.091371238 0.315819390 0.382131424 0.329968381
#>  [421] 0.137015171 0.111430007 0.342496880 0.543725729 0.182300438 0.334252313
#>  [427] 0.141288508 0.128952049 0.112513466 0.135263426 0.259977520 0.324515062
#>  [433] 0.012661655 0.075848011 0.080120343 0.066312302 0.056221400 0.231754367
#>  [439] 0.126916679 0.150726806 0.137200944 0.163111400 0.514334737 0.613391767
#>  [445] 0.215275241 0.105986544 0.139477730 0.199235632 0.213271818 0.138446530
#>  [451] 0.087918817 0.327366808 0.185989263 0.312849983 0.250148866 0.206481814
#>  [457] 0.079860120 0.129595483 0.393788789 0.211209734 0.211414467 0.307761030
#>  [463] 0.307897574 0.080012717 0.123403657 0.362646501 0.245211042 0.134798049
#>  [469] 0.082467703 0.211556321 0.166703428 0.263236059 0.191880112 0.334778794
#>  [475] 0.142546046 0.509509861 0.389069499 0.259026887 0.250350293 0.276417016
#>  [481] 0.454122523 0.084228381 0.311865988 0.123806526 0.191776688 0.175484077
#>  [487] 0.208501765 0.399224838 0.315034240 0.318326409 0.091888255 0.248842769
#>  [493] 0.048890436 0.086659007 0.068202892 0.139639404 0.484243247 0.453340639
#>  [499] 0.299807476 0.206255450 0.132931591 0.168352785 0.082436523 0.489743959
#>  [505] 0.061967894 0.093257456 0.159537173 0.256686041 0.405320998 0.626837050
#>  [511] 0.657752837 0.177040377 0.542852437 0.016440773 0.093275423 0.185377126
#>  [517] 0.181173273 0.073084314 0.252341391 0.166013297 0.086373232 0.289729239
#>  [523] 0.179807353 0.305533855 0.162564830 0.137086111 0.035556206 0.155110416
#>  [529] 0.124624219 0.378553638 0.217403353 0.640528260 0.219723436 0.490761488
#>  [535] 0.327814478 0.349360855 0.339293691 0.096808861 0.077884413 0.316130917
#>  [541] 0.117124300 0.274166300 0.207272310 0.120995243 0.415748187 0.089799955
#>  [547] 0.138663654 0.143639896 0.321955885 0.079521700 0.174972279 0.227977765
#>  [553] 0.325868347 0.205385437 0.530979723 0.080346436 0.075231776 0.568546136
#>  [559] 0.092684345 0.144327841 0.418864446 0.330816842 0.134247547 0.120947752
#>  [565] 0.090991238 0.324365651 0.542431331 0.089162808 0.327899487 0.164736528
#>  [571] 0.593707155 0.101413498 0.145850966 0.241747146 0.141164129 0.315033918
#>  [577] 0.094992662 0.050749061 0.130585664 0.387360604 0.098787735 0.608299463
#>  [583] 0.202731278 0.212984080 0.420755851 0.287680644 0.095328402 0.103339158
#>  [589] 0.203503051 0.253695362 0.173035603 0.129684399 0.254683082 0.258715563
#>  [595] 0.352905156 0.337661170 0.071198063 0.092598932 0.109191658 0.100186490
#>  [601] 0.087207656 0.358942374 0.057899746 0.425103227 0.148465983 0.358750624
#>  [607] 0.250659702 0.052840474 0.107084583 0.336912039 0.114325919 0.336566895
#>  [613] 0.358220104 0.102278746 0.192734569 0.112423962 0.297165247 0.089934832
#>  [619] 0.155067552 0.422422435 0.181999432 0.509993329 0.109880358 0.098566727
#>  [625] 0.250624106 0.374522250 0.226859859 0.267690810 0.186311366 0.192545310
#>  [631] 0.223067229 0.129448449 0.102276376 0.233498662 0.169481080 0.247240696
#>  [637] 0.198771076 0.397913650 0.547229703 0.297058748 0.132622938 0.093965788
#>  [643] 0.134875343 0.403415795 0.215610021 0.229109029 0.065857663 0.126590636
#>  [649] 0.152771595 0.231952978 0.113491499 0.106973991 0.221117384 0.060622566
#>  [655] 0.151064985 0.254142047 0.332227619 0.406733143 0.169153843 0.134398348
#>  [661] 0.442696616 0.360904413 0.126001677 0.214936380 0.139053574 0.171675395
#>  [667] 0.295454494 0.223786061 0.304640734 0.206487450 0.094692238 0.080415972
#>  [673] 0.098558204 0.366710626 0.375118607 0.234815340 0.206315395 0.151813887
#>  [679] 0.511887612 0.192151134 0.651641735 0.033901284 0.020077107 0.252255205
#>  [685] 0.455374699 0.123855581 0.099503575 0.131711930 0.288123346 0.410379874
#>  [691] 0.128654354 0.026100689 0.201752565 0.285565631 0.283809351 0.464111325
#>  [697] 0.427354522 0.187807004 0.161029982 0.285606812 0.109194283 0.080909779
#>  [703] 0.231313042 0.339511032 0.193286876 0.076134321 0.153844518 0.410901769
#>  [709] 0.127883823 0.276255662 0.313793840 0.448337071 0.379785167 0.384154122
#>  [715] 0.075605476 0.262103306 0.086544648 0.166902355 0.512499920 0.303780856
#>  [721] 0.352796707 0.224211011 0.285997135 0.304801781 0.469129974 0.333228040
#>  [727] 0.283737232 0.267407911 0.352768188 0.275239966 0.135973532 0.475000395
#>  [733] 0.130741268 0.117560036 0.296512953 0.218407519 0.206875618 0.048704793
#>  [739] 0.134740503 0.326563421 0.290015412 0.316448927 0.347065449 0.162702333
#>  [745] 0.184572082 0.150327529 0.498788139 0.144627692 0.300440675 0.660652812
#>  [751] 0.037933459 0.490734730 0.441440273 0.425337286 0.318874823 0.348008779
#>  [757] 0.175858576 0.302266727 0.731700807 0.753840996 0.113053041 0.213639158
#>  [763] 0.179790599 0.226796120 0.111124382 0.329156911 0.594881868 0.231948680
#>  [769] 0.085591070 0.356664101 0.225085864 0.503589348 0.502752195 0.229198385
#>  [775] 0.166469563 0.224794766 0.160798818 0.187603935 0.177976650 0.205854506
#>  [781] 0.142230856 0.149940029 0.174146103 0.125559589 0.425746536 0.241593035
#>  [787] 0.336671265 0.535606051 0.253236075 0.162847835 0.315031028 0.395900473
#>  [793] 0.197341552 0.236011394 0.184216116 0.102626869 0.445253846 0.614136262
#>  [799] 0.336255959 0.162653727 0.242525317 0.124452716 0.209019520 0.284525675
#>  [805] 0.148681611 0.021276446 0.041077358 0.008537677 0.142729417 0.162512498
#>  [811] 0.412993123 0.162150059 0.154280552 0.152908775 0.154748929 0.145628831
#>  [817] 0.106618455 0.158738021 0.078835287 0.158402072 0.401448312 0.349577134
#>  [823] 0.271542333 0.173289783 0.076341317 0.048697521 0.154598468 0.079491818
#>  [829] 0.113310602 0.326767335 0.155295871 0.265527364 0.148583608 0.093086842
#>  [835] 0.075808950 0.169680675 0.323942211 0.198089080 0.153491739 0.113878882
#>  [841] 0.114603062 0.293245264 0.247867781 0.357664893 0.118236882 0.292823113
#>  [847] 0.461659861 0.182719445 0.236915763 0.270771850 0.134090868 0.306919709
#>  [853] 0.379756828 0.560710326 0.579039935 0.049614123 0.077100200 0.339665186
#>  [859] 0.457088740 0.104445477 0.075158002 0.073046527 0.156474840 0.306575768
#>  [865] 0.316246823 0.267325438 0.156351551 0.240295523 0.431433815 0.374536513
#>  [871] 0.349908984 0.277034897 0.359546003 0.311423240 0.210574890 0.111780077
#>  [877] 0.311593208 0.124202906 0.034631833 0.101438741 0.426656138 0.497511891
#>  [883] 0.415565148 0.298889836 0.402693494 0.361542908 0.612956141 0.186254825
#>  [889] 0.285642454 0.254039618 0.209354730 0.372275918 0.378232275 0.453588202
#>  [895] 0.273507709 0.597315627 0.584387815 0.209241958 0.131686196 0.479718178
#>  [901] 0.290733667 0.371980077 0.316511676 0.236152509 0.374856344 0.153972094
#>  [907] 0.466850931 0.413617268 0.325141151 0.412487756 0.332410334 0.167289378
#>  [913] 0.083619316 0.323135779 0.264251406 0.326887808 0.193372709 0.544541780
#>  [919] 0.102104761 0.414945840 0.344726930 0.145286140 0.367023083 0.208864822
#>  [925] 0.574166148 0.182548736 0.108662365 0.333108734 0.187492789 0.045526028
#>  [931] 0.147938940 0.065596556 0.111302347 0.049320115 0.319365320 0.220882764
#>  [937] 0.515480855 0.354736255 0.181569645 0.262923897 0.119586049 0.339998468
#>  [943] 0.126947425 0.135354600 0.114332926 0.345460933 0.247855280 0.398358459
#>  [949] 0.316707238 0.316910776 0.656616762 0.169408425 0.286987676 0.196113713
#>  [955] 0.084793279 0.138887381 0.235608319 0.390264778 0.175025860 0.378454549
#>  [961] 0.463783719 0.437154150 0.145399111 0.316615612 0.174550482 0.153277994
#>  [967] 0.174074773 0.388841531 0.177200675 0.129375453 0.076018296 0.192535130
#>  [973] 0.129882565 0.128084839 0.147000771 0.164648199 0.223770847 0.145641094
#>  [979] 0.394573451 0.149518157 0.294304370 0.261100335 0.348334647 0.211604792
#>  [985] 0.307072847 0.293186053 0.226960539 0.275441748 0.069300800 0.131641148
#>  [991] 0.118759299 0.298865217 0.345782022 0.215159092 0.177138885 0.115224125
#>  [997] 0.167178910 0.104436854 0.245781005 0.392358182