The updates for Statistics in Maple 2015 include several new commands, as well as added support in the context menu for matrix data sets, and new and improved visualizations.
Lowess (locally weighted scatterplot smoothing) is used for plotting a smoothed curve or surface and has been an available option for both ScatterPlot and ScatterPlot3D for several releases. In Maple 2015, the new Lowess command returns the function whose graph is the lowess smoothed curve or surface. Returning a function rather than a plot also means that the Lowess command is capable of handling data points in any finite dimension. The lowess algorithm has also been improved to produce better plots and to achieve lower computation times in routines like ScatterPlot and ScatterPlot3D.
Following is an example of the use of Lowess together with ScatterPlot3D. First, generate 300 data points and store them in a 300x3 Matrix, M.
M ≔ X, Y, Z%T;
300 x 3 MatrixData Type: anythingStorage: rectangularOrder: Fortran_order
Now, compute the lowess model, L, and plot L.
Finally, plot the data points by themselves, and display the two plots together.
The lowess model can also be used in most other contexts where you can use a procedure. For example, you can numerically integrate the volume between the lowess surface and the plane z=0 (this turns out to be negative - there is more volume below zero than above):
intL, −50..50, −50..50, numeric, ε = 0.1, method = _CubaSuave
In the following example, the data points are two-dimensional (there is one independent and one dependent variable).
Z≔Vector'row'500,i→−0.9Xi−1Xi+50+Zerrori ⋅ 1+ Xi:
If these data points represent the response to a certain stimulus, you can expect the highest response where the model assumes the highest value. You can find this point with the Maximize command from the Optimization package.
Optimization:-MaximizeL, 0 .. 50;
The maximum, of about 0.012, is assumed when the stimulus is approximately 20. (The number varies a little bit depending on the random samples chosen previously.)
Robust statistics are statistical procedures that give reliable results in the presence of noise. The procedures embodied by the Maple commands Median and HodgesLehmann give robust measures for the location of a data set; those embodied by MedianDeviation, RousseeuwCrouxSn, and RousseeuwCrouxQn give robust measures for the dispersion of a data set. In Maple 2015, there is a new command that performs robust linear regression: RepeatedMedianEstimator.
The setting where this is useful is if one has data points in the plane that include outliers, and one wants to perform linear regression: find an affine-linear expression in the independent variable that is a reasonable description for the dependent variable.
X ≔ SampleUniform0, 50, 500:
Yerror ≔ SampleUniform0, 1, 500:
Y ≔ Vector500, i →1.3⋅Xi +2.7 − 20⋅Xi502 ⋅Yerrori6
1 .. 500 VectorcolumnData Type: anythingStorage: rectangularOrder: Fortran_order
points ≔ dataplotX, Y, style=point, symbolsize=4, color=green: points
You see that most points are close to the upper boundary given by the curve, but there are some points substantially lower than that. The standard, least-squares regression gives those lower points a substantial weight (their distance from the regression line is squared). The repeated median estimator, however, treats the outliers as "abnormal" values that get less weight; it lies closer to the majority of points.
leastsquares ≔ Fita⋅x+b, X, Y, x;
repeatedmedian ≔RepeatedMedianEstimatorX, Y, x;
plots:-displaypoints, plotleastsquares, repeatedmedian, x=0..50, legend=least squares, repeated median;
The Scale command is used to center and scale a sample list or matrix. By default, when a sample is centered, the mean of the list is subtracted from each of the observations. When a sample is scaled, all of the observations are divided by the standard deviation of the sample. This has useful applications in statistics, such as to compute standard scores.
For example, say that you have a list of percent grades in decimal form which are scored out of a possible maximum value of 1.
Grades ≔.34, .55, .61, .75, .80, .91
A consequence of scaling and centering a sample of data is that the resulting sample has mean 0 and standard deviation 1 (corresponding to a standard normal distribution). Scaling and centering this list, you see that a score of 0.80 is 0.68 standard deviations above the mean for example:
If you assume that the population of all grades is normally distributed, and that you have a representative sample of them here, then these data suggest that the score corresponding to 0.80 is in the top 25% of the grades, as you can see by using a standard normal distribution table:
The following graph illustrates how various options for the Scale command scale and center samples of data:
dataplot Matrix VectorGrades, ScaleGrades, center = false, ScaleGrades, ScaleGrades, scale=false, legend = Data, Scaled Data, Scaled and Centered Data, Centered Data, color=Red, DarkBlue, RoyalBlue,Orange, axes=framed, axis1=color=white
The red line shows the original data and the orange line shows the data minus the center value. The dark blue line shows the data divided by the scale value (the standard deviation of the sample) and the light blue line shows the data minus the center then divided by the scale value (the result of the command used above to compute the standard scores).
There are several notable updates to visualizations in Statistics, including a change to the default axes style for all statistics visualizations to boxed axes. The new dataplot command merges many statistics plots into one convenient place, making it easier than ever to create plots using sample of data. An example of the dataplot command can be seen in the preceding section.
TreeMap is a new visualization
that creates a unique view on the structure of data samples. A tree map is a method of data visualization using nested rectangles, in which the area of a rectangle corresponds to the magnitude of the corresponding datum.
The BubblePlot command has also been updated to handle TimeSeries objects. When given a time series, BubblePlot will create an animation that uses the corresponding time series to define the position and size of the bubbles over time. The following plot, taken from the BubblePlot help page, shows the 'Services Share of GDP' vs 'Industry Share of GDP' for several countries over a one year time period as an animation. The bubble size corresponds to the GDP (PPP) value. To view the animation, right-click and choose Animation - Play.
Code Generation for R
Maple 2015 introduces the CodeGeneration[R] command, making it easy to translate Maple code to R. In addition to being able to translate fundamental programming structures, CodeGeneration[R] can also translate many common unevaluated commands from statistics.
cg <- mean(matrix(c(2,4,8,21),nrow=1,ncol=4))
cg0 <- fivenum(c(1,3,5,7,9))
For more details, see the CodeGeneration updates page.
Several Statistics commands including DataSummary, FivePointSummary, and FrequencyTable have been updated. DataSummary and FivePointSummary have been updated to return a column vector rather than a list, making the results of each command much easier to read:
The FrequencyTable command has a new option, headers, which controls the display of a header row of information:
RangeAbsolute FrequencyPercentageCumulative FrequencyCumulative Percentage2...35.30.30.0000000030.30.0000000035...68.36.36.0000000066.66.0000000068...101.34.34.00000000100.100.0000000
Maple 2015 includes numerous updates geared toward the classroom. This includes a new palette for quick creation of random variables, new commands and tutors for working with common probability distribution tables and tables of critical values, and many new MathApps:
Normal Approximation of Binomial Distribution
Rolling Two Dice
And many more...
Download Help Document
What kind of issue would you like to report? (Optional)