Skip to contents

The classification problem Circle is described in the BARK paper (2008). Inputs are dim independent variables uniformly distributed on the interval \([-1,1]\), only the first 2 out of these dim are actually signals. Outputs are created according to the formula $$y = 1(x1^2+x2^2 \le 2/\pi)$$

Usage

sim_circle(n, dim = 5)

Arguments

n

number of data points to generate

dim

number of dimension of the problem, no less than 2

Value

Returns a list with components

x

input values (independent variables)

y

0/1 output values (dependent variable)

References

Ouyang, Zhi (2008) Bayesian Additive Regression Kernels. Duke University. PhD dissertation, Chapter 3.

See also

Other bark simulation functions: sim_Friedman1(), sim_Friedman2(), sim_Friedman3()

Other bark functions: bark(), bark-package, bark-package-deprecated, sim_Friedman1(), sim_Friedman2(), sim_Friedman3()

Examples

sim_circle(n=100, dim=5)
#> $x
#>                [,1]         [,2]        [,3]         [,4]          [,5]
#>   [1,] -0.948218130 -0.786142227 -0.06248782 -0.558072489 -0.9807747877
#>   [2,] -0.889386122  0.633051797 -0.03709023 -0.011783426 -0.2203331133
#>   [3,] -0.062348036 -0.225966798 -0.89575702  0.169701155 -0.1454366217
#>   [4,] -0.774917602  0.230689711 -0.06958776 -0.587349249 -0.2209404404
#>   [5,]  0.210191870  0.799849859 -0.90530198  0.745349922  0.7318477090
#>   [6,]  0.841786455  0.285512059  0.96745372  0.921634264  0.3543632226
#>   [7,] -0.079121095 -0.031281726 -0.69061200 -0.951003162  0.6191468807
#>   [8,]  0.804802695 -0.717133217 -0.47006993  0.473482131 -0.1962033389
#>   [9,] -0.612224613  0.374503849  0.90879521 -0.918984616  0.2454090556
#>  [10,]  0.449124927  0.315238420  0.47812289 -0.981051274  0.6707045916
#>  [11,] -0.004546496  0.902552225  0.95435426  0.558790226 -0.8525602366
#>  [12,] -0.457799221 -0.586389780  0.30383959  0.720392426 -0.6827336401
#>  [13,] -0.864071465 -0.052357480  0.05495809 -0.541725049  0.9531756490
#>  [14,] -0.557439344  0.767972077 -0.81159236  0.265951183  0.0215373915
#>  [15,]  0.363482933 -0.861704249  0.49082133 -0.739379404 -0.2449258938
#>  [16,] -0.012446861 -0.018583041 -0.61716479 -0.927945620  0.1218074299
#>  [17,] -0.938440116 -0.061534225  0.51754142 -0.144891829  0.8724692394
#>  [18,] -0.693468693  0.339062196  0.44773180 -0.997416888 -0.9964970914
#>  [19,]  0.433925551 -0.199843764  0.95318477 -0.393472604 -0.8314696741
#>  [20,] -0.968033453  0.222248017 -0.72554067  0.646842317  0.9743683860
#>  [21,] -0.469450569  0.931189551 -0.13787468  0.375186705  0.6039521182
#>  [22,] -0.435231931  0.362654170  0.64323996 -0.245305657 -0.5915995436
#>  [23,] -0.522111940 -0.780161879  0.02821503  0.507576585 -0.9627297618
#>  [24,]  0.170867998  0.244176051  0.95295829  0.837094612 -0.5114584197
#>  [25,] -0.753415535 -0.367034241  0.33968976 -0.060663233  0.6810299912
#>  [26,]  0.030242904 -0.108669769 -0.80151240 -0.521303057 -0.2219715482
#>  [27,] -0.080363567  0.275622638 -0.08540942 -0.909188801 -0.6696438277
#>  [28,]  0.741944784 -0.621132304  0.52456666 -0.270650870 -0.1792944344
#>  [29,]  0.417652708  0.457806112 -0.77339811  0.833583429 -0.9742750009
#>  [30,] -0.812767109  0.672255357  0.61298169  0.660975884 -0.9190949067
#>  [31,]  0.125073239 -0.612747194 -0.95491681  0.475485748 -0.8467685357
#>  [32,]  0.548715138  0.002459539  0.53761108  0.659559209 -0.9896544949
#>  [33,]  0.021758302  0.887783890 -0.45199291  0.558241512  0.4922744306
#>  [34,]  0.781166208  0.491526808  0.67659764 -0.955636518  0.1376646711
#>  [35,] -0.483499768  0.718503149 -0.22032562 -0.510948340  0.6404783712
#>  [36,]  0.895005345 -0.677671223 -0.82033822 -0.010933337 -0.4095390453
#>  [37,]  0.683894925 -0.867922412 -0.90929592 -0.690134336  0.0127973491
#>  [38,] -0.380702541  0.040343923 -0.36155186  0.844116821  0.0030814894
#>  [39,]  0.778445582 -0.867499262 -0.05160033  0.554356255  0.8959710016
#>  [40,]  0.389552498 -0.626635521  0.05663758 -0.599213785  0.3100100923
#>  [41,] -0.534583297 -0.727778299 -0.83330454  0.975959345 -0.6345895664
#>  [42,]  0.645252144  0.820871485 -0.73437187 -0.677936636 -0.0122119286
#>  [43,] -0.339240379 -0.278289412  0.56757601 -0.936367112 -0.7834376292
#>  [44,]  0.901517572  0.072366255 -0.03876337 -0.393796466 -0.3686885051
#>  [45,]  0.469713111  0.619135770  0.62946461 -0.984776993 -0.4775332292
#>  [46,] -0.897784385 -0.272669236  0.59361605 -0.348321211  0.8800851703
#>  [47,] -0.815971639  0.067191361  0.60268113  0.010610921  0.0979166729
#>  [48,]  0.893756703 -0.379905213 -0.91811586  0.312020238  0.3338963841
#>  [49,] -0.781066332  0.916444805 -0.20377699 -0.086622213 -0.4692191640
#>  [50,]  0.136512367 -0.154996133  0.20364227 -0.130167228 -0.1504302141
#>  [51,] -0.755903756 -0.418423334  0.78185232 -0.189313812  0.9305789829
#>  [52,]  0.302452193  0.776602695  0.20871303 -0.123152530 -0.3548164149
#>  [53,] -0.118173309  0.334330813  0.11162461  0.102924738 -0.8901229301
#>  [54,] -0.283576987  0.650454334  0.53909570  0.021326344 -0.3499150570
#>  [55,] -0.352929298  0.403720738 -0.68015172  0.122418567  0.6581885098
#>  [56,] -0.329648682  0.305120305 -0.95071476  0.542584231  0.9254494677
#>  [57,] -0.137938333 -0.027940932 -0.50802616 -0.225817882 -0.0536062932
#>  [58,] -0.829826812 -0.496318373  0.06226366  0.383970662  0.5241269022
#>  [59,] -0.977810331 -0.299032636  0.98612249 -0.992049875  0.3125043223
#>  [60,]  0.142835598  0.951192075  0.41487753 -0.672515232  0.9853994153
#>  [61,]  0.177344457  0.945979337  0.78090905  0.255928957 -0.8541000220
#>  [62,]  0.499724864  0.461256229 -0.21847640 -0.667238837  0.8681704374
#>  [63,] -0.654053530 -0.606831883 -0.88133399 -0.001572353 -0.9308269038
#>  [64,] -0.527493706  0.509055660 -0.97381326  0.885247614 -0.9191508056
#>  [65,] -0.129094618 -0.943526219 -0.03395335  0.730764674  0.5018936018
#>  [66,] -0.606317268  0.150129648 -0.37448645  0.769124202  0.5402636658
#>  [67,] -0.804763938 -0.150109256  0.37805439 -0.296702762 -0.4168215198
#>  [68,] -0.373596999 -0.662577414 -0.45687865 -0.454293228 -0.3210082068
#>  [69,] -0.919287894 -0.270776833  0.30799794  0.567937707  0.0005838131
#>  [70,] -0.365580670 -0.361432973 -0.22116671 -0.733737464  0.1900140499
#>  [71,] -0.365887445  0.210790634 -0.60712250  0.199130058  0.7746860501
#>  [72,]  0.202926296  0.096302760 -0.19982405  0.015361442  0.8935128930
#>  [73,]  0.071101783 -0.549234623 -0.88694057  0.023539500  0.9595495895
#>  [74,]  0.884732158  0.705084738  0.35390976  0.387633042  0.2359927599
#>  [75,] -0.035973855  0.585425537 -0.01594210  0.454314074 -0.4704862628
#>  [76,]  0.148772403  0.165782432  0.75700074 -0.148071851 -0.7128844485
#>  [77,]  0.913884149  0.484983403 -0.29326168 -0.914584913 -0.9231591322
#>  [78,]  0.809840166 -0.032798985  0.32872662 -0.096851980 -0.4549894454
#>  [79,]  0.402002292 -0.939797211 -0.67358861 -0.036622636 -0.0658116289
#>  [80,] -0.799183173 -0.568318083 -0.69357443 -0.238636856 -0.1219881028
#>  [81,]  0.803289083 -0.748980393 -0.85352689 -0.512034912 -0.1272810916
#>  [82,]  0.627552447 -0.935983239  0.92415101 -0.930679264  0.4065751191
#>  [83,]  0.229486174  0.839497721 -0.24502150 -0.912783538 -0.6615085998
#>  [84,] -0.673507547 -0.350239717 -0.89610593  0.909108363  0.8885369017
#>  [85,]  0.901144647 -0.028794733 -0.76652479 -0.655259015  0.2337668398
#>  [86,] -0.274918561 -0.607346386 -0.50885526 -0.064127439 -0.7510536662
#>  [87,]  0.434886161 -0.378035080 -0.64287987  0.133200034 -0.8844983457
#>  [88,]  0.944274450 -0.853010236  0.99438222 -0.632300172  0.5724394387
#>  [89,] -0.980195760  0.477281678 -0.31727074  0.084140546 -0.7737578633
#>  [90,]  0.449841609 -0.990328905  0.16329698 -0.541304273  0.9320050310
#>  [91,]  0.117617319  0.158157861  0.80467152 -0.821086538 -0.3362066615
#>  [92,]  0.940201316  0.001283437 -0.61478367 -0.614858655  0.8794810511
#>  [93,]  0.655954006  0.717979797  0.97653988  0.140825796  0.3566948911
#>  [94,] -0.412547957  0.965988408 -0.24024592 -0.943371431 -0.2986487066
#>  [95,] -0.637340903  0.117296196 -0.06895661  0.120590899  0.7302806024
#>  [96,] -0.497900045  0.846804722 -0.98198402 -0.940804135  0.0850455905
#>  [97,]  0.886393685  0.863975457  0.24655267 -0.323515721 -0.9422583673
#>  [98,]  0.039003907 -0.422344700 -0.59519857 -0.644701440  0.8951306343
#>  [99,] -0.465227531 -0.643094931  0.02089325  0.873302476  0.8433758128
#> [100,]  0.807938661  0.259027053  0.06766149  0.530538652 -0.5246241465
#> 
#> $y
#>   [1] 0 0 1 0 0 0 1 0 1 1 0 1 0 0 0 1 0 1 1 0 0 1 0 1 0 1 1 0 1 0 1 1 0 0 0 0 0
#>  [38] 1 0 1 0 0 1 0 1 0 0 0 0 1 0 0 1 1 1 1 1 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 1 0
#>  [75] 1 1 0 0 0 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 1 0 0 1 1 0
#>