diff --git a/solr/solr-ref-guide/src/curve-fitting.adoc b/solr/solr-ref-guide/src/curve-fitting.adoc index c2086b15598..50a04c9ba07 100644 --- a/solr/solr-ref-guide/src/curve-fitting.adoc +++ b/solr/solr-ref-guide/src/curve-fitting.adoc @@ -16,10 +16,10 @@ // specific language governing permissions and limitations // under the License. +These functions support constructing a curve. == Polynomial Curve Fitting - The `polyfit` function is a general purpose curve fitter used to model the non-linear relationship between two random variables. @@ -223,12 +223,12 @@ responds with: == Harmonic Curve Fitting -The `harmonicFit` function or `harmfit` (for short) fits a smooth line through control points of a sine wave. +The `harmonicFit` function (or `harmfit`, for short) fits a smooth line through control points of a sine wave. The `harmfit` function is passed x- and y-axes and fits a smooth curve to the data. -If only a single array is provided it is treated as the y-axis and a sequence is generated +If a single array is provided it is treated as the y-axis and a sequence is generated for the x-axis. -The example below shows `harmfit` fitting a single oscillation of a sine wave. `harmfit` +The example below shows `harmfit` fitting a single oscillation of a sine wave. The `harmfit` function returns the smoothed values at each control point. The return value is also a model which can be used by the `predict`, `derivative` and `integrate` functions. @@ -238,7 +238,7 @@ There are also three helper functions that can be used to retrieve the estimated * `getAngularFrequency`: Returns the angular frequency of the sine wave. * `getPhase`: Returns the phase of the sine wave. -*Note*: The `harmfit` function works best when run on a single oscillation rather then a long sequence of +NOTE: The `harmfit` function works best when run on a single oscillation rather then a long sequence of oscillations. This is particularly true if the sine wave has noise. After the curve has been fit it can be extrapolated to any point in time in the past or future. @@ -287,7 +287,6 @@ interpolate or extrapolate the sine wave. The example below uses the fitted model to extrapolate the sine wave beyond the control points to the x-axis points 20, 21, 22, 23. - [source,text] ---- let(x=array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19), @@ -322,10 +321,9 @@ let(x=array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19), } ---- - == Gaussian Curve Fitting -The `gaussfit` function fits a smooth curve through a gaussian peak. +The `gaussfit` function fits a smooth curve through a Gaussian peak. This is shown in the example below. @@ -336,8 +334,7 @@ let(x=array(0,1,2,3,4,5,6,7,8,9, 10), f=gaussfit(x, y)) ---- -When this expression is sent to the `/stream` handler it -responds with: +When this expression is sent to the `/stream` handler it responds with: [source,json] ---- @@ -371,9 +368,7 @@ responds with: Like the `polyfit` function, the `gaussfit` function returns a function that can be used directly by the `predict`, `derivative` and `integrate` functions. -The example below demonstrates how to compute an integral for a -fitted gaussian curve. - +The example below demonstrates how to compute an integral for a fitted Gaussian curve. [source,text] ---- diff --git a/solr/solr-ref-guide/src/dsp.adoc b/solr/solr-ref-guide/src/dsp.adoc index e9d4fd689fe..d94d2345c74 100644 --- a/solr/solr-ref-guide/src/dsp.adoc +++ b/solr/solr-ref-guide/src/dsp.adoc @@ -27,25 +27,25 @@ the more advanced DSP functions its useful to develop a deeper intuition of the The dot product operation is performed in two steps: -1) Element-by-element multiplication of two vectors which produces a vector of products. +. Element-by-element multiplication of two vectors which produces a vector of products. -2) Sum the vector of products to produce a scalar result. +. Sum the vector of products to produce a scalar result. This simple bit of math has a number of important applications. === Representing Linear Combinations -The `dotProduct` performs the math of a Linear Combination. A Linear Combination has the following form: +The `dotProduct` performs the math of a _linear combination_. A linear combination has the following form: [source,text] ---- (a1*v1)+(a2*v2)... ---- -In the above example a1 and a2 are random variables that change. v1 and v2 are *constant values*. +In the above example `a1` and `a2` are random variables that change. `v1` and `v2` are constant values. When computing the dot product the elements of two vectors are multiplied together and the results are added. -If the first vector contains random variables and the second vector contains *constant values* +If the first vector contains random variables and the second vector contains constant values then the dot product is performing a linear combination. This scenario comes up again and again in machine learning. For example both linear and logistic regression @@ -53,7 +53,7 @@ solve for a vector of constant weights. In order to perform a prediction, a dot between a random observation vector and the constant weight vector. That dot product is a linear combination because one of the vectors holds constant weights. -Lets look at simple example of how a linear combination can be used to find the *mean* of a vector of numbers. +Lets look at simple example of how a linear combination can be used to find the mean of a vector of numbers. In the example below two arrays are set to variables *`a`* and *`b`* and then operated on by the `dotProduct` function. The output of the `dotProduct` function is set to variable *`c`*.