Math 141
Definitions
- amplitude (sigmoid)
- The amplitude is the output the graph approaches as the inputs increase without bound, minus . The right horizontal asymptote is .
- amplitude (sine)
- The amplitude is half the distance between the maximum and the minimum output values of the sine function. Increasing raises the peaks and deepens the troughs.
- Assignment
Assignment is storing the value of an expression under a name. The name goes on the left of
=and the expression on the right:R computes the value of the right side, stores it under the name, and prints nothing. The Environment then lists the name with its value.
- Best-fit line
Among all lines,
fitModel()finds the line that makes the sum of the squared vertical distances from the data points to the line as small as possible, and that line is the best-fit line.- Better fittheorem
For linear models of the same dataset, the model with the shorter residual vector fits better. Equivalently, the model with the smaller root mean squared error (RMSE) fits better, because every model of the dataset has the same number of data points .
c(...)- The command
c(...)is the R function that returns a vector whose components are its inputs, in the order listed. Thecstands for combine. - Closest linear combinationtheorem
For a vector and a nonzero vector with the same number of components, the projection of onto is the closest linear combination of to . Every other linear combination of is farther from .
- component
- A component is an entry in the column of a vector. The first entry is the first component, the second entry is the second component, and so on. The vector has components and .
- component functions
- The two output components of a 2-D vector field are functions of and , the component functions and of :
- concave down
- A function is concave down on an interval if, for every two points on its graph over that interval, the straight segment joining them lies below the graph between those points.
- concave up
- A function is concave up on an interval if, for every two points on its graph over that interval, the straight segment joining them lies above the graph between those points.
- Console
The Console is the RStudio pane where R reads a command typed at the
>prompt, runs it, and prints its result beneath it when there is one.- Derived dimension
A derived dimension is a dimension other than a fundamental dimension that can be expressed as a product of integer powers of fundamental dimensions.
- dimension (of a quantity)
A dimension is an inherent way of measuring a quantity.
- dimension (of a vector)
- The dimension of a vector is the number of components it has. The vector has dimension 2. The dimension counts components, and the word length is kept for the magnitude of a vector, defined in section 3.
- Dimension arithmetictheorem
- Adding, subtracting, and comparing. When adding, subtracting, or comparing (for example, with , , or ) two quantities, they must have the same dimension, although their units may be different. The resulting dimension is equal to that of the quantities being added, subtracted, or compared.
- Multiplying and dividing. When multiplying and dividing quantities, they can have any dimensions and any units. The resulting dimension is equal to the product or quotient of the dimensions of the quantities being multiplied or divided.
- Exponents. In an exponential expression , the exponent must be dimensionless.
- dimensionless quantity
- A dimensionless quantity is a pure number that does not have a dimension. The symbol “1” denotes a dimensionless quantity and is written as . For example, .
- Domain
The domain is the set of input values of a function .
- Dot product
For two vectors and with the same number of components, the dot product is the scalar obtained by multiplying each component of by the corresponding component of and summing the products:
- Doubling time and halving time
For with , the doubling time is the width of an input interval with and ; with and , the width is the halving time. In science contexts the halving time is called the half-life.
- Environment
The Environment is the RStudio pane that lists every name stored in the current session, with its value. A value is stored under a name by assignment (section 3).
- error (of a model)
- The error is the observed output at a data point minus the model’s output at that point’s input.
- Exponent rulestheorem
For every base with and exponents and ,
- extrapolation
- An extrapolation is a prediction at an input that lies outside the input interval used to create the model. The prediction for 2030 is an extrapolation, because the data end in 2015. An extrapolation can be far off, because the data give no evidence about outputs at inputs outside its input interval.
- Files
- Files is the RStudio pane that shows the folders and files of the Posit Cloud project.
- fitted model function
- The fitted model function is the R function that
fitModel()returns. Given an input , it returns the fitted model’s output , including when the formula is fitted tolog(y). In the command above, the fitted model function isbfit. - five-sixths level
- The five-sixths level is the output five-sixths of the way from to , namely .
- Function
A function is a rule assigning every input to exactly one output.
In symbols, means the input is assigned to the output .
- Fundamental dimension
A fundamental dimension is a dimension that cannot be expressed in terms of other dimensions.
- General exponential function
An exponential function is a function of the form
where , , and are constants with and , and . Its parameters are , the output at ; the steepness ; and the horizontal shift . With the form is .
- General logarithmic function
A general logarithmic function is a function of the form , where , , and are constants with , and its domain is .
- Graphically identifying reasonable modelstheorem
- If the standard plot of a given data set is linear, then a linear model is reasonable.
- If the semi-log plot of a given data set is nonconstant linear, then an exponential model is reasonable.
- If the log-log plot of a given data set is nonconstant linear, then a power model is reasonable.
- Help
Help is the RStudio pane that displays the documentation page for an R function.
- History
The History is the RStudio pane that lists the commands run in the Console, in the order run.
- horizontal asymptote
- A horizontal asymptote is a horizontal line that the outputs of a function approach as increases without bound or as decreases without bound.
- Horizontal line testtheorem
A function has an inverse function if and only if every horizontal line intersects its graph at most once.
- horizontal shift
- The horizontal shift is the first input at or to the right of at which the sine function is increasing and its output equals the vertical shift . Increasing slides the whole curve to the right.
- Independence from the starting outputtheorem
For , the doubling time of is the same from every starting output. For , the halving time is the same from every starting output.
Inf- R uses the numeric values
Infand-Inffor positive and negative infinity. - Inference
- Inference is using the values of a fitted model’s parameters to describe the relationship between the input and the output. Reading the slope in Example 6 is an inference: according to the best-fit model, the world population grew by about 0.0749 billion people, or 74.9 million, per year from 1950 to 2015.
- Input variable
The input variable is the variable whose values are the inputs of a function.
- intercept vector
- The intercept vector is the vector whose components are all 1.
- interpolation
- An interpolation is a prediction at an input that lies inside the input interval used to create the model, from the smallest data input to the largest. The prediction for 1984 is an interpolation, because the data run from 1950 to 2015.
- Inverse function
The inverse function of maps each output from back to its corresponding input.
- Least squares RMSEtheorem
When the entries of are not all equal, the best-fit linear model has the smallest RMSE of all linear models for the same data.
- Length (magnitude)
The length (or magnitude) of a vector with components is the number written and defined by
- Length as a dot producttheorem
The length of a vector is
- linear combination (of vectors)
If are vectors and are scalars, then is a linear combination of .
- Linear function
For constants and , a linear function is a function of the form
The slope of the line through the points and , with , is
The vertical intercept is the -coordinate of the point where the line intersects the -axis.
- Log and exponent rulestheorem
For , , and real numbers and , with a positive integer in , the rules below hold.
Inverse pairs Log algebra Exponents - Log-log form
For , the log-log form of a power function with is the equation with and . It gives as a linear function of .
- Log-log form and conversiontheorem
For , the power function with has the log-log form
where is the slope and is the vertical intercept. A log-log line with converts back to the power function with
- Log-log plot
If is a point from a given data set or on a curve, with and , then its log-log plot includes the point .
- Matrix
An matrix is a rectangular array of real numbers arranged in rows and columns.
- matrix equation
- A matrix equation is a vector equation with its vectors as the columns of and its scalars as the components of .
- Matrix-vector product
For a matrix with columns and a vector with components , the matrix-vector product is
matrix(c(...), nrow = m, ncol = n)- The command
matrix(c(...), nrow = m, ncol = n)defines a matrix with rows and columns from a list of exactly entries. R fills the columns in order and each column from top to bottom. - mean
- The mean is the input at which the output is , halfway between the two horizontal asymptotes. The curve is steepest at .
- Method of least squares
The method of least squares is the method that selects the linear combination closest to the target vector , in the sense that the corresponding residual vector has the shortest length possible. When the entries of are not all equal, it selects one pair of scalars and , the slope and the vertical intercept of the best-fit linear model .
- Model
A model is a mathematical function whose input and output correspond to observations of some phenomenon of interest.
- model vector
- The linear combination that the method of least squares selects is the model vector, the vector of the model’s predictions.
- monotonic
- A function is monotonic if for every pair of inputs and with , or if for every such pair.
NaN- R returns
NaN, “not a number”, for an undefined calculation whose result is neitherInfnor-Inf. - natural logarithm
- The natural logarithm is , the inverse of the natural exponential function , with domain .
- Number of solutionstheorem
A system of linear equations has exactly one solution, no solution, or infinitely many solutions.
- Order and scalarstheorem
Let and be vectors with the same number of components, and let be a scalar. The dot product gives the same scalar in either order of the two vectors, and a scalar multiple of either vector can be moved outside the product:
- Orthogonal
Two vectors and are orthogonal when , where “orthogonal” is an extension of the two-dimensional idea of “perpendicular” to any number of dimensions.
- Output variable
The output variable is the variable whose values are the outputs of a function.
- parameter
- A parameter is a constant in a model’s formula that can take on various values. Each choice of values for the parameters gives one function.
- Perfect fit
A linear model fits a dataset perfectly when every data point satisfies it.
- period
- The period is the length of the smallest input interval needed for the sine function to complete an entire oscillation. Increasing stretches the curve horizontally.
- Plots
Plots is the RStudio pane that displays the graphs R draws.
- Power function
A power function is of the form , where and are nonzero constants.
- Power model
A power function used to describe a dataset is a power model.
- Prediction
- Prediction is using a model’s output at an input to estimate an output that was not observed. The value
best(1984)in Example 6 is a prediction. - Projection
For a vector and a nonzero vector with the same number of components, the projection of onto is the vector , where
The vector is the projection vector, and the number is the projection scalar.
- Projection and residualtheorem
For the projection of onto a nonzero vector , the residual vector is orthogonal to and to the projection , and the projection and the residual vector add to the target vector:
- Quantity
A quantity is the numerical value of a measurement together with its units, if it has any.
- range
- The range is the set of output values of a function .
- reasonable
- A linear model is reasonable for a data set when the data points lie on approximately the same line. In a plot, the criterion is that one straight line passes close to every point, with no bend in the pattern. Points that bend along a curve call for another type of function.
- Residual vector
For vectors and and a scalar , the residual vector for the linear combination and the target vector is .
- resultant
- The resultant is the single vector equal to the sum of two or more vectors. With the vectors placed tip to tail, the resultant is the arrow from the tail of the first vector to the tip of the last.
- Root mean squared error (RMSE)
For a model fit to data points, the root mean squared error (RMSE) is the square root of the mean of the squared components of its residual vector :
- RScript
An RScript is a plain-text file of R commands, saved in the project, whose lines R runs in the Console, one line or the whole file at a time.
- Scalar
A scalar is a real number.
- Scalar multiplication
The result of scalar multiplication, for a scalar and a vector , is the vector whose components are the components of , each multiplied by :
- Semi-log form
For an exponential function with , the semi-log form is the equation with and . It gives as a linear function of .
- Semi-log plot
If is a point from a given data set or curve with , then its semi-log plot includes the point .
- Shifted exponential model and its semi-log linetheorem
The exponential model , with and horizontal shift , has the semi-log line
To convert a semi-log line with back to the exponential model, set
- Sigmoid function
A sigmoid function is a function whose graph has an elongated S shape: it approaches one horizontal asymptote on the left and a different one on the right, and changes steeply between them.
- Sigmoid model
A sigmoid model gives the output as a stretched and shifted
pnorm:The four parameters are the amplitude , the mean , the spread , and the vertical shift . The amplitude is nonzero, , and the spread is positive, .
- Sigmoidal data
Sigmoidal data are data whose outputs stay near one level for small inputs, rise or fall steeply through a middle stretch, and level off at a different value for large inputs.
- Sine model
A sine model has the general form
with four parameters: the amplitude , the period , the horizontal shift , and the vertical shift . The amplitude and the period are positive: and .
- Sinusoidal data
Sinusoidal data are data whose outputs rise and fall in the shape of a sine curve, between two roughly constant extremes, repeating at a roughly constant input spacing.
- Size of a matrix
The size of a matrix is written rows first, then columns, as in .
- solution of the vector equation
- The pair and is a solution of the vector equation when is equal to .
solve(U, v)- The command
solve(U, v)takes the matrix first and the target vector second. When the matrix equation has exactly one solution and the matrix is not close to singular (Lesson 19 sheet), it returns that solution as the vector of unknowns . - spread
- The spread is the positive input distance from to the input where the output has covered
pnorm(1)of its change from to . start = list()- The
start = list()argument offitModel()gives a starting value for each parameter, such asstart = list(A = 28, P = 12, h = 2.5, v = 60). The fit searches for the best-fit values beginning from these starting values. - Target problem
For data points , the components of the input vector are the inputs, and the components of the target vector are the outputs. The intercept vector has components, each equal to 1 (Lesson 19 Notes, section 3). The target problem is the problem of finding the scalars and that make the linear combination equal to the target vector . As a vector equation and as a matrix equation, the target problem is
- Unique solution
A system of linear equations has a unique solution when it has exactly one solution.
- Unit
A unit is a way to assign a numerical value to the measurement of a quantity.
- Vector
A vector is an ordered list of real numbers written as a column.
- Vector addition
The result of vector addition, for two vectors with the same number of components, is the vector whose components are the sums of the matching components:
- Vector equation
A vector equation is an equality between linear combinations of vectors.
- Vector field
A vector field is a function whose input is a point and whose output is a vector of the same dimension as the input.
- Vector subtraction
The result of vector subtraction, for two vectors with the same number of components, is the vector whose components are the differences of the matching components:
- vertical asymptote
- A vertical asymptote is a vertical line such that the outputs of a function grow in size without bound as approaches . The graph of has the vertical asymptote , approached from the right.
- Vertical line testtheorem
A curve in the -plane is a function if and only if every vertical line intersects the curve at most once.
- vertical shift (sigmoid)
- The vertical shift is the output the graph approaches as the inputs decrease without bound. The left horizontal asymptote is .
- vertical shift (sine)
- The vertical shift is the height of the output that is halfway between the maximum and the minimum output values of the sine function. The curve oscillates about the center line . Increasing slides the whole curve up.
- Viewer
- The Viewer is the RStudio pane that displays web content R produces.
- window
- The window of a plot is the range of values and values it shows. A curve added with
add = TRUEkeeps the window of the first plot and shows only the part that falls inside it. To fit every curve, set a wide enough window withxlimandylimon the first call.