beautypg.com

HP Prime Graphing Calculator User Manual

Page 403

background image

Functions and commands

399

logarithmic_

regression

Returns the coefficients a and b of y=a*ln(x)+b, where y is the

natural logarithm that best approximates the points whose

coordinates are the elements in two lists or the rows of a

matrix.

logarithmic_regression(Lst||Mtrx(A),[Lst])

Example:

logarithmic_regression([[1.0,1.0],[2.0,4.0],[
3.0,9.0],[4.0,16.0]])

gives

10.1506450002,-

0.564824055818

logb

Returns the logarithm of base b of a.

logb(a,b)

Example:

logb(5,2)

gives

ln(5)/ln(2)

which is approximately

2.32192809489

logistic_

regression

Returns y, y', C, y'max, xmax, and R, where y is a logistic

function (the solution of y'/y=a*y+b), such that y(x0)=y0 and

where [y'(x0),y'(x0+1)...] is the best approximation of the line

formed by the elements in the list L.

logistic_regression(Lst(L),Real(x0),Real(y0))

Example:

logistic_regression([0.0,1.0,2.0,3.0,4.0],0.0
,1.0)

gives

[-17.77/(1+exp(-

0.496893925384*x+2.82232341488+3.14159265359*
i)),-2.48542227469/(1+cosh(-
0.496893925384*x+2.82232341488+3.14159265359*
i))]

lvar

Returns a list of variables used in an expression.

lvar(Expr)

Example:

lvar(exp(x)*2*sin(y))

gives

[exp(x),sin(y)]

magenta

Used with display to specify the color of the geometrical

object to be displayed.

map

Applies a function to the elements of the list.

map(Lst,Fnc)

Example:

map([1,2,3],x->x^3)

gives

[1,8,27]