Presentation Day 1- Matlab

Stat 992 - Computational Statistics in MATLAB

DOCUMENT APPENDICES

APPENDIX 1: (MATLAB online help)

  • The Help browser is a Web browser integrated into the MATLAB desktop that displays HTML documents.
  • We can also open the Help browser by typing help browser in the Command Window.

APPEXDIX 2: (MATLAB Graphics)

  • If both x and y are vectors, then the following commands are such that

-plot(y)produces a piecewise linear graphof the elements of y versus the index of the elements of y.

-plot(x,y) produces a graph of y versus x

-xlabel(‘x’) labels the x-axis x

-ylabel(‘y') labels the y-axis y.

-title(‘Plot of y vs x’, ‘FontSize’, 12) give our graph a title whose font size is 12.

-plot(x, y, x,y2, x,y3) produces one graph with three related functions of x, each curve in a different color.

-legend(string, string, string) provides an easy way to identify the individual plots.

  • It is also possible to specify color, line styles, and markers when you plot your data using the plot command

Plot(x,y, ‘color_style_marker’)

wherePlot(x,y, ‘color_style_marker’) is a string containing from one to four characters constructed from a color, a line style, and a marker type:

-Color Strings are ‘c’, ‘m’, ‘y’, ‘r’ , ‘g’, ‘b’, ‘w’, and ‘k’. These correspond to cyan, magenta, yellow, red, green, blue, white, and black.

-Line style string are ‘-’ for solid, ‘- -’, for dashed, ‘:’ for dotted, ‘- .’ dash-dot, ‘ ’ for no line.

-The marker types are ‘+’, ‘o’, ‘ * ’, ‘x’, and the filled marker types are ‘>’, for right triangle, ‘<’ for left triangle, ‘s’ for square, ‘d’ for diamond, ‘^’ for up triangle, ‘v’ for down triangle, ‘p’ for pentagram, ‘h’ for hexagram, and none for no marker.

Therefore, the statement

  • Plot(x, y, ‘ks’) plots black squares at each data point, but does not join the markers with a line. Likewise
  • Plot(x, y, ‘g : +’) plots a green dotted line and places plus sign markers at each data point
  • Other useful plot functions are hist, pie, scatter, semilogx, semilogy, loglog, stairs, stem, plotmatrix, etc.

APPENDIX 3:

isa non-negative and non-decreasing (monotone) function thatis continuous from the right and has left hand limits, with values in [0; 1]; moreover and .

APPENDIX 4: (Proof of Inverse Transform Method)

The generalized inverse satisfies the following:

(since by the inverse method)

(since F is monotonically increasing)

This is the cdf of X. That is, .

Finally,

This completes the proof.