StatsCmd
Data Fit Commands
Data Fit Commands - commands used to extract data
Stats
This command does linear regression to extract the best fit arrhenius expression for the data set. The command takes a list of data, which consists of x,y pairs. The number of elements in the list is always even. The first value is assumed to be a temperature in degrees centrigrade and the second is the value of the function at that temperature. This is implemented as a tcl script, and the is very similar to the script for Bestline. The only difference is in the data manipulation. The y values when extracted are processed after taking the log. The best fit line then is computed on a semilog plot. The main accumulation loop becomes:
proc Stats {l} { set sumx 0.0 set num 0 #compute the mean of the data foreach pair $l { set sumx [expr $sumx $pair] incr num } set mean [expr $sumx / $num] set std 0 foreach pair $l { set std [expr $std ($pair - $mean)*($pair - $mean)] incr num } set std [expr sqrt( $std / $num )] return "$mean $std" }
The command returns a two member list. The first member is the mean of the distribution and the second is the standard deviation.
FitPearson
This command is similar to stats except that it fits a Pearson distribution function to the data. The command takes a list of data, which consists of x,y pairs. The number of elements in the list is always even, therefore. The data can be taken from a slice command. This is implemented as a tcl script. The return value is a list of 5 parameters. The first is dose (total integrated y value). The next four are the moments of the Pearson and are the range, standard deviation, skewness, and kurtosis. The output of this command feeds directly into BuildProfile.
sigma
This command provides a useful user interface to FitPearson. It takes three parameters. The first is the name of the data field to fit. The second is the material to work in. The final parameter is the background concentration - values below this are ignored. This is implemented as a tcl script.
proc sigma {Dopant chkmat backgrnd} { sel z = $Dopant set origlist [slice $chkmat] set origlist [lindex $origlist 0] set data [list] #build a new shorter list for {set j 0} {$j < [llength $origlist]/2} {incr j} { set dep [lindex $origlist [expr 2*$j]] set val [lindex $origlist [expr 2*$j 1]] if { $val > $backgrnd } { lappend data $dep lappend data $val } } return [FitPearson $data] }
This list is processed in the main loop to eliminate low concentrations. The return is identical to that from FitPearson.
BuildProfile
This command takes Pearson parameters (from FitPearson) and builds a data field that fits those parameters. The command takes two arguments. The first is the name of the new data field to be build. The command creates the data field and values. The second is the list of Pearson parameters in the same order and format as is produced by FitPearson.
Examples
Stats {90 80 100 94 84 87 91 76}
Find the mean and standard deviation of the data. The return is "87.75 5.1082", which means the data has an average of 87.75 and a standard deviation a little above 5.
profile name=Damage infile=$DamageFile set Par [sigma Damage silicon 1.0e16] BuildProfile SmoothDamage $Par
This command set reads in a profile from a file. T This could be from SIMS data or Monte Carlo program. The second command computes the best fit Pearson to the read profile, and looks in silicon only at concentrations above 1016. Finally, a new profile "SmoothDamage" is constructed from the parameters computed. The new data field is a smoothed version of the noisy data, and is better place (usually) to start simulation from.