CALC 1 Home Documentation Home Contact

# CALC 1 c1 Probability and Statistics Functions

CALC 1 functions follow the spreadsheet functions of the same name in most cases. For statistical distributions we are adding functions similar to R Language functions.

## Array Based and Other Statistics Functions

Function Description Example Result
avedev(list) The average of the absolute deviations of values from their mean. c1.avedev(listx) for the data set {2, 2, 3, 4, 14} 3.600
average(list) The average of the values of the list. c1average(listx) for the data set {2, 2, 3, 4, 14} 5.0000
combin(totalItems, groupSize) The number of combinations of a subset of items. c1combin(52, 5) 2598960
correl(listx, listy) The correlation coefficient between two data sets. c1correl(listy, listx)
covar(listx, listy) The covariance of the product of paired deviations. c1.covar(listy, listx)
devsq(list) The sum of squares of deviations from the mean. c1.devsq(listx) for the data set {2, 2, 3, 4, 14} 104.0000
geomean(list) The geometric mean of the values of the list. c1.geomean(listx) for the data set {2, 2, 3, 4, 14} 3.6768
harmean(list) The harmonic mean of the values of the list. c1.harmean(listx) for the data set {2, 2, 3, 4, 14} 3.0216
kurt(list) The kurtosis of the values of the list, a measure of how peaked or flat a distribution is. c1.kurt(listx) for the data set {2, 2, 3, 4, 14} 4.4630
median(list) The median of the values of the list. c1.median(listx)
mode(list) The mode is the value that appears most often in a set of data. c1.mode(listx) for the data set {2, 2, 3, 4, 14} 2.0000
permut(objects, elements) The number of permutations for a given number of objects. c1.permut(52, 5) 311875200
poisson(events, average, type) Returns the probability that a specific number of events will occur using the Poisson distribution. Type 1= CDF, 0 = PMF. c1.poisson(5, 4.25, 0) 0.16482
stdev(list) The sample standard deviation of the values of the list. c1.stdev(listx) for the data set {2, 2, 3, 4, 14} 5.0990
stdevp(list) The population standard deviation of the values of the list. c1.stdevp(listx) for the data set {2, 2, 3, 4, 14} 4.5607
sum(list) Sum of the values of the list. c1.sum(listx) for the data set {2, 2, 3, 4, 14} 25.0000
sumprod(list, list) The sum of the products of the values of the lists. c1.sumprod(listy, listx)
sumsq(list) The sum of the squares of the values of the list. c1.sumsq(listx) for the data set {2, 2, 3, 4, 14} 229.0000
var(list) The sample variance of the values of the list. c1.var(listy) for the data set {2, 2, 3, 4, 14} 26.0000
varp(list) The population variance of the values of the list. c1.varp(listy) for the data set {2, 2, 3, 4, 14} 20.8000

## Statistical Distributions

Function Description Example Result
beta(x, alpha, beta) The beta distribution. c1.betadist(0.5, 1, 2) 0.75
betainv(prob, alpha, beta) The beta distribution inverse. c1.betainv(0.99, 1, 2) 0.9
binomdist(success, trials, probSuccess, formType) Calculates the probabilities for a binomial distribution. c1binomdist(3, 98, 0.04, 0) 0.2
chidist(x, df) Calculates the Chi-squared distribution. c1.chidist(5, 2); 0.08208
chiinv(prob, df) Calculates the Chi-squared distribution inverse. c1.chiinv(0.995, 10); 2.156
fdist(x, df-num, df-denom) The f distribution. c1.fdist(0.77, 1, 2); 0.4727
finv(prob, df-num, df-denom) The f distribution inverse. c1.finv(0.77, 1, 2); 0.1117
gammadist(x, alpha, beta, formType) The gamma distribution. formType=true, CDF. formType=false, PDF c1.gammadist(0.8, 1, 2, true) 0.3297
normdist(x, mean, stdev, mode) Returns the density function or the normal cumulative distribution. c1.normdist(70, 63, 5, 1) 0.92
norminv(x, mean, stdev) Returns the inverse of the normal cumulative distribution. c1.norminv(0.9192,63,5) 70
normsdist(x) Returns the standard normal cumulative distribution function. c1.normsdist(1.0) 0.84
normsinv(x) Returns the inverse of the standard normal cumulative distribution. c1.normsinv(0.8413) 1
poisson(events, average, type) Returns the probability that a specific number of events will occur using the Poisson distribution. Type 1= CDF, 0 = PMF. c1.poisson(5, 4.25, 0) 0.16482
tdist(x,df,tails) Returns the probability from the Student’s t‑distribution. tails = 1 or 2. c1.tdist(1.86, 8.0, 1) 0.04996
tinv(prob, df) Returns the t value (a function of the probability and degrees of freedom) from the Student’s t‑distribution. c1.tinv(0.010, 8.0) 3.355
weibull(x, alpha, beta, formType) The weibull distribution. formType=true, CDF. formType=false, PDF c1.weibull(1.5, 0.5, 2, false) 0.12142

## Statistical Distributions (R Style)

These are similar, but not identical to the R language functions.
The parameter, mean=0 (for example) the default value for the mean parameter.
JavaScript does not support pnorm(2, lowerTail=false).

Distribution PDF CDF INV Rand
Normal dnorm(x, mean=0, sd=1)
pnorm(q, mean=0, sd=1, lowerTail=true)
qnorm(p, mean=0, sd=1, lowerTail=true) rnorm(n, mean=0, sd=1)
Student's t dt(x, df)
pt(q, df, ncp, lowerTail=true)
Note: ncp is currently ignored.
qt(p, df, ncp, lowerTail=true)
Note: ncp is currently ignored.

F df(x, df1, df2)

Uniform

runif(n, min=0, max=1)

## Curve Fitting Functions

Function Description Example Result
bfexp(listy, listx) The B factor of the exponential regression for the lists.
bfexpnt(listy,listx) The B factor of the exponent regression for the lists.
bfinv(listy,listx) The B factor of the inverse regression for the lists.
bfln(listy, listx) The B factor of the logarithmic regression for the lists.
bfpwr(listy, listx) The B factor of the power regression for the lists.
correlexp(listy, listx) The correlation coefficient between two data sets using ln(y).
correlexpnt(listy,listx) The correlation coefficient between two data sets using ln(y).
correlinv(listy,listx) The correlation coefficient between two data sets using 1/x.
correlln(listy, listx) The correlation coefficient between two data sets using ln(x).
correlpwr(listy, listx) The correlation coefficient between two data sets using ln(x) and ln(y).
forecast(xval, listy, listx) Extrapolates future values based on existing x and y values using the linear regression model. c1.forecast(70,listy, listx)
intercept(listy, listx) Calculates the point at which a line will intersect the y values by using known x values and y values. c1.intercept(listy, listx)
maxcorrelsqcurvefit(listy,listx) Returns the curve fit with the maximum correlation squared. 0=error, 1=LIN, 2=LN, 3=EXP, 4=PWR, 5=EXPNT, 6=INV.
mfexp(listy, listx) The M factor of the exponential regression for the lists.
mfexpnt(listy,listx) The M factor of the exponent regression for the lists.
mfinv(listy,listx) The M factor of the inverse regression for the lists.
mfln(listy, listx) The M factor of the logarithmic regression for the lists.
mfpwr(listy, listx) The M factor of the power regression for the lists.
slope(listy, listx) The slope of the linear regression line for the lists. c1.slope(listy, listx)