Hei!
Miten Survolla voisi simuloida kolmiojakauman mukaisesti jakautuneita arvoja? Kolmiojakauman tiheysfunktio on f(x) = x, 0 < x <= 1; 2 - x, 1 <= x <= 2; 0 muualla tai lyhyesti: f(x) = 1 - abs(x - 1), 0 <= x <= 2 ja se voidaan piirtää GPLOT-kaaviona: HEADER=Kolmiojakauma GPLOT Y(X)=1-abs(X-1) INTEGRAL=1 YSCALE=0(0.25)2 XSCALE=0(0.25)2 X=[RED][line_width(4)],0,2.0.1 Terveisin Esko |
Administrator
|
Mielestäni tämä on ehkä helpoin tapa luoda tuota kolmiojakaumaa Survolla:
FILE CREATE KOLMIO FIELDS: 1 N 8 X END FILE INIT KOLMIO,1000000 VAR X=rand(2016)+rand(2016) TO KOLMIO "Tarkistus": STAT KOLMIO,CUR+1 / CLASSMAX=101 Basic statistics: KOLMIO N=1000000 Variable: X ~rand(2016)+rand(2016) min=0.001812 in obs.#889721 max=1.998832 in obs.#80332 mean=1.000034 stddev=0.408072 skewness=-0.001015 kurtosis=-0.598024 lower_Q=0.707438 median=0.999668 upper_Q=1.292998 up.limit f % *=1024 obs. class width=0.05 0.05 1231 0.1 * 0.1 3725 0.4 *** 0.15 6336 0.6 ****** 0.2 8810 0.9 ******** 0.25 11156 1.1 ********** 0.3 13724 1.4 ************* 0.35 16354 1.6 *************** 0.4 18691 1.9 ****************** 0.45 21221 2.1 ******************** 0.5 23663 2.4 *********************** 0.55 26197 2.6 ************************* 0.6 28427 2.8 *************************** 0.65 31392 3.1 ****************************** 0.7 33678 3.4 ******************************** 0.75 36272 3.6 *********************************** 0.8 38790 3.9 ************************************* 0.85 41189 4.1 **************************************** 0.9 44058 4.4 ******************************************* 0.95 46419 4.6 ********************************************* 1 48993 4.9 *********************************************** 1.05 48445 4.8 *********************************************** 1.1 46317 4.6 ********************************************* 1.15 43890 4.4 ****************************************** 1.2 40961 4.1 **************************************** 1.25 38999 3.9 ************************************** 1.3 36121 3.6 *********************************** 1.35 33651 3.4 ******************************** 1.4 31182 3.1 ****************************** 1.45 28751 2.9 **************************** 1.5 26747 2.7 ************************** 1.55 23730 2.4 *********************** 1.6 21102 2.1 ******************** 1.65 18677 1.9 ****************** 1.7 16227 1.6 *************** 1.75 13679 1.4 ************* 1.8 11350 1.1 *********** 1.85 8513 0.9 ******** 1.9 6344 0.6 ****** 1.95 3698 0.4 *** 2 1290 0.1 * |
Hei!
Kiitos, tuo onkin yllättävän helppo tapa. Se muistuttaa kahden nopan heiton silmälukua Survolla Terveisin Esko |
Administrator
|
Hei Esko,
Niinhän se muistuttaa - skaala vain on eri: FILE MAKE NOPAT,1,1000000,summa,8 noppa1=int(6*rand(2016)+1) VAR summa=noppa1+noppa2 TO NOPAT noppa2=int(6*rand(2016)+1) STAT NOPAT,CUR+2 Basic statistics: NOPAT N=1000000 Variable: summa ~noppa1+noppa2 min=2 in obs.#30 max=12 in obs.#9 mean=6.999337 stddev=2.414542 skewness=-0.000947 kurtosis=-0.634857 lower_Q=5 median=7 upper_Q=9 summa f % *=4096 obs. 2 27699 2.8 ****** 3 55891 5.6 ************* 4 83066 8.3 ******************** 5 110886 11.1 *************************** 6 139197 13.9 ********************************* 7 166792 16.7 **************************************** 8 138845 13.9 ********************************* 9 110696 11.1 *************************** 10 83970 8.4 ******************** 11 55374 5.5 ************* 12 27584 2.8 ****** |
Hei!
No niinpä, nopanheitotkin voidaan tehdä ilman noppia Terveisin Esko |
Free forum by Nabble | Edit this page |