Software Listing: K 1
- multcoef
- License: Shareware

This m-file returns the multinomial coefficient with parameter N at the values in X. Let {X1, X2, . . . , Xk}, k > 1, be a set of random variables, each of which can take the values 0, 1, . . . , n; such that for every set of k nonnegative integers {n1, . . . , nk} whose sum is n, the multinomial coefficient is, C(n;n1,n2,...,nk) = (n1, n2,...,nk)! = (n1 + n2 + ... nk)! --------------------------- . n1! doOCo n2! doOCo . . doOCo nk! It is possible to work with large factorials. It needs to input n-number of trials and x-vector of the interested values. File outputs the multinomial coefficient.
- Publisher: Antonio Trujillo-Ortiz
- Date: 27-05-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- multpdf
- License: Shareware

This m-file returns the multinomial probability density function value with parameters N and P at the values in X. Note that the density function is zero unless X is an integer. Let {X1, X2, . . . , Xk}, k > 1, be a set of random variables, each of which can take the values 0, 1, . . . , n. Suppose there are k nonnegative numbers {p1, p2, . . . , pk} that sum to one, such that for every set of k nonnegative integers {n1, . . . , nk} whose sum is n, P( X1 = n1 and X2 = n1 and . . . and Xk = nk ) = n! ------------------------doOCop1^n1doOCop2^n2doOCo..doOCopk^nk . n1!doOCon2!doOCo..doOConk! Then {X1, X1, .
- Publisher: Antonio Trujillo-Ortiz
- Date: 01-04-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- StuMaxtest
- License: Shareware

This file performs the Stuart-Maxwell's test for all the marginal homogeneity (i.e. across all the categories simultaneously) for each of the two sample times (nominal samples). Obviously, it need a square KxK table. It is a non-parametric statistical test. The test was proposed by Stuart (1955), Maxwell (1970) and Everitt (1977). Stuart-Maxwell's test is asymptotically equivalent to the Bhapkar's test by a n-times value. This because the Bhapkar's test works with the marginal probabilities for category i. Stuart and Maxwell's test interpreted as a Chi-squared value with degrees of freedom df equal to K - 1.
- Publisher: Antonio Trujillo-Ortiz
- Date: 15-04-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- Bowkertest
- License: Shareware

This m-file performs the Bowker's test for symmetry. It is an extension of the McNemar test to a KxK situation. There are now K response categories for the two dependent samples. The null hypothesis is that the probabilities in the square table satisfy symmetry or that there is no sifnificant shift from one response category to another from sample 1 to sample 2. When the null hypothesis of symmetry is true, then B will have a Chi-square distribution with K(K-1) degrees of freedom. This is the basis of the proposed test by Bowker (1948). If K=2, then B simplifies to the McNemar test statistic.
- Publisher: Antonio Trujillo-Ortiz
- Date: 25-03-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- bibdAOV
- License: Shareware

This file computes a balanced incomplete block design [BIBD] analysis of variance. A BIBD is a set X of v >= 2 elements called treatments and a collection of b > 0 subsets of X, called blocks, such that the following conditions are satisfied: - each block consists of exactly k treatments, v > k > 0 - each treatment appears in exactly r blocks, r > 0 - each pair of treatments appear simultaneously in exactly l (lambda) blocks, l > 0. A BIBD must satisfy [constraits]: v*r = b*k = eu = Total number of experimental units for whole experiment r*[k-1] = l*[v-1]) The Linear Model is: x_ij = dlTA + a_i + b_j + e_ij i = 1,.
- Publisher: Antonio Trujillo-Ortiz
- Date: 23-04-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- Ssplitplot
- License: Shareware

This file computes the standard (simple) split-plot design analysis of variance, taking into account the linear model: x_jkl = dlTA + a_j + doDc_k + d_jk + doDT_l + (doDcdoDT)_kl + e_jkl where j = 1,...,a (blocks); k = 1,...,b (factor 1); l = 1,...,c (factor 2); d_jk ~ N[0,var_d] (error main plots); e_jkl ~ N[0,var_e] (error sub-plots). It needs to input the data matrix (size of matrix must be n-by-4; data=column 1, block=column 2,factor 1=column 3, factor 2=column 4)[in some another notations the blocks source also is known as the replicates], and the significance level (default = 0.05). It outputs a complete analysis of variance table.
- Publisher: Antonio Trujillo-Ortiz
- Date: 20-05-2013
- Size: 10 KB
- Platform: Matlab, Scripts
CUMmulative PRODucts across All Permutations of Distinct Column-Indices This function returns the cumulative sum over products of column elements with all permutations of unique and distinct column-indices. The sum excludes automatically products containing elements with common column index values. In addition, any user specified index values in ignoredInd are excluded. (As all permutations of columns are summed, the permutation of the columns of the input array is not important.) For example, cumprodapdci([a,b],[1 7]) for vectors a and b is the sum of sum(a.*b) minus all contributions of a(2)b(2), a(3)b(3) and the user specified ignoredInd of 1 and 7, i.
- Publisher: Hin Kwan Wong
- Date: 02-03-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- displayInline
- License: Shareware

Displays a string inline in the command window, overwriting any output the method previously displayed. Useful to update any displayed string in-place, for example to indicate the the state of a simulation in progress. ----------------------------------- e.g. displayInline; tic; for k = 1:1e6 if mod(k,1000)==0 displayInline(sprintf('test: iteration %d, elapsed time: %g s', k, toc)); end ... RepeatSomeTimeConsumingTask; ... end displayInline(sprintf('test: completed %d iterations (in %g s)', k, toc)); ----------------------------------- A persistent variable 'displayInlineCount' is used to keep track of the length of the previously displayed string, so that it can be erased the next time.
- Publisher: Damith
- Date: 06-06-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- Fit Logistic Curve to a Data Set
- License: Shareware

The method used in this work is based on a tutorial by David Arnold. http://online.redwoods.cc.ca.us/instruct/darnold/diffeq/logistic/logistic.pdf RUN The Logistic.m this will bring up the GUI. 1. Give the x values on a text file in column format 2. Give the y values on a text file in col format 3. 'Plot Initial' Button will plot the distribution 4. 'Find Fit' button will find the best fit 5. 'Reset' will remove the plot (Although I wanted to clean all the fields - did not have time) 5. K, G, Dm are the values in the following equation y = K./(1+exp(-G*(x-Dm))); 6. SSE gives the sum of squred error between the fitted function and the actual data 7.
- Publisher: Varuna De Silva
- Date: 11-04-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- VVAR class: a fast "virtual" variable class for MATLAB.
- License: Shareware

VVAR uses a pre-existing "scratch" file to store variables and can be used to pre-allocate a huge array much faster than using zeros. On a MacBook Pro with 64 bit MATLAB and 4Gb RAM, creating an 8Gb double array with VVAR was 100x faster than using zeros (1.24s vs 122.3s). Upper limits on array size are system and MATLAB version dependent. See the MATLAB documenation. Note that speed improvements are seen only when the array is too large for the available memory and forces virtual memory use. With some caveats, VVAR instances can be used in much the same way as MATLAB primitive array types, e.
- Publisher: Malcolm Lidierth
- Date: 03-06-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- Fixed Point Method
- License: Shareware

The Fixed Point Method is applied to a given function. Convergence conditions are as followed: f(xa)=0 (=) xa=g(xa) => xa[n+1]=g(xn), n=0,1,.. Error majoration: |e(xk)| <= L^k/(1-L)*|x1-xo| Choice for inicial aproximation x0: x0 = middle point of [a,b] = (a+b)/2.
- Publisher: T. R
- Date: 15-05-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- Forward Stepwise Regression Algorithm
- License: Shareware

Forward stepwise model selection algorithm: Variables are sequentially added to the active set of variables. The procedure does not involve any tests of statistical significance of the potential covariates; instead, it produces a ranking that corresponds to the order of variables as they enter the active set. The function can be provided with a dataset of size (K+1)xN (N observations, K predictors, one explained variable)..
- Publisher: Marco B.
- Date: 01-01-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- copyaxes
- License: Shareware

COPYAXES copy an axes object into another axes object COPYAXES(SOURCE, DESTINATION) - copy axes from SOURCE to DESTINATION COPYAXES(..., isInSubplot) - if the destination is in a subplot figure (default false). EXAMPLE: Copy a axes with plot plot([1:0.1:2*pi], sin([1:0.1:2*pi])); title('sin function') xlabel('x') ylabel('sin(x)') ax = gca; figure; ax_new = axes; copyaxes(ax, ax_new) EXAMPLE: Copy a axes with bar bar(rand(10,5),'stacked'); title('bar stacket function') xlabel('x label') ylabel('y label') ax = gca; figure; ax_new = axes; copyaxes(ax, ax_new) EXAMPLE: Copy a axes and legend (the legend is an axes object) plot([1:0.
- Publisher: Mar Callau-Zori
- Date: 01-04-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- Small size linear solver
- License: Shareware

Solve multiple (2x2) or (3x3) linear systems: A(:,:,k)*X(:,:,k) = B(:,:,k) for k=1,2,...,N The method used here is basic cofactor/determinant. DISADVANTAGE: This method may be less accurate than Matlab backslash (using in for-loop) when the matrices are ill-conditioned. ADVANTAGE: for a large number of systems - the speed-up is about 15-30 fold..
- Publisher: Bruno Luong
- Date: 09-06-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- Routh's array in symbolic way
- License: Shareware

[M L] = routh_hurwitz(P,N) This function gives the Routh's array from a numerical or SYMBOLIC polynomial and includes two special cases: (1) the first element of the row is zero; (b) a row of zeros. P Numerical or symbolic array of coeficients. In the case of symbolic variables it is necesarry to define them as: >> syms a b c ... N Digits to be considered zero a number. E.g, for N=5, 10^(-5) is considered a zero. By default, N=10 M Routh's array without any simplification (e.g., with epsilon notation) L Simplified first column of Routh's array with simplification (e.g., using the limit when epsilon tends to zero) that determines the number of roots in the right-half of the s-plane: the number of changes of signs in L Examples: 1.
- Publisher: Carlos Mario Velez Sanchez
- Date: 13-05-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- Recursive Integer Guessing Game
- License: Shareware

A recursive algorithm that queries an objective function to guess an unknown integer. An integer guessing 'game' for a function `isleq', that returns true for all values less than or equal to a mystery number. Syntax: z=guessgame(isleq,n,k) In tertiary function notation: g(n,k) = | k==0 :: isleq(n) ? n : n+1; | k>0 :: isleq(n+(2^k)-1) ? g(n,k-1) : g(n+2^k,k-1); | k<0 :: isleq(n+(2^(-k))-1) ? g(n,(-k)-1) : g(n+(2^(-k)),k-1); g(n,-k) for -k negative refers to an unbounded search [n,inf] with current search depth up to (n+2^(-k)-1) : e.g. g(15,-4) denotes [15,30]. g(n,k) for k positive refers to a search over the interval [n,(n+(2^(k+1))-1)] : e.
- Publisher: Adam Gripton
- Date: 22-06-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- Tromino
- License: Shareware

Rules: 1. Use L-Shaped Trominoes to fill 4x4 Checker Board. 2. Use directions for [Linear] or (Angular) movements. about: 1. The inspiration of this game is from Mathematical Problem/Puzzle. 2. This Math Problem is very famous and mostly used in Mathematical Induction and also in Algorithm Lectures (hence Number Theory). 3. The choosen board is 4x4 as it is very critical/important step in Mathematical Induction. 4. Other higher levels of the Puzzle will be repetition of 4x4 levels and hence not much of fun. 5. The intention of the game is to appreciate the capability of Mathematical Induction (not GUI of the game) for problems that look very complicated but results in simple solution.
- Publisher: Krishna Lalith
- Date: 04-01-2013
- Size: 31 KB
- Platform: Matlab, Scripts
- cwaitbar.m
- License: Shareware

An extension/generalization of the MATLAB's WAITBAR function. Used when you want to show progress in "nested computations". Supports different coloring of bars other than the default red color. See example below on usage. %%%%% CWAITBAR Display compound wait bar. H = CWAITBAR(X,TITLE) creates and displays wait bars of fractional lengths X and with one title string TITLE. The handle to the compound waitbar figure is returned in H. X values should be between 0 and 1. Each subsequent call to cwaitbar, CWAITBAR([BAR X]), extends the length of the bar BAR to the new position X. The first bar is the topmost bar and is BAR = 1 which corresponds to the outermost loop.
- Publisher: Rasmus Anthin
- Date: 23-04-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- hist2 for the people
- License: Shareware

2D histogram: Extract the number of joint events - (x,y) data value pairs that fall in each bin of the grid defined by xedges and yedges. Uses: [N,BIN] = HISTD(X,EDGES) which returns 1) N is a LENGTH(EDGES) vector, N(k) will count the value X(i) if EDGES(k) <= X(i) < EDGES(k+1). The last bin will count any values of X that match EDGES(end). 2) an index matrix BIN. If X is a vector, N(K) = SUM(BIN==K). BIN is zero for out of range values. If X is an m-by-n matrix, then, for j=1:n, N(K,j) = SUM(BIN(:,j)==K); end Please, see the notes to HISTD too. N.B. It is always a better idea to use the HISTC MEX (a much faster compiled C code) if you have it, then just replace the HISTD with HISTC in all calls contained in the hist2() .
- Publisher: Nedialko Krouchev
- Date: 06-04-2013
- Size: 10 KB
- Platform: Matlab, Scripts
- N-Dimensional Histogram Count
- License: Shareware

HISTCND is similar to HISTC, but creates a histogram with any number of dimensions. N = HISTCND(X,Y,Z,... XEDGES,YEDGES,ZEDGES,... ) where N is a histogram count with dimensions length(XEDGES) x length(YEDGES) x length(ZEDGES) ... If XEDGES, YEDGES, etc. are monotonically increasing and non-NaN, a data point is assigned to bin N(i,j,k,...) if XEDGES(i) <= X < XEDGES(i+1) YEDGES(j) <= Y < YEDGES(j+1) ZEDGES(k) <= Z < ZEDGES(k+1) .... Note: data outside the ranges of the EDGES vectors are excluded from the histogram, and not placed in the first or last bins. An example: x=rand(100,100); y=rand(100,100); xedges=0:0.
- Publisher: Mathew
- Date: 15-03-2013
- Size: 10 KB
- Platform: Matlab, Scripts





