beautypg.com

HP Prime Graphing Wireless Calculator User Manual

Page 197

background image

Functions and commands

193

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

Given an expression, returns a list of the functions of the
expression which utilize variables, including occurrences of
the variables themselves.

lvar(Expr)

Example:

lvar(e^(x)*2*sin(y) + ln(x)) returns [e^(x)
sin(y) ln(x)]

map

There are two uses for this function, in which the second
argument is always a mapping of a variable onto an
expression. If the expression is a function of the variable, the
function is applied to each element in the vector or matrix (the
first argument) and the resulting vector or matrix is returned; if
the expression is a Boolean test, each element in the vector or
matrix is tested and the results are returned as a vector or
matrix. Each test returns either 0 (fail) or 1 (pass).

map(Matrix, Var

→ Function) or map(Matrix, Var → Test)

Examples:

map([1 2 3], x→x

3

) returns [1 8 27]

map([1 2 3], x→ x>1) returns [0 1 1]

mat2list

Returns a vector containing the elements of a matrix.

mat2list(Matrix)

Example:

mat2list([[1 8],[4 9]])

gives

[1 8 4 9]

matpow

Given a matrix and an integer n, returns the nth power of the

matrix by jordanization.

matpow(Matrix, Integer)