[q-lang-cvs] qcalc/examples eds-example.qcalc,1.1,1.2
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-11-30 22:38:41
|
Update of /cvsroot/q-lang/qcalc/examples In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv482 Modified Files: eds-example.qcalc Log Message: latest eds-example.qcalc from Eddie Rucker Index: eds-example.qcalc =================================================================== RCS file: /cvsroot/q-lang/qcalc/examples/eds-example.qcalc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** eds-example.qcalc 26 Nov 2007 21:31:53 -0000 1.1 --- eds-example.qcalc 30 Nov 2007 22:38:38 -0000 1.2 *************** *** 1,4 **** ! // qcalc 1.0, created Mon Nov 26 22:17:41 2007 -*-Q-*- -*- coding: UTF-8 -*- ! // [((0,0),"Take the gamma of B1:"),((0,1),"4.3"),((0,2),"gamma B1 ="),((0,3),"= gamma 4.3"),((1,0),"Factorial is based on gamma:"),((1,1),"8"),((1,2),"factorial B2 ="),((1,3),"= factorial B2"),((3,0),"How many ways can we choose"),((3,1),"Size of group:"),((3,2),"8"),((3,3),"Answer:"),((3,4),"= permutations C4 C5"),((4,0),"some elements from a set when order"),((4,1),"Number to choose:"),((4,2),"4"),((5,0),"is important."),((7,0),"How many ways can we choose"),((7,1),"Size of group:"),((7,2),"8"),((7,3),"Answer:"),((7,4),"= combinations C8 C9"),((8,0),"some elements from a set when order"),((8,1),"Number to choose:"),((8,2),"4"),((9,0),"is *not* important."),((11,0),"Binomial Distribution"),((11,1),"Times coin tossed:"),((11,2),"3"),((11,3),"Answer:"),((11,4),"= binomialDist C12 C13 C14"),((12,0),"A coin is tossed C12 times. What is"),((12,1),"Number of Heads:"),((12,2),"2"),((13,0),"the probability of getting exactly "),((13,1),"Prob. of a Head:"),((13,2),".5"),((14,0),"C13 heads"),((16,0),"Dates"),((16,1),"Values"),((16,2),"Percent Change"),((17,0),"2000"),((17,1),"10"),((18,0),"2001"),((18,1),"15"),((18,2),"= 100*percentChange B18 B19"),((19,0),"2002"),((19,1),"12"),((19,2),"= 100*percentChange B19 B20"),((20,0),"2003"),((20,1),"16"),((20,2),"= 100*percentChange B20 B21"),((21,0),"2004"),((21,1),"19"),((21,2),"= 100*percentChange B21 B22"),((23,0),"Given a set of numbers"),((23,1),"Numbers"),((24,0),"we can find the following:"),((24,1),"3"),((25,1),"2"),((26,1),"4"),((27,1),"5"),((28,1),"3"),((29,1),"4"),((30,1),"2"),((31,1),"3"),((32,1),"2"),((33,0),"Mean:"),((33,1),"= mean B25:B33"),((34,0),"Mode:"),((34,1),"= mode (sort (<) B25:B33)"),((35,0),"Median:"),((35,1),"= median B25:B33"),((36,0),"Lower Quartile:"),((36,1),"= lowerQuartile B25:B33"),((37,0),"Upper Quartile:"),((37,1),"= upperQuartile B25:B33"),((38,0),"Range:"),((38,1),"= range B25:B33"),((39,0),"Population Variance:"),((39,1),"= populationVariance B25:B33"),((40,0),"Population Standard Deviation:"),((40,1),"= populationSTD B25:B33"),((41,0),"Sample Variance:"),((41,1),"= sampleVariance B25:B33"),((42,0),"Sample Standard Deviation:"),((42,1),"= sampleSTD B25:B33"),((44,0),"Find outliers of a group"),((44,1),"Numbers"),((45,1),"1"),((46,1),"30"),((47,1),"3"),((48,1),"-20"),((49,1),"5"),((50,1),"6"),((51,1),"7"),((52,0),"outliers = "),((52,1),"= outliers (sort (<) B46:B52)"),((54,0),"Regression"),((54,1),"X"),((54,2),"Y"),((55,0),"Find the best fitting line for the"),((55,1),"1"),((55,2),"4"),((56,0),"points to the right."),((56,1),"2"),((56,2),"6"),((57,1),"3"),((57,2),"7"),((58,1),"4"),((58,2),"9"),((59,1),"5"),((59,2),"12"),((60,1),"7"),((60,2),"13"),((62,0),"Least Squares:"),((62,1),"= regression B56:B61 C56:C61"),((63,0),"Value of regression at point B63"),((63,1),"9"),((63,2),"= regression B56:B61 C56:C61 B64"),((64,0),"correlation of coefficient"),((64,1),"= correlation B56:B61 C56:C61"),((65,0),"SSE"),((65,1),"= _SSE B56:B61 C56:C61"),((66,0),"MSE"),((66,1),"= _MSE B56:B61 C56:C61"),((68,0),"Assuming a Normal distribution"),((69,0),"Mean:"),((69,1),"30"),((70,0),"Standard Deviation:"),((70,1),"5"),((71,1),"23"),((71,2),"41"),((72,0),"Probability X is between B71 and C71"),((72,1),"= normal (zScore B72 B70 B71) (zScore C72 B70 B71)"),((73,0),"Probability X is above B71"),((73,1),"= normalAbove (zScore B72 B70 C72)"),((74,0),"Probability X is below B71"),((74,1),"= normalBelow (zScore B72 B70 B71)")] // [] // [(0,380),(1,181),(2,164),(3,117),(4,117)] --- 1,4 ---- ! // qcalc 1.0, created Mon Nov 5 14:55:11 2007 -*-Q-*- -*- coding: UTF-8 -*- ! // [((0,0),"Take the gamma of B1:"),((0,1),"4.3"),((0,2),"gamma B1 ="),((0,3),"= gamma 4.3"),((1,0),"Factorial is based on gamma:"),((1,1),"8"),((1,2),"factorial B2 ="),((1,3),"= factorial B2"),((3,0),"How many ways can we choose"),((3,1),"Size of group:"),((3,2),"8"),((3,3),"Answer:"),((3,4),"= permutations C4 C5"),((4,0),"some elements from a set when order"),((4,1),"Number to choose:"),((4,2),"4"),((5,0),"is important."),((7,0),"How many ways can we choose"),((7,1),"Size of group:"),((7,2),"8"),((7,3),"Answer:"),((7,4),"= combinations C8 C9"),((8,0),"some elements from a set when order"),((8,1),"Number to choose:"),((8,2),"4"),((9,0),"is *not* important."),((11,0),"Binomial Distribution"),((11,1),"Times coin tossed:"),((11,2),"3"),((11,3),"Answer:"),((11,4),"= binomialDist C12 C13 C14"),((12,0),"A coin is tossed C12 times. What is"),((12,1),"Number of Heads:"),((12,2),"2"),((13,0),"the probability of geting exactly "),((13,1),"Prob. of a Head:"),((13,2),".5"),((14,0),"C13 heads"),((16,0),"Dates"),((16,1),"Values"),((16,2),"Percent Change"),((17,0),"2000"),((17,1),"10"),((18,0),"2001"),((18,1),"15"),((18,2),"= 100*percentChange B18 B19"),((19,0),"2002"),((19,1),"12"),((19,2),"= 100*percentChange B19 B20"),((20,0),"2003"),((20,1),"16"),((20,2),"= 100*percentChange B20 B21"),((21,0),"2004"),((21,1),"19"),((21,2),"= 100*percentChange B21 B22"),((23,0),"Given a set of numbers"),((23,1),"Numbers"),((24,0),"we can find the following:"),((24,1),"3"),((25,1),"2"),((26,1),"4"),((27,1),"5"),((28,1),"3"),((29,1),"4"),((30,1),"2"),((31,1),"3"),((32,1),"2"),((33,0),"Mean:"),((33,1),"= mean B25:B33"),((34,0),"Mode:"),((34,1),"= mode (sort (<) B25:B33)"),((35,0),"Median:"),((35,1),"= median B25:B33"),((36,0),"Lower Quartile:"),((36,1),"= lowerQuartile B25:B33"),((37,0),"Upper Quartile:"),((37,1),"= upperQuartile B25:B33"),((38,0),"Range:"),((38,1),"= range B25:B33"),((39,0),"Population Variance:"),((39,1),"= populationVariance B25:B33"),((40,0),"Population Standard Deviation:"),((40,1),"= populationSTD B25:B33"),((41,0),"Sample Variance:"),((41,1),"= sampleVariance B25:B33"),((42,0),"Sample Standard Deviation:"),((42,1),"= sampleSTD B25:B33"),((44,0),"Find outliers of a group"),((44,1),"Numbers"),((45,1),"1"),((46,1),"30"),((47,1),"3"),((48,1),"-20"),((49,1),"5"),((50,1),"6"),((51,1),"7"),((52,0),"outliers = "),((52,1),"= outliers (sort (<) B46:B52)"),((54,0),"Regression"),((54,1),"X"),((54,2),"Y"),((55,0),"Find the best fitting line for the"),((55,1),"1"),((55,2),"4"),((56,0),"points to the right."),((56,1),"2"),((56,2),"6"),((57,1),"3"),((57,2),"7"),((58,1),"4"),((58,2),"9"),((59,1),"5"),((59,2),"12"),((60,1),"7"),((60,2),"13"),((62,0),"Least Squares:"),((62,1),"= regression B56:B61 C56:C61"),((63,0),"Value of regression at point B63"),((63,1),"9"),((63,2),"= regression B56:B61 C56:C61 B64"),((64,0),"correlation of coefficient"),((64,1),"= correlation B56:B61 C56:C61"),((65,0),"SSE"),((65,1),"= _SSE B56:B61 C56:C61"),((66,0),"MSE"),((66,1),"= _MSE B56:B61 C56:C61"),((68,0),"Assuming a Normal distribution"),((69,0),"Mean:"),((69,1),"30"),((70,0),"Standard Deviation:"),((70,1),"5"),((71,1),"23"),((71,2),"41"),((72,0),"Probability X is between B71 and C71"),((72,1),"= normal (zScore B72 B70 B71) (zScore C72 B70 B71)"),((73,0),"Probability X is above B71"),((73,1),"= normalAbove (zScore B72 B70 C72)"),((74,0),"Probability X is below B71"),((74,1),"= normalBelow (zScore B72 B70 B71)")] // [] // [(0,380),(1,181),(2,164),(3,117),(4,117)] *************** *** 20,25 **** mean, mode, range, sampleVariance, populationVariance, sampleSTD, populationSTD, correlation, integrate, regression, _SXY, _SSE, _MSE, zScore, ! normal, normalBelow, normalAbove, gamma, factorial, permutations, combinations, ! binomialDist, beta, erf, efc; /* remove elements of Y from X (like set difference) --- 20,25 ---- mean, mode, range, sampleVariance, populationVariance, sampleSTD, populationSTD, correlation, integrate, regression, _SXY, _SSE, _MSE, zScore, ! normal, normalBelow, normalAbove, gamma, factorial, permutations, ! combinations, binomialDist, beta, erf, erfc; /* remove elements of Y from X (like set difference) *************** *** 154,158 **** = ((sum (map sqr L)) - (sqr (sum L))/N) / N where N = #L; ! /* population standard of L */ populationSTD L:List = sqrt (populationVariance L); --- 154,158 ---- = ((sum (map sqr L)) - (sqr (sum L))/N) / N where N = #L; ! /* population standard deviation of L */ populationSTD L:List = sqrt (populationVariance L); *************** *** 266,270 **** /* normal A B => probability of P(A<X<B) */ ! normal = integrate normalPDF; normalBelow Z:Real --- 266,270 ---- /* normal A B => probability of P(A<X<B) */ ! normal A B = integrate normalPDF A B; normalBelow Z:Real |