The function rlim() provides access to implementations of two MCMC methods for uniformly sampling high-dimensional polytopes: the so-called mirror and billard walks (MiW and BiW).

rlim(
  lim,
  Hpol = NULL,
  type = "MiW",
  jmp = NULL,
  scale = 10,
  thin = 1,
  burn = 0,
  nsamp = 3000,
  nsim = NULL,
  starting_point = NULL,
  tol = sqrt(.Machine$double.eps),
  seed = NULL
)

Arguments

lim

A list with four components A, B, G and H representing the polytope to be sampled; see the section Details below.

Hpol

A Hpolytope object representing the reduced polytope to be sampled. If NULL (the default), it is computed from lim. Hpol is used only if lim is set to NULL.

type

A character string specifying the MCMC algorithm to be used for sampling,

jmp

A numeric value (if type is "BiW") or a numeric vector (if type is "MiW") giving the jump rate parameter of the MCMC algorithm to be used. If NULL (the default), it is automatically computed from lim; see the section Details below.

scale

A numeric value. See the section Details below for details.

thin

An integer giving the thinning parameter for the MCMC algorithm. Default is 1 (no thinning).

burn

An integer giving the burning period for the MCMC algorithm. Default is 0 (no burn-in).

nsamp

An integer; the length of the output sample of points into the polytope. Default is 3000.

nsim

An integer value giving the number of sampled points in the polytope. If not NULL (the default value), then nsamp is set to (nsim-burn)/thin. See Details Section below.

starting_point

A numeric vector giving the coordinates of a point inside the polytope, used as starting point in the MCMC algorithm.

tol

A numeric value specifying the tolerance for numeric computations.

seed

An integer used to set the seed of the PRNG.

Value

A nsamp*p matrix whose rows are the coordinates of the nsamp points sampled in the polytope. The dimension p is:

  • the dimension of the inner space the polytope relies into (i.e., the number of flows), if Hpol is NULL;

  • the dimension of Hpol is Hpol is an object of class Hpolytope.

Details

A polytope \(\mathcal{P}\) is a convex subset or \(\mathbb{R}^n\), \(n \in \mathbb{N^*}\), defined as the intersection of hyper-planes and half-spaces. More precisely, \(\mathcal{P} = \{ x \in \mathbb{R}^n: Ax = B, Gx \geq H \}\), where \(A\) is an \(m\times n\) matrix, with \(m \leq n\), \(B \in \mathbb{R}^m\), \(G\) is a \(k \times n\) matrix and \(H \in \mathbb{R}^k\). For polytopes involved in Linear Inverse Models (LIM), \(n\) is the number of flows in the metabolic network. The \(k\) inequality constraints insures that \(\mathcal{P}\) is bounded. The polytope to be sampled is given to rlim() whether by:

  • creating a list with four elements A, B, G, H, giving the set of equality and inequality constraints for the polytope, and using it for lim argument. This list can be created manually or by importing a LIM declaration file thanks to the function df2lim(). Or by

  • creating an object of class Hypolytope (originating from package volesti) thanks to the function Hpolytope(); see Hpolytope-class. This Hypolytope object is passed to argument Hpol, and requires argument lim to be set to NULL for being processed.

The main practical difference between lim and Hpolytope objects is that Hypolytope allows for inequality constraints only, hence the polytope is of full dimension \(n\).

Two MCMC methods for sampling a polytope are implemented. The MiW has been introduced by Van Oevelen et al. (2010), while the BiW has been introduced by Polyak and Gryazina (2014). Both are reflective Hamiltonian algorithms: each new point of the sample is generated from the previous one by choosing randomly a direction and moving forward this direction for a random length. If the end point of this segment belongs to the polytope, then it is added to the sample; if not, then, the trajectory is reflected on borders of polytope until the end point belongs to the polytope. BiW and MiW differ in the probability distributions used for generating the length of the trajectory; see Girardin at al. (2023) for details. Still, these distributions depend on a parameter called (in both cases) the jump rate of the trajectory.

The jump rate has a strong influence on the performance of the algorithm: too small, a very large number of points nsim would be needed to efficiently sample the polytope. Too large, the trajectories reflect an important number of times before resulting in a point inside the polytope, making the process very slow. If jmp is NULL (default), it is computed automatically, depending the type (MiW or BiW). Precisely,

  • if type is "MiW", then jmp is a random vector of length equal to the dimension of the reduced polytope. It is equal to the ranges of the reduced polytope divided by scale (default for scale is 10);

  • if type is "BiW", the jmp is a single value equal to the radius of the largest ball included in the reduced polytope.

References

D. Van Oevelen, K. Van den Meersche, F. J. R. Meysman, K. Soetaert, J. J. Middelburg and A. F. Vézina, Quantifying Food Web Flows Using Linear Inverse Models, Ecosystems 13, 32-45 (2010).B.T. Polyak and E.N. Gryazina, Billiard walk - a new sampling algorithm for control and optimization, IFAC Proceedings Volumes, 47(3), 6123-6128 (2014).V. Girardin, T. Grente, N. Niquil and P. Regnault, Comparing and updating R packages of MCMC Algorithms for Linear Inverse Modeling of Metabolic Networks, hal: (2023)

See also

df2lim() for creating an lim object from a declaration file, Hpolytope-class for class Hpolytope.

Examples

# Create a lim object from a Description file
DF <- system.file("extdata", "DeclarationFileBOWF-short.txt", package = "samplelim")
BOWF <- df2lim(DF)
# Manage sampling in this LIM with rlim()
rlim(lim = BOWF, nsamp = 20, seed = 123)
#>       FIX->PHY  IMP->FBF DET->BIV   DET->ZOO DET->BAC  PHY->RES PHY->DET
#>  [1,] 304.7398  8.188190 41.13866  2.7547661 191.7810  22.82508 116.5854
#>  [2,] 310.0166  7.289395 20.44853 11.2781200 208.4425  24.45221 121.4505
#>  [3,] 335.1810  4.073940 24.81560  6.2406614 184.5813  24.86050 139.8148
#>  [4,] 381.6556  6.260583 23.77029  5.3914830 280.6353  31.59105 187.6128
#>  [5,] 437.7902  6.586501 22.59578  2.3529756 270.7535 102.43286 184.4280
#>  [6,] 473.2961  6.587768 21.11376  0.5112398 290.2647 123.50966 194.6432
#>  [7,] 381.2999  4.633870 33.94762  4.5171359 208.9379  57.68215 152.6159
#>  [8,] 432.2004  6.517986 25.48586  7.7561726 275.8000  60.76746 201.2242
#>  [9,] 395.8033  6.114642 18.86930  0.7095846 288.6095  58.59118 179.2329
#> [10,] 369.2437  5.644918 31.67634 10.3375148 289.9552  54.00051 164.9670
#> [11,] 315.8752  7.376019 28.29581  6.1527957 240.3783  20.50941 128.6282
#> [12,] 346.1430  5.388763 14.01836  1.2407708 281.6140  31.37347 157.0320
#> [13,] 389.1485  9.728750 19.08375  7.1852475 291.5715  43.55667 185.5139
#> [14,] 402.8674 10.954318 23.48459  4.4085408 340.2273  46.12894 194.5380
#> [15,] 417.7756  9.797729 22.30303  4.9647541 333.5046  56.31940 194.2203
#> [16,] 424.4061  7.249694 36.89798  5.2229327 235.4780  67.29749 187.6310
#> [17,] 484.4849  6.735320 30.09446  3.9316903 259.5488 120.46384 197.9283
#> [18,] 471.5178 10.768859 31.28290  4.1921996 303.9857 138.14988 179.5851
#> [19,] 518.4290  7.278820 35.60304  1.7009586 349.1262 115.49845 232.5805
#> [20,] 576.7813  6.080233 21.00768 10.1038416 378.1581 148.22118 258.4187
#>       PHY->BIV PHY->ZOO    PHY->BAC  PHY->LOS  BAC->RES BAC->DET  BAC->LOS
#>  [1,] 72.50837 59.80315  5.23948692 27.778340 115.37803 32.25215  49.39029
#>  [2,] 52.54402 76.64730 13.18244357 21.740057  89.80800 65.83728  65.97968
#>  [3,] 65.42448 53.65594 27.92060867 23.504666  77.19170 21.71152 113.59871
#>  [4,] 62.32985 61.91220  5.04864128 33.161092  79.23301 51.96859 154.48238
#>  [5,] 66.43580 73.94561  4.69108540  5.856817  78.89247 42.99369 153.55840
#>  [6,] 75.63598 67.19485  0.09761946 12.214762 126.34517 33.68154 130.33562
#>  [7,] 63.43421 73.23912 10.20896481 24.119493  78.91944 46.05103  94.17636
#>  [8,] 69.39813 48.31339 42.56231653  9.934903 115.82767 39.04110 163.49357
#>  [9,] 44.74022 51.01203 51.35307909 10.873892 141.79789 88.47977 109.68491
#> [10,] 66.08113 67.51836  5.04553704 11.631110 157.62213 96.55652  40.82205
#> [11,] 77.89110 55.61177 16.07083357 17.163868 140.71258 77.27931  38.45720
#> [12,] 67.31715 78.43397  5.49312503  6.493254 185.38409 56.64140  45.08169
#> [13,] 42.32641 89.04814  1.46906445 27.234355 188.00694 67.55028  37.48332
#> [14,] 57.05487 89.37566  3.17687354 12.593091 178.19130 98.45043  66.76246
#> [15,] 71.86729 74.28478  9.02599454 12.057800 213.09631 70.96738  58.46690
#> [16,] 67.75560 59.44387 41.04237442  1.235723 196.26059 24.53192  55.72786
#> [17,] 79.59806 37.61528 28.01595964 20.863422  89.74648 45.15054 152.66770
#> [18,] 97.63940 52.60009  2.47700458  1.066320  93.60600 96.21318 116.64356
#> [19,] 88.93580 50.26620 28.52428072  2.623832 147.53599 96.27261 133.84192
#> [20,] 82.93721 54.20196 27.57766617  5.424623 117.80069 96.81803 191.11704
#>        ZOO->RES ZOO->DET  ZOO->FBF  ZOO->BIV  ZOO->ZOO  ZOO->LOS BIV->RES
#>  [1,] 16.367368 22.71853  7.604794 12.465501 4.2681856  3.401717 38.24217
#>  [2,] 24.523404 21.35765  7.374766 12.183025 3.8145890 22.486571 38.23405
#>  [3,] 17.471081 24.25100  3.775960  6.702346 2.5531203  7.696216 41.66280
#>  [4,] 10.060497 34.75122  7.448425  2.859171 3.2713745 12.184368 34.09816
#>  [5,] 17.914422 29.05678  6.501696 14.203753 6.6396701  8.621930 47.62291
#>  [6,] 13.383512 32.13029  5.352583 12.628739 0.7826344  4.210968 39.98247
#>  [7,] 24.803929 21.66796  5.290603  5.790826 5.2986348 20.202944 59.32281
#>  [8,] 12.519656 19.24930  6.376103  6.591662 0.4059158 11.332839 37.81379
#>  [9,] 14.577028 16.99180  4.924924 13.842006 2.2382150  1.385859 40.07344
#> [10,] 14.421703 36.96178  5.168152  1.842413 1.5465221 19.461823 44.40254
#> [11,]  7.166749 25.85314  8.790242 12.638559 3.8466264  7.315874 49.15604
#> [12,] 11.254846 41.42201  5.125465 11.024713 5.8373800 10.847710 39.64047
#> [13,] 18.335121 36.08961  9.034273 13.900982 3.7238554 18.873405 37.45504
#> [14,] 11.934802 38.30531 11.141354  7.507861 4.2292815 24.894871 46.22985
#> [15,] 15.854503 34.65712  9.993347 13.829179 0.3103128  4.915389 37.96903
#> [16,] 16.904895 19.07097  7.263489 17.661182 3.6982083  3.766269 52.63662
#> [17,] 10.342527 15.23491  5.965053  3.618706 1.3092797  6.385772 61.73202
#> [18,]  6.936981 25.75074  9.509865 10.074718 5.1088562  4.519991 87.73796
#> [19,]  6.636234 22.55546  6.018958 11.764078 5.4652785  4.992427 75.70920
#> [20,] 10.820169 28.81275  5.824978  7.910572 0.5506536 10.937335 58.36119
#>       BIV->DET  BIV->FBF  BIV->LOS  FBF->RES  FBF->DET FBF->FBF   FBF->LOS
#>  [1,] 52.54603  7.252428 28.071903 10.918909 11.572327 4.488263 0.55417527
#>  [2,] 22.53904  6.834049 17.568448 11.479992  8.984660 4.096887 1.03355846
#>  [3,] 27.28734  3.880078 24.112206  8.577051  2.572923 2.040761 0.58000482
#>  [4,] 29.80863  7.685167 17.367341 14.940587  5.655848 4.524135 0.79773901
#>  [5,] 30.38804  5.731392 19.492992  8.770760  8.835711 3.665106 1.21311748
#>  [6,] 41.72258  6.887012 20.786429  9.077730  9.712114 4.315374 0.03751877
#>  [7,] 23.85850  4.763732 15.227611 10.405062  3.209196 3.514119 1.07394706
#>  [8,] 39.62989  6.511134 17.520840  9.166817  9.897602 5.348611 0.34080432
#>  [9,] 17.83751  5.851336 13.689235 10.389535  5.646350 4.440513 0.85501679
#> [10,] 31.25064  4.802437 19.144271 12.873322  2.233068 4.261678 0.50911712
#> [11,] 39.41555  8.624707 21.629171 21.007159  3.650628 5.610652 0.13318061
#> [12,] 33.15987  5.475179 14.084703  6.561526  8.617878 3.212394 0.81000332
#> [13,] 17.22354  9.297534 11.335032 15.466980 11.463187 4.611113 1.13039016
#> [14,] 21.59966 11.655509  8.562296 18.204155 15.227058 5.331091 0.31996763
#> [15,] 44.74777  9.237713 16.044986 12.537408 16.179761 4.388306 0.31161921
#> [16,] 34.80404  5.963451 28.910654  8.747852 11.560961 4.566032 0.16782077
#> [17,] 26.85905  6.925133 17.795033  9.347019  8.402080 3.745511 1.87640764
#> [18,] 30.49043 10.573516 10.195113 22.335439  7.421358 5.109986 1.09544395
#> [19,] 27.45426  5.878872 27.260578 11.279899  7.567433 5.127349 0.32931838
#> [20,] 20.60573  5.730641 27.157900 12.750016  4.614448 4.282661 0.27138843
# Alternatively, you can use a Hpolytope object as input
# It allows using volesti input inside rlim
A = matrix(c(-1,0,0,-1,1,1), ncol=2, nrow=3, byrow=TRUE)
b = c(0,0,1)
P = Hpolytope(A = A, b = b)
rlim(lim=NULL, Hpol = P, nsamp = 20, seed = 123)
#> Warning: Argument lim is ignored as Hpol has been set manually.  
#>             Sampling is performed directly into Hpol.
#>              [,1]      [,2]
#>  [1,] 0.156362856 0.6753098
#>  [2,] 0.184554529 0.8036021
#>  [3,] 0.214833108 0.6250406
#>  [4,] 0.146671900 0.6947968
#>  [5,] 0.055890136 0.6710050
#>  [6,] 0.031978511 0.7716468
#>  [7,] 0.075453824 0.7248860
#>  [8,] 0.024373501 0.7415151
#>  [9,] 0.113613689 0.8602617
#> [10,] 0.268588849 0.7207191
#> [11,] 0.168466652 0.8040344
#> [12,] 0.021846539 0.7212969
#> [13,] 0.012675550 0.8332604
#> [14,] 0.079481692 0.8931977
#> [15,] 0.119038344 0.7887299
#> [16,] 0.048715957 0.9021616
#> [17,] 0.068696189 0.8644972
#> [18,] 0.031316651 0.9327030
#> [19,] 0.009600641 0.6625308
#> [20,] 0.016536191 0.6963890
# Samples can be thinned and burnt-in 
rlim(lim= BOWF, nsamp = 20, burn = 50, thin =10, seed = 123)
#>       FIX->PHY  IMP->FBF DET->BIV   DET->ZOO DET->BAC  PHY->RES PHY->DET
#>  [1,] 518.5923  3.393913 39.29050  5.7360297 452.1907 100.26911 253.5341
#>  [2,] 574.3575 10.871459 25.07481  4.0051426 370.7705 138.56928 273.4296
#>  [3,] 613.2120  5.215720 23.27549  7.2069026 403.1951 183.03573 286.2261
#>  [4,] 743.4035  7.101474 16.21213 10.2633970 632.3832 201.58933 370.7282
#>  [5,] 514.1202  5.862052 33.64318  8.8930646 387.3986 117.48119 234.6853
#>  [6,] 557.2044  7.457415 18.96608  1.5088192 460.6375 146.58368 269.4170
#>  [7,] 611.1518  4.340349 33.99324  0.4251216 502.8151 146.48195 296.2364
#>  [8,] 651.1708  5.424841 34.07443  0.8771641 410.0135 180.29038 323.3648
#>  [9,] 412.5633  3.962905 24.82583  1.8558914 300.1761  87.04641 162.9913
#> [10,] 519.9495  8.733393 24.93681  2.6456645 422.8988 100.28197 251.4823
#> [11,] 646.8933  4.704106 26.89629  5.4734167 496.2048 173.61290 302.8469
#> [12,] 612.8238  9.109845 31.01660  2.4451678 406.5180 161.07741 281.1027
#> [13,] 750.7745  8.532023 26.06136  3.0039145 532.0140 219.68363 368.9771
#> [14,] 620.1346  6.277647 19.06040 10.9197789 504.4911 180.40493 293.4145
#> [15,] 624.2146  6.586668 27.72925  7.6971304 471.5089 182.36665 305.8627
#> [16,] 495.8502  7.723373 32.28971  8.2567500 256.0546 115.44681 211.4443
#> [17,] 392.6499  7.028955 25.45102  3.0643611 174.6255  87.89595 135.6537
#> [18,] 453.3871  6.782226 21.18580  4.4701934 258.3599  97.13549 198.6717
#> [19,] 516.0252  7.816755 26.92481 14.2951770 293.6952 117.54475 228.9651
#> [20,] 607.0149  6.819710 19.67534  7.0270061 397.9560 179.53184 266.4869
#>       PHY->BIV  PHY->ZOO   PHY->BAC   PHY->LOS  BAC->RES  BAC->DET  BAC->LOS
#>  [1,] 91.05431  57.54133  1.3469158 14.8465356 150.11325 148.38825 155.03613
#>  [2,] 48.82077  99.38171  8.9003835  5.2557275 297.37034  40.19284  42.10769
#>  [3,] 74.43263  56.49308 12.7470675  0.2774030 191.56411  75.37244 149.00567
#>  [4,] 46.74633  93.33822  3.6339955 27.3673488 270.01066 222.51110 143.49542
#>  [5,] 66.70260  88.00346  2.9859224  4.2617173 176.89951 120.58950  92.89551
#>  [6,] 71.59873  53.42846 13.4734731  2.7030485 180.68782 154.52144 138.90169
#>  [7,] 89.32481  56.81964  5.1769595 17.1120051 296.97098 153.09171  57.92932
#>  [8,] 61.77091  33.48052 41.6960563 10.5681195 114.57071  72.55604 264.58277
#>  [9,] 44.08631  72.67314 17.7035038 28.0626722 162.94584 108.88778  46.04600
#> [10,] 65.84551  62.97254 30.5745023  8.7926987 135.44372 135.55132 182.47829
#> [11,] 71.78083  52.61184 32.1477364 13.8931377  42.60457 176.25131 309.49671
#> [12,] 60.02575  56.43040 51.2771056  2.9103741 134.04237  99.60250 224.15024
#> [13,] 66.82544  51.26451  4.6857342 39.3380181 122.66146 123.81835 290.21994
#> [14,] 78.06174  61.98923  1.7907201  4.4734798 189.55800 167.35873 149.36505
#> [15,] 59.83996  75.43803  0.3304457  0.3767806 179.58323 130.03731 162.21879
#> [16,] 89.70946  53.06024 22.9353010  3.2540674 101.24986  20.45340 157.28660
#> [17,] 69.96255  61.44861 19.2400505 18.4490306 129.35652  12.22339  52.28569
#> [18,] 61.94811  61.10648 30.4483986  4.0769526 198.73409  42.96139  47.11281
#> [19,] 49.66515 103.15933 16.5905986  0.1002687 198.50265  35.47671  76.30643
#> [20,] 58.66357  56.72412 36.6955080  8.9129648 247.08798 100.95107  86.61243
#>        ZOO->RES ZOO->DET  ZOO->FBF  ZOO->BIV  ZOO->ZOO   ZOO->LOS BIV->RES
#>  [1,]  9.910594 31.93939  2.596200 15.610776 5.3994159  3.2203992 56.06252
#>  [2,] 16.346355 42.68114 11.157839 13.816935 4.5870317 19.3845818 39.55326
#>  [3,] 15.422853 21.26134  5.334471 14.745486 0.6884766  6.9358301 47.40320
#>  [4,] 21.746232 33.58690  4.407491 12.768026 2.9936362 31.0929743 30.26557
#>  [5,] 19.531430 43.97767  5.594137 13.479475 3.4795544 14.3138104 58.84837
#>  [6,] 14.214214 17.13399  7.635536 11.009663 4.7383073  4.9438788 50.60177
#>  [7,]  9.049724 28.05330  4.766219 11.746835 0.7709615  3.6286756 40.04239
#>  [8,]  5.695390 14.25633  6.949123  2.791419 2.6172879  4.6654208 47.72116
#>  [9,] 18.007219 35.75704  5.394658  7.939762 6.8291782  7.4303487 40.11277
#> [10,] 19.406170 17.70844  8.235427 18.762687 3.5768844  1.5054781 49.35157
#> [11,]  8.213569 24.60530  4.113647 10.582504 1.3025490 10.5702403 60.36259
#> [12,] 18.432647 13.39103  8.897811  1.878589 3.7066530 16.2754907 39.51757
#> [13,]  9.883555 24.26592  8.123019  7.183485 1.4283931  4.8124513 42.07617
#> [14,] 11.227915 33.80839  8.606279 10.382478 0.9670347  8.8839372 42.05352
#> [15,] 24.936151 42.35434  6.804831  3.774635 7.2314519  5.2652063 48.20329
#> [16,] 10.482342 26.54932  7.972846 16.057266 0.4200650  0.2552164 67.50294
#> [17,] 17.661138 18.12510  4.933787  4.878255 0.7875320 18.9146943 54.20816
#> [18,] 21.224759 14.31698  7.318870 16.553061 5.3685689  6.1630051 56.01568
#> [19,] 30.619915 30.56464  6.870753 11.526781 2.4737067 37.8724112 31.51692
#> [20,] 19.719729 18.54763  6.659214  1.949947 2.6625456 16.8746053 31.49779
#>       BIV->DET  BIV->FBF BIV->LOS  FBF->RES  FBF->DET FBF->FBF   FBF->LOS
#>  [1,] 59.03247  3.247387 27.61321  4.166233  4.322995 2.365999 0.74827204
#>  [2,] 26.16284 11.099570 10.89685 15.708280 17.383986 4.804808 0.03660158
#>  [3,] 42.88174  5.911512 16.25715  7.985434  7.935926 3.990080 0.54034262
#>  [4,] 24.07626  6.619606 14.76504  9.959878  7.956218 6.004359 0.21247626
#>  [5,] 28.07027  5.266105 21.64050 13.750031  2.612124 4.946626 0.36013881
#>  [6,] 26.26275  8.908256 15.80170  9.838632 13.777166 5.947981 0.38540815
#>  [7,] 55.83954  4.903601 34.27937  8.152488  4.012462 2.559651 1.84521917
#>  [8,] 25.65603  7.333700 17.92586 10.502522  9.131821 5.612240 0.07332178
#>  [9,] 14.76581  4.549609 17.42372  9.302247  4.455918 4.158953 0.14900694
#> [10,] 36.65214  8.952699 14.58859 16.356550  9.087135 4.586762 0.47783342
#> [11,] 21.28515  4.922825 22.68906 10.011262  3.585899 2.841170 0.14341835
#> [12,] 31.72936  8.618832 13.05516 12.292652 14.154155 5.440735 0.17968158
#> [13,] 32.85100  9.128911 16.01421 14.429899 11.166883 5.804452 0.18717163
#> [14,] 35.65580  8.166869 21.62842 18.707519  4.233823 5.898957 0.10945294
#> [15,] 22.31274  6.024763 14.80305 11.625212  6.368154 3.451360 1.42289526
#> [16,] 32.73620  7.351556 30.46574 17.046163  5.417813 3.791534 0.58379838
#> [17,] 26.17860  7.160688 12.74439  7.331034 10.960170 5.424583 0.83222667
#> [18,] 22.73232  7.166173 13.77279 13.969889  5.333544 4.031500 1.96383492
#> [19,] 35.05947  7.806776 13.73357 17.379351  4.849263 4.938230 0.26566968
#> [20,] 28.20372  7.819798 12.76756  9.683007 10.468969 4.845949 1.14674556
# Samples can be thinned and/or burnt-in 
sample1 <- rlim(lim= BOWF, nsamp = 20, burn = 50, thin =10, seed = 123)
# Default behaviour is to set the size nsamp of the returned sample, 
# taking into account burn-in and thinning.
# Alternatively, the pilot sample size (i.e., the number of points actually
# sampled before burn-in and thinning) nsim can be set
sample2 <- rlim(lim = BOWF, nsim = 250, burn = 50, thin = 10, seed = 123)
#> Warning: nsamp is ignored as nsim has been set manually.
#>             nsamp is set to (nsim-burn)/thin.
all(sample1 == sample2)
#> [1] TRUE