#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\textclass scrbook
\begin_preamble
\input{preamble.tex}
\end_preamble
\use_default_options false
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding utf8
\fontencoding global
\font_roman lmodern
\font_sans helvet
\font_typewriter courier
\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\float_placement H
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder false
\pdf_colorlinks false
\pdf_backref false
\pdf_pdfusetitle true
\papersize letterpaper
\use_geometry false
\use_package amsmath 2
\use_package amssymb 2
\use_package cancel 1
\use_package esint 1
\use_package mathdots 0
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\bullet 0 5 11 -1
\bullet 1 5 24 -1
\bullet 2 0 0 -1
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Standard
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
input{chapter.tex}
\end_layout
\end_inset
\end_layout
\begin_layout Chapter
\begin_inset CommandInset label
LatexCommand label
name "cha:Prediction"
\end_inset
Prediction
\end_layout
\begin_layout Standard
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
epigraph{We speculate as to what is in store for us.
But we not only undergo events, we in part cause them or at least influence
their course.
We have not only to study them but to act.}{Emily Greene Balch}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
Once a line is drawn through data, the overall trend can be quite apparent.
Humans are especially adept at identifying trends and extrapolating them.
Various statistical models, such as the Generalized Additive Model, have
predictive functions that can compute the trend line into the future.
Each computed point is typically represented by three values: the estimated
value, the most probable upper bound, and the most probable lower bound.
The purpose of this chapter is to demonstrate how these results can be
graphed using a chart in JasperReports.
\end_layout
\begin_layout Standard
In this chapter:
\end_layout
\begin_layout Itemize
\series bold
Prerequisites.
\series default
What software must be installed and configured before performing the procedures
in this chapter.
\end_layout
\begin_layout Itemize
\series bold
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
Function.
\series default
Calling
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
from a
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
function to perform prediction.
\end_layout
\begin_layout Itemize
\series bold
Integration.
\series default
Displaying the prediction results in JasperReports.
\end_layout
\begin_layout Itemize
\series bold
Series Customizer.
\series default
Changing a chart's line appearance.
\end_layout
\begin_layout Itemize
\series bold
Final Report.
\series default
Demonstrating how the fully customized report should appear.
\end_layout
\begin_layout Section
Prerequisites
\end_layout
\begin_layout Standard
The following software suites must be installed and configured:
\end_layout
\begin_layout Itemize
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appjava{}
\end_layout
\end_inset
\end_layout
\begin_layout Itemize
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appapachetomcat{}
\end_layout
\end_inset
\end_layout
\begin_layout Itemize
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
\end_layout
\begin_layout Itemize
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
\end_layout
\begin_layout Itemize
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appapachetomcat{}
\end_layout
\end_inset
and
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
must be running.
\end_layout
\begin_layout Standard
Before reading the remainder of this chapter, review
\begin_inset CommandInset ref
LatexCommand ref
reference "cha:Statistics"
\end_inset
.
\end_layout
\begin_layout Section
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
Function
\end_layout
\begin_layout Standard
Writing a PL/R function that can predict new values requires the following:
\end_layout
\begin_layout Itemize
\series bold
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
Source.
\series default
Develop and test the code using
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
.
\end_layout
\begin_layout Itemize
\series bold
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
Source.
\series default
Copy the
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
code into a
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
function using
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
.
\end_layout
\begin_layout Subsection
R Source
\end_layout
\begin_layout Standard
The source code in
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:R-GAM-Prediction"
\end_inset
adds prediction to
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:R-GAM-Example"
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float algorithm
wide false
sideways false
status collapsed
\begin_layout Plain Layout
\begin_inset Graphics
filename source/r/gam-predict.r.png
display false
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "alg:R-GAM-Prediction"
\end_inset
R - GAM Prediction
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
The lines that affect prediction and plotting the results include:
\end_layout
\begin_layout Itemize
\series bold
Lines 1 to 7, and 9.
\series default
Unchanged from
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:R-GAM-Example"
\end_inset
.
\end_layout
\begin_layout Itemize
\series bold
Line 5.
\series default
This line (also unchanged but must be emphasized) limits the simulated
measurement data to 200 data points.
\end_layout
\begin_layout Itemize
\series bold
Line 10.
\series default
Predict values for new indexes 201 through 210 based on the preceding 200
data points.
\end_layout
\begin_layout Itemize
\series bold
Line 12.
\series default
Plot all the values, including the predictions.
\end_layout
\begin_layout Itemize
\series bold
Line 13.
\series default
Draw the points for the simulated measurement data.
\end_layout
\begin_layout Itemize
\series bold
Line 14.
\series default
Draw the points for the first 200 values of the trend line using a distinct
colour.
\end_layout
\begin_layout Standard
The plotted results are shown in
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:R-GAM-Plotted-Prediction"
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed
\begin_layout Plain Layout
\begin_inset Graphics
filename captures/r-plot-gam-03.png
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:R-GAM-Plotted-Prediction"
\end_inset
R - GAM Plotted Prediction
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\end_layout
\begin_layout Standard
The predicted values for the trend line extend into the upper-right corner
(emphasized in a different colour).
Returning the predicted values as a data set from a database function is
not quite the end of the story.
A prediction, while useful on its own as an indicator of where the trend
is headed, should be supported by
\emph on
standard error estimates
\emph default
.
Standard error estimates provide a floor and ceiling for every predicted
value.
These minimum and maximum estimates can provide boundaries for the likelihood
of the predicted value falling within a certain range.
For example, consider the values in
\begin_inset CommandInset ref
LatexCommand ref
reference "tab:Example-Measurement-Values"
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float table
wide false
sideways false
status collapsed
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "tab:Example-Measurement-Values"
\end_inset
Example Measurement Values
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Tabular
<lyxtabular version="3" rows="7" columns="4">
<features rotate="0" tabularvalignment="middle">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
rowcolor{tableheader}
\backslash
toprule{}
\end_layout
\end_inset
\series bold
Measurement
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Predicted
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Floor
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Ceiling
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
midrule{}
\end_layout
\end_inset
1
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
3
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
4
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
5
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
6
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
5
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
7
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
tabularnewline
\backslash
bottomrule%
\end_layout
\end_inset
\end_layout
\end_inset
</cell>
</row>
</lyxtabular>
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
Pretend that the first five values in
\begin_inset CommandInset ref
LatexCommand ref
reference "tab:Example-Measurement-Values"
\end_inset
are actual measurements.
The sixth value was never measured, but based on the previous values, the
computer (and any five-year-old child) might predict the next value will
be 6.
Furthermore, it is possible to program the computer to return (based on
a given certainty) the lowest value and highest values that could follow.
In this case, the computer might be asked to calculate with 95% certainty
the possible range for the next predicted value.
In this example, the next value will
\emph on
probably
\emph default
fall between 5 (floor) and 7 (ceiling).
The implication is that the predicted value 6 might only be 80% likely.
Good enough for a gambler, but not the only possible outcome.
\end_layout
\begin_layout Standard
Returning standard error estimates from a
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
function is left as an exercise for the reader.
\end_layout
\begin_layout Subsection
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
Source
\end_layout
\begin_layout Standard
The source code for the
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
function should provide a way to discern between predicted values and measured
values, so that the two sets of values can be given distinct identifying
traits.
For example, it ought to be possible to change the shape, size, or colour
of predicted values to distinguish them from actual measurements.
The new function for a predictive analysis
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
routine is shown in
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:PL/R-GAM-Prediction"
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float algorithm
wide false
sideways false
status collapsed
\begin_layout Plain Layout
\begin_inset Graphics
filename source/sql/predictive-model-function.plsql.png
display false
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "alg:PL/R-GAM-Prediction"
\end_inset
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
- GAM Prediction
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
The source code works as follows:
\end_layout
\begin_layout Itemize
\series bold
Lines 4 to 6.
\series default
Sets the parameters for the number of predictions to make after the last
measurement value.
\end_layout
\begin_layout Itemize
\series bold
Lines 8 to 14.
\series default
Generates a random noise sample surrounding a modified sine curve.
\end_layout
\begin_layout Itemize
\series bold
Line 16.
\series default
Calculates the trend line.
\end_layout
\begin_layout Itemize
\series bold
Line 17.
\series default
Extrapolates the trend line by ten predicted values.
\end_layout
\begin_layout Itemize
\series bold
Line 18.
\series default
Associates a value of
\family typewriter
FALSE
\family default
with the set of values for the trend line.
\end_layout
\begin_layout Itemize
\series bold
Line 20.
\series default
Associates a value of
\family typewriter
TRUE
\family default
with the set of predicted values at the end of the trend line.
Lines 18 and 20 allow a database query to distinguish between values that
are part of the trend line (based on actual measurements) and values that
are predicted.
\end_layout
\begin_layout Itemize
\series bold
Lines 22 and 23.
\series default
Makes all the vectors, returned by the function, the same length by inserting
\family typewriter
NA
\family default
values as filler.
Without these lines, the call to
\family typewriter
cbind
\family default
fails.
\end_layout
\begin_layout Itemize
\series bold
Line 25.
\series default
Packs the results into a set of rows defined by the
\family typewriter
predictive_model
\family default
data type.
\end_layout
\begin_layout Standard
The
\family typewriter
predictive_model
\family default
data type given in
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:Prediction-Supporting-Data-Type"
\end_inset
is required by the function in
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:PL/R-GAM-Prediction"
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float algorithm
wide false
sideways false
status collapsed
\begin_layout Plain Layout
\begin_inset Graphics
filename source/sql/predictive-model-type.plsql.png
display false
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "alg:Prediction-Supporting-Data-Type"
\end_inset
Prediction Function Supporting Data Type
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
The only difference between
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:Prediction-Supporting-Data-Type"
\end_inset
and
\begin_inset CommandInset ref
LatexCommand vref
reference "alg:Statistical-Model-Type"
\end_inset
is the additional
\family typewriter
predicted
\family default
variable, which determines if the row is calculated using the measurement
data or the
\family typewriter
predict
\family default
function.
\end_layout
\begin_layout Section
Integration
\end_layout
\begin_layout Standard
The final steps to displaying predictive results in a report include the
following:
\end_layout
\begin_layout Itemize
\series bold
Query.
\series default
Change the query in iReport to distinguish the predicted data.
\end_layout
\begin_layout Itemize
\series bold
Chart Data.
\series default
Add another
\series bold
XY Series
\series default
to the chart.
\end_layout
\begin_layout Itemize
\series bold
Chart Customizer.
\series default
Alter the chart customizer source code to plot a visually appealing result.
\end_layout
\begin_layout Subsection
Query
\end_layout
\begin_layout Standard
Compared to all the source code developed so far, the query in
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:Prediction-Supporting-Data-Type"
\end_inset
is relatively simple.
\end_layout
\begin_layout Standard
\begin_inset Float algorithm
wide false
sideways false
status collapsed
\begin_layout Plain Layout
\begin_inset Graphics
filename source/sql/ireport-predictive_model.pgsql.png
display false
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "alg:Predictive-Query"
\end_inset
Predictive Query
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
This query uses
\family typewriter
CASE
\family default
statements to change the way the
\family typewriter
predictive_model
\family default
function rows are returned.
Because
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appjasperreports{}
\end_layout
\end_inset
does not plot
\family typewriter
NULL
\family default
data, the query needs to return the following sets of values:
\end_layout
\begin_layout Itemize
Horizontal values, represented by the
\family typewriter
taken
\family default
column.
\end_layout
\begin_layout Itemize
Vertical values subjected to trend line and predictive analysis, represented
by the
\family typewriter
measurement
\family default
column.
\end_layout
\begin_layout Itemize
Trend line values, represented by the
\family typewriter
model
\family default
column.
\end_layout
\begin_layout Itemize
Extrapolated trend line values, represented by the
\family typewriter
prediction
\family default
column.
\end_layout
\begin_layout Standard
The first set of values corresponds to the number of data points in the
chart; the remaining values are each plotted on the graph.
\end_layout
\begin_layout Subsection
Chart Data
\end_layout
\begin_layout Standard
Return to iReport for the last time to complete the following instructions:
\end_layout
\begin_layout Enumerate
Open
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
filename{
\backslash
filejrxmlstatistics}
\end_layout
\end_inset
from
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Chart-Results"
\end_inset
.
\end_layout
\begin_layout Enumerate
Change the query to
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:Prediction-Supporting-Data-Type"
\end_inset
.
\end_layout
\begin_layout Enumerate
Right-click the chart.
\end_layout
\begin_layout Enumerate
Select
\series bold
Chart Data
\series default
.
\end_layout
\begin_layout Enumerate
Click the
\series bold
Details
\series default
tab.
\end_layout
\begin_layout Enumerate
Click
\series bold
Add
\series default
.
\end_layout
\begin_layout Enumerate
Set
\series bold
Series expression
\series default
and
\series bold
Label expression
\series default
to:
\family typewriter
"Prediction"
\end_layout
\begin_layout Enumerate
Set
\series bold
X value expression
\series default
to:
\family typewriter
$F{taken}
\end_layout
\begin_layout Enumerate
Set
\series bold
Y value expression
\series default
to:
\family typewriter
$F{prediction}
\end_layout
\begin_layout Enumerate
Click
\series bold
OK
\series default
to close the
\series bold
XY Series
\series default
dialog.
\end_layout
\begin_layout Enumerate
Click
\series bold
Close
\series default
to close the
\series bold
Chart details
\series default
dialog.
\end_layout
\begin_layout Enumerate
Click
\series bold
Preview
\series default
to view the chart.
\end_layout
\begin_layout Standard
The chart appears, as in
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Integrated-Chart-v-1-4"
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed
\begin_layout Plain Layout
\begin_inset Graphics
filename captures/report-statistics-05.png
display false
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:Integrated-Chart-v-1-4"
\end_inset
Integrated Chart v1.4
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
The remaining issues include the following:
\end_layout
\begin_layout Itemize
The small dark blue circles for measurements are now small light blue triangles.
\end_layout
\begin_layout Itemize
The legend shows two prediction lines, when only one is visible.
\end_layout
\begin_layout Itemize
The prediction line is an overlapping set of small dark blue circles, rather
than a smooth, curved line.
\end_layout
\begin_layout Itemize
The prediction line colour is not the desired colour.
\end_layout
\begin_layout Standard
You can find the reason for these issues by examining the chart customizer
source code.
The chart customizer adjusts the chart presuming there are only two series
in the chart: measurement data and model data.
By adding the predicted model data, default line renderers have taken over
the graph.
This can be changed in the chart customizer.
\end_layout
\begin_layout Section
\begin_inset CommandInset label
LatexCommand label
name "sec:Series-Customizer"
\end_inset
Series Customizer
\end_layout
\begin_layout Standard
Although
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Integrated-Chart-v-1-4"
\end_inset
gets the point across (that is, the values are predicted to rise even higher),
the trend line looks like marsh reeds where it meets the predictive values---jo
ining two models should be a smooth and seamless blend.
You can resolve this issue by changing
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
filename{
\backslash
filejavabeziercustomizer}
\end_layout
\end_inset
(or preferably using a dynamic approach).
\end_layout
\begin_layout Subsection
Requirements
\end_layout
\begin_layout Standard
Requirements for a customizer class to control multiple series independently
within an
\series bold
XY dataset
\series default
, include changes to the following:
\end_layout
\begin_layout Itemize
Series name, colour, and order.
\end_layout
\begin_layout Itemize
Line type (bezier, straight) and thickness.
\end_layout
\begin_layout Itemize
Shape type (circle, square, diamond, triangle).
\end_layout
\begin_layout Itemize
Visibility within the legend.
\end_layout
\begin_layout Standard
Note about series order: at the time of writing, no solution was found for
changing the order of how dataset seriess are drawn independently from
the order in which they appear (
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Chart-Details-Details-Tab"
\end_inset
).
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Graphics
filename captures/ireport-chart-details-details.png
display false
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:Chart-Details-Details-Tab"
\end_inset
Chart details Dialog - Details Tab
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
The Series Customizer is required, because
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appireport{}
\end_layout
\end_inset
does not currently support multiple
\series bold
XY datasets
\series default
within the same chart.
\end_layout
\begin_layout Standard
The
\series bold
XY dataset
\series default
has three distinct
\series bold
XY series
\series default
(shown in
\begin_inset CommandInset ref
LatexCommand vref
reference "fig:Chart-Details-Details-Tab"
\end_inset
): Model, Prediction, and Measurement.
These series correspond to values returned by the query in
\begin_inset CommandInset ref
LatexCommand vref
reference "alg:Predictive-Query"
\end_inset
.
Using the compiled class for
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
filename{
\backslash
filejavaseriescustomizer}
\end_layout
\end_inset
allows detailed control over the individual lines in the series---more
than is possible through
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appireport{}
\end_layout
\end_inset
alone.
\end_layout
\begin_layout Subsection
Configuration
\end_layout
\begin_layout Standard
The Series Customizer is configured by setting the Series expression value,
as follows:
\end_layout
\begin_layout Enumerate
Right-click the chart.
\end_layout
\begin_layout Enumerate
Click
\series bold
Chart Data
\series default
.
\end_layout
\begin_layout Enumerate
Click the
\series bold
Details
\series default
tab.
\end_layout
\begin_layout Enumerate
Click an
\series bold
XY series
\series default
to select it.
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
Or click
\series bold
Add
\series default
to create a new
\series bold
XY series
\series default
.
\end_layout
\end_inset
\end_layout
\begin_layout Enumerate
Click
\series bold
Modify
\series default
.
\end_layout
\begin_layout Enumerate
Change the
\series bold
Series expression
\series default
value.
\end_layout
\begin_layout Standard
The
\series bold
Series expression
\series default
must be a valid
\family typewriter
java.lang.String
\family default
value that contains name-value pairs separated by semi-colons.
For example:
\end_layout
\begin_layout LyX-Code
"series.name=Model;line.shown=true;line.class=spline"
\end_layout
\begin_layout Standard
\begin_inset CommandInset ref
LatexCommand ref
reference "tab:Series-Customizer-Parameters"
\end_inset
lists a full set of working configuration options, and expected values.
\end_layout
\begin_layout Standard
\begin_inset Float table
wide false
sideways false
status collapsed
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "tab:Series-Customizer-Parameters"
\end_inset
Series Customizer Parameters
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Tabular
<lyxtabular version="3" rows="10" columns="5">
<features rotate="0" tabularvalignment="middle">
<column alignment="left" valignment="top">
<column alignment="left" valignment="top">
<column alignment="left" valignment="top">
<column alignment="left" valignment="top">
<column alignment="left" valignment="top">
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
rowcolor{tableheader}
\backslash
toprule{}
\end_layout
\end_inset
\series bold
Parameter
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Type
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Values
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Controls
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Default
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
midrule{}
\end_layout
\end_inset
\family typewriter
series.name
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
String
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Text
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Legend label name.
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Quotes eld
\end_inset
unknown
\begin_inset Quotes erd
\end_inset
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
series.legend
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Boolean
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
true, false
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Legend label visibility.
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
false
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
series.colour
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
R,G,B
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Numeric
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Series colour.
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
0,0,255
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
shape.class
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
String
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
circle, square,
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Series shape type.
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
circle
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
triangle, diamond
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
shape.shown
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Boolean
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
true, false
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Shape visibility.
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
false
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
line.class
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
String
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
spline, straight
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Line shape type.
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
straight
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
line.size
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Float
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
0.0 - 10.0
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Line thickness.
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
4.0
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
line.shown
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Boolean
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
true, false
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Line visibility.
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
false
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
tabularnewline
\backslash
bottomrule%
\end_layout
\end_inset
\end_layout
\end_inset
</cell>
</row>
</lyxtabular>
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
Note that the
\family typewriter
series.order
\family default
and
\family typewriter
shape.size
\family default
configuration options are unimplemented.
\end_layout
\begin_layout Standard
Also note that at least one of
\family typewriter
line.shown
\family default
or
\family typewriter
shapes.shown
\family default
must be set to true (both can be set to true, if desired).
If both values are not set (or set to false), the chart will not display
anything for that series.
\end_layout
\begin_layout Subsection
Implementation
\end_layout
\begin_layout Standard
How the Series Customizer class works is beyond the scope of this manual.
For completeness, though, the details are summarized here.
\end_layout
\begin_layout Standard
As shown in
\begin_inset CommandInset ref
LatexCommand vref
reference "fig:Chart-Details-Details-Tab"
\end_inset
, every
\series bold
XY dataset
\series default
can contain multiple
\series bold
XY series
\series default
.
The JFreeChart API does not provide a straightforward mechanism to control
each
\series bold
XY series
\series default
independently.
That is, changing the look of one
\series bold
XY series
\series default
in an
\series bold
XY dataset
\series default
changes the look of all the
\series bold
XY series
\series default
in the dataset---far from ideal.
However, the JFreeChart API provides a way to copy an
\series bold
XY dataset
\series default
.
\end_layout
\begin_layout Standard
The Series Customizer class creates copies of the
\series bold
XY dataset
\series default
for each
\series bold
XY series
\series default
in the first
\series bold
XY dataset
\series default
.
After all the copies of all the series are made, each
\series bold
XY dataset
\series default
contains the duplicate
\series bold
XY series
\series default
listed in
\begin_inset CommandInset ref
LatexCommand ref
reference "tab:XY-datasets-XY-series"
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float table
wide false
sideways false
status collapsed
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "tab:XY-datasets-XY-series"
\end_inset
XY datasets and XY series
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Tabular
<lyxtabular version="3" rows="10" columns="4">
<features rotate="0" tabularvalignment="middle">
<column alignment="left" valignment="top">
<column alignment="left" valignment="top">
<column alignment="left" valignment="top">
<column alignment="left" valignment="top">
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
rowcolor{tableheader}
\backslash
toprule{}
\end_layout
\end_inset
\series bold
XY Dataset
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
XY Series Name
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Configuration
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Visible
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
midrule{}
\end_layout
\end_inset
\series bold
0
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Model
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Spline
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Yes
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
0
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Prediction
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Spline
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
No
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
0
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Measurement
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Circles
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
No
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
1
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Model
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Spline
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
No
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
1
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Prediction
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Spline
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Yes
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
1
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Measurement
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Circles
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
No
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Model
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Spline
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
No
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Prediction
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Spline
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
No
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
2
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Measurement
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Circles
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\series bold
Yes
\series default
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
tabularnewline
\backslash
bottomrule%
\end_layout
\end_inset
\end_layout
\end_inset
</cell>
</row>
</lyxtabular>
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
A key responsibility of the Series Customizer class is to hide the duplicate
\series bold
XY series
\series default
, so that only the
\series bold
XY series
\series default
that have been configured (according to the parameters in
\begin_inset CommandInset ref
LatexCommand ref
reference "tab:Series-Customizer-Parameters"
\end_inset
) are displayed.
\end_layout
\begin_layout Standard
You can find the remaining details for the Series Customizer class by reading
its source code.
\end_layout
\begin_layout Section
Final Report
\end_layout
\begin_layout Standard
Check that the following is complete:
\end_layout
\begin_layout Itemize
The
\series bold
XY dataset
\series default
has the appropriate number of
\series bold
XY series
\series default
(one for each line represented on the chart).
\end_layout
\begin_layout Itemize
Each
\series bold
XY series
\series default
has its configuration options declared in its
\series bold
Series expression
\series default
.
\end_layout
\begin_layout Itemize
The
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
filename{
\backslash
filejavaseriescustomizer}
\end_layout
\end_inset
is compiled.
\end_layout
\begin_layout Itemize
The classpath in
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appireport{}
\end_layout
\end_inset
is configured to find the Series Customizer classes (see
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Class-Usage"
\end_inset
for details).
\end_layout
\begin_layout Standard
Run the report, to produce results similar to
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Integrated-Chart-v-1-5"
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Graphics
filename captures/report-statistics_06.png
display false
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:Integrated-Chart-v-1-5"
\end_inset
Integrated Chart v1.5
\end_layout
\end_inset
\end_layout
\end_inset
The values at the tail end of the line are predicted by the computer.
There are a few enhancements that should be made at this point:
\end_layout
\begin_layout Itemize
Resize the graph to a square.
\end_layout
\begin_layout Itemize
Show confidence intervals for the trend line and prediction line.
\end_layout
\begin_layout Itemize
Add the following parameters to the prediction function:
\end_layout
\begin_deeper
\begin_layout Itemize
Number of future values
\end_layout
\begin_layout Itemize
Confidence interval extents
\end_layout
\end_deeper
\begin_layout Section
Summary
\end_layout
\begin_layout Standard
Emily Greene Balch, who shared the 1946 Nobel Peace Prize, noted that future
events can be speculated and must result in a course of action.
Without the ability to predict how the most influential aspects of a business
will change, it is difficult to make decisions that increase the likelihood
of success for the business.
Extrapolating trend lines into the near future give business owners valuable
insights that can allow them to improve business processes.
These insights could mean the company must abandon poorly performing retail
items, focus on new revenue streams, or take other actions to achieve corporate
mandates.
\end_layout
\begin_layout Standard
Prediction, however, is not limited to businesses.
Students, teachers, researchers, non-profit organizations, event organizers,
government offices, and many others can benefit from knowing future trends.
\end_layout
\begin_layout Standard
This chapter describes how to examine simple trends.
For complex data and in-depth analysis consider using one of the tools
provided by Revolution Analytics (
\begin_inset CommandInset href
LatexCommand href
name "http://www.revolutionanalytics.com"
target "http://www.revolutionanalytics.com"
\end_inset
).
\end_layout
\begin_layout Section
Conclusion
\end_layout
\begin_layout Standard
This manual has described the following ideas:
\end_layout
\begin_layout Itemize
Avoid duplication whenever possible.
\end_layout
\begin_layout Itemize
Organize ancillary files used by reports.
\end_layout
\begin_layout Itemize
Use a consistent naming scheme.
\end_layout
\begin_layout Itemize
Create and use a data dictionary.
\end_layout
\begin_layout Itemize
Leverage
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
for statistical analysis and prediction.
\end_layout
\begin_layout Standard
Thank you for reading.
\end_layout
\begin_layout Standard
Please send comments, critiques, or corrections via the
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
corpwms{}
\end_layout
\end_inset
website:
\begin_inset Newline newline
\end_inset
\end_layout
\begin_layout Standard
\align center
\begin_inset CommandInset href
LatexCommand href
target "http://www.whitemagicsoftware.com"
\end_inset
\end_layout
\end_body
\end_document