Last data update: 2014.03.03

R: Monte Carlo sampling for metrology applications
MCdesignR Documentation

Monte Carlo sampling for metrology applications

Description

Creates Monte Carlo sampling designs for metrology applications

Usage

  MCdesign(N,k,distrib,distrib.pars,x)

Arguments

N

The number of design points.

k

The number of the input variables of the numerical code.

distrib

A named list of length k of names of distribution functions associated with the input variables of the code. See Details for defaults.

distrib.pars

A named list of lists of parameters describing the distributions associated with distrib. If distrib is present but distrib.pars is not the function uses the standardized versions of the distributions, see Details.

x

A named list containing the names of the input variables of the numerical code. See Details for defaults.

Details

This function creates a sampling design based on a Monte Carlo simulation.

If distrib or members of it are missing, an error message is displayed. Distributions have to be chosen among uniform(unif), triangular(triang), normal(norm), truncated normal(tnorm), student(t), location-scale student(t.scaled).

If distrib.pars is missing or misspecified, the standardized parameters of the associated distributions in distrib are used for all the variables in x:

unif : min=0, max=1

triang : min=0, max=1, mode=0.5

norm : mean=0, sd=1

tnorm : mean=0, sd=1, lower=0, upper=+Inf

t : nu=100

t.scaled : nu=100, mean=0, sd=1

If x or members of it are missing, arbitrary names of the form 'Xn' are applied to the columns of the output table. Names are automatically abbreviated to 15 characters.

Value

A table containing the MC design with margins in distrib.

Author(s)

Severine Demeyer severine.demeyer@lne.fr

Examples

  
  N<- 100
  k<- 4
  x<- list("X1","X2","X3","X4")
  distrib<- list("norm","norm","unif","t.scaled")
  distrib.pars<- list(list(0,2),list(0,1),list(20,150),list(2,0,1))
  MCdesign(N,k,distrib,distrib.pars,x)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ATmet)
Loading required package: DiceDesign
Loading required package: lhs
Loading required package: metRology

Attaching package: 'metRology'

The following objects are masked from 'package:base':

    cbind, rbind

Loading required package: msm
Loading required package: sensitivity
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ATmet/MCdesign.Rd_%03d_medium.png", width=480, height=480)
> ### Name: MCdesign
> ### Title: Monte Carlo sampling for metrology applications
> ### Aliases: MCdesign
> ### Keywords: ~kwd1 ~kwd2
> 
> ### ** Examples
> 
>   
>   N<- 100
>   k<- 4
>   x<- list("X1","X2","X3","X4")
>   distrib<- list("norm","norm","unif","t.scaled")
>   distrib.pars<- list(list(0,2),list(0,1),list(20,150),list(2,0,1))
>   MCdesign(N,k,distrib,distrib.pars,x)
             X1          X2        X3           X4
1    1.24218491  1.76287517  53.24972 -1.250148131
2   -0.15329330 -1.07814849  56.04057 -0.005311875
3    0.34676988  0.77851239  89.20934  1.826269593
4   -3.40727968  2.15972232  59.77379  2.099142255
5    2.31760865  0.14724025  70.69417 -1.596816323
6   -3.08167751  0.32742703  65.86774  0.499030102
7    1.32851898 -0.92415868  83.02511 -1.945695637
8    4.09418216 -1.79005843  75.18160  0.620637608
9    7.12814008  0.53956513 138.11064 -0.278075525
10   1.88332711 -1.56543725  29.56898  0.521127012
11   1.97439582  0.68136332 127.23958  0.163288424
12  -2.33006117 -0.68289126  99.80069  2.908074126
13  -0.16709511 -0.86368605 119.30860 -0.369914378
14  -2.13010925 -1.99428894  75.14097 -0.619601195
15  -0.20688803 -0.85903664 107.64385  0.045505476
16  -2.33163986 -0.76057900  99.89781 -0.251509814
17   0.27425766 -2.37365630 135.71798  0.069336794
18   1.08861047  0.33869923  89.73289 -1.056601798
19   1.87344634 -0.62629791  85.82851  1.368662348
20   0.42412197 -1.17512081 147.88274 -1.224961947
21   3.31241243  1.51327364  64.24597  0.891704018
22   2.14986208 -0.04037350  64.37908 -0.801856294
23   0.97385315 -0.57031394  40.76443  0.003181979
24   2.26437921  0.61772520 119.03465  1.498861641
25   0.98407890  0.36050004 134.34145 -1.053926007
26   0.57271575  0.65192473 108.70197  0.159895622
27   2.44199764  0.39732418  73.13044 -0.209042283
28  -2.11756118  0.30920543  54.85679  0.084968333
29  -1.20445086 -0.54365054  42.67627 -0.209559508
30  -1.82122733  0.85867754 123.22291  0.494558695
31   0.95482005  2.09026906 144.90931 -1.246785767
32  -1.36014961 -1.16755590  46.44859 -2.649633754
33  -1.39928047 -1.17690235 112.35829 -1.377770308
34   3.23603916  0.04456069 107.37909 -1.648504397
35   0.20183967 -1.11279115  52.49385 -0.207227301
36  -1.89581663  0.10742765  55.09534  0.480838792
37  -1.39910817  0.26900180  42.00210 -0.963727781
38  -4.61134901  0.95523108  35.39366 -0.905428991
39   0.32871105 -1.03910307  49.47020 -0.318421454
40  -0.71794307 -0.57358048 116.80289 -1.500513173
41  -1.22710254 -0.60629380 121.32624  0.164892589
42   4.71820944  0.51319277  35.39856 -0.596403087
43   1.14323849  0.13262180  62.41865 -1.497816003
44   4.17271306  0.37389371 114.76926 -0.135019765
45   0.78046522  2.27457524  60.76311 -0.484552710
46   1.80275860 -0.42648072 144.22668  0.480712476
47  -1.16803534 -0.53698191  26.57289 -0.094289721
48   1.76277174  0.92448150  44.60110 -0.741947666
49   0.43430538  1.08656104  54.05102 -0.078694893
50   1.00128277 -1.69169602 146.64005  0.510603415
51   3.87615030 -0.79570399  51.64869 13.100392984
52   0.57794692 -1.96767618  67.94757 -1.306180861
53  -0.42278949 -0.08134621 111.42918  1.604240203
54  -2.44765110  0.14175425  21.34965 -2.605357157
55  -1.36033209  0.59726446 145.82158 -2.600765166
56   2.55457076  0.98989529  79.95639 -0.149008074
57  -1.29369759 -1.00029550  28.24514 -0.273634578
58  -0.28181882  0.04231831  59.71688 -1.716862988
59   0.20191851 -1.22053351  50.38145  1.452621840
60  -2.76660613 -1.11505558 139.91846 -0.428736992
61  -1.35691329  0.89341470  20.58763  2.918520869
62  -3.77929979  1.20396947 121.34902  0.441150095
63   0.86244058 -1.71656663 114.75942 -2.137618018
64   1.56135730 -0.15748854 142.88113  3.307845190
65   1.14157757 -0.65891701  91.50367  6.001980109
66   0.95683248  0.98843379  57.05834 -0.021428968
67  -0.00596739 -1.99022289  65.34190  0.987271269
68  -2.26672087  0.60093673 127.30009 -0.404135952
69  -2.96041651  0.10310664  58.97433  0.994750916
70   0.78660437 -0.23214962  83.45037 -2.682315397
71  -0.08965698  1.49362282 121.09289 -0.556886176
72  -0.23394961  0.13223087 130.84245  0.307234341
73  -3.53492048  0.88583371  51.13679 -0.144560342
74  -3.74064151  1.27940240 117.82103  0.978776187
75  -3.47895467  0.08558895 133.38249  0.720147341
76   1.59379562 -0.14619593  96.68147  0.405684795
77   0.86984597  1.17729676  27.36262  1.239708911
78   3.16612024  0.08197560 112.81203  0.975557114
79  -2.25642562  0.66411612  50.62852  1.966950568
80  -0.01753205 -1.46440673  21.07896 -0.364887437
81   1.49119707  0.47607476 138.60675 -5.295548431
82  -1.92596048 -1.65646456  53.64103 -0.126890879
83  -2.20525376  0.01677258 146.29843  1.974077525
84   0.88499899 -1.06220964  41.86338 -2.174961150
85   0.78180702  0.25764924  46.12225 -0.279012018
86  -1.44131133 -0.62906304 104.93276 -0.995994582
87   1.33336916 -1.25356846  64.21855  0.446415442
88   2.49500227  1.70002051  73.50679  1.341713681
89   0.87054993  0.08520848  58.01354 -0.837667394
90   0.44219181 -0.91777134  83.47053  2.142719855
91   2.62073183 -0.59251151 115.65755  3.711711077
92   1.49963575  0.51041193  47.49121  0.270258924
93  -0.73953612  0.50450319 121.84258  0.438234241
94   1.11695783  0.33217526 136.31430  0.669972111
95  -0.96140106 -0.82875876 144.71523 -1.835189469
96  -3.46147585 -1.08962611 128.29275  0.336367711
97   3.18417318  1.49984351 110.73497 -0.084675334
98  -3.15807611  1.66066926  90.01682 -0.263943527
99  -2.09097478 -0.50346570  89.31546 -0.171195318
100  1.74261831 -1.24155894  31.33275 -0.056365007
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>