Skip to content

Code sample 02 bimodal distribution

Yuji Sode edited this page Mar 27, 2018 · 6 revisions

sample codes to fit bimodal distribution

Using interval of 0.3

#bimodal02_sample_regLines.tcl
#test codes for "regLines.tcl"
source ./regLines.tcl;
#bimodal data
set x {0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2};
set y {2 4 8 12 9 16 18 24 28 23 15 10 8 4 0 3 5 8 10 7 14 8 4};
#input data range: 0.3
::regLines::reglines $x $y "reglinesSample[clock seconds]";

1520603057_bmddist
output script is here

Generated random variables using interval of 0.3

1520604859datafreq

Using manual interval

#bimodal_sample_regLines.tcl
#test codes for "regLines.tcl"
source ./regLines.tcl;
#bimodal data
set x {0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2};
set y {2 4 8 12 9 16 18 24 28 23 15 10 8 4 0 3 5 8 10 7 14 8 4};
#input data range: 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 2.5 2.7 2.9 3.1 3.2
::regLines::reglines $x $y "reglinesSample[clock seconds]";

1520317514_bmddist
output script is here

Generated random variables using manual interval

1520318955datafreq