Skip to contents

Simulate data from a bounded power law Simulates data from a bounded power law. This is basically a vectorized version of the rPLB() function in Edwards et al. (2017) `sizeSpectra` package. The argument names are required to match the default arguments for custom likelihoods in `brms`.

Usage

rparetocounts(n = 300, lambda = -1.2, xmin = 1, xmax = 1000)

Arguments

n

number of observations

lambda

vector of lambda (the power law exponent)

xmin

xmin: the minimum body size of the sample or the minimum possible body size

xmax

xmax: the maximum body size of the sample or the maximum possible body size

Value

a numeric vector

Examples

rparetocounts(n = 100, lambda = -1.5, xmin = 1, xmax = 2000)
#>   [1]    2.601538  467.169668    1.947416    8.816276   12.653432    1.530103
#>   [7]  583.842965   13.217430    1.108724    4.310709    9.781806    9.361125
#>  [13]    1.063979    1.645844    2.006867    7.007350    3.537434    2.998524
#>  [19]   10.448758  189.547123    1.473902    1.610655    8.908225    3.810098
#>  [25]    7.200346    7.958228    1.217939   15.807304   16.320163 1011.616501
#>  [31]  381.758910    2.605493    3.316317    2.089439    1.454287    4.334626
#>  [37]    3.735471   17.636740    1.560989   10.924259    1.140837    2.340050
#>  [43]   26.776223    1.864733    5.102438    2.215826    5.748863    1.513807
#>  [49]  185.467674    4.533688    4.574027    1.888756    3.151679    2.466035
#>  [55]    1.057210    3.373741    2.612485    1.040418    2.507902    4.881543
#>  [61]   38.065691    2.569901    4.270818    5.868607    1.804272    1.948255
#>  [67]    3.551141   98.876746    2.703023    1.595861    8.487268    1.125269
#>  [73] 1571.458549    1.370194    4.113752   33.489889   11.276545    1.712853
#>  [79]    4.621057   29.580277    1.056987    3.415282   22.179650   23.993585
#>  [85]    2.730964    1.616792    2.863088    8.348968    3.941433    7.961520
#>  [91]    4.005563   29.817819   10.605516   47.338920    1.022829   57.730732
#>  [97] 1487.049565    3.829745    2.373727   17.016984