| cmd_sinreg | Function (ROM Call 0x38C)

AMS 1.01 or higher | bascmd.h

void cmd_sinreg (ESI RegData);

Executes TI-Basic 'SinReg' command.

cmd_sinreg calculates a sine regression and updates all the statistics variables (see TI-Basic manual for more info). The RegData parameter must point to a structure on the expression stack which describes where the actual data is stored. This structure may have one of the following eight layouts (RegData should point to the last item):

NOTHING_TAG NOTHING_TAG NOTHING_TAG NOTHING_TAG y_list_name x_list_name
NOTHING_TAG NOTHING_TAG NOTHING_TAG iterations y_list_name x_list_name
NOTHING_TAG NOTHING_TAG period NOTHING_TAG y_list_name x_list_name
NOTHING_TAG NOTHING_TAG period iterations y_list_name x_list_name
END_TAG categories_list LIST_TAG categories_name NOTHING_TAG NOTHING_TAG y_list_name x_list_name
END_TAG categories_list LIST_TAG categories_name NOTHING_TAG iterations y_list_name x_list_name
END_TAG categories_list LIST_TAG categories_name period NOTHING_TAG y_list_name x_list_name
END_TAG categories_list LIST_TAG categories_name period iterations y_list_name x_list_name

x_list_name is the VAT symbol name (see SYMSTR and Tags for more info) of a TI-Basic list variable which contains the x values. y_list_name is the VAT symbol name of a TI-Basic list variable which contains the y values. iterations is an integer item in the range 1-16 (8 is assumed if it is ommited). It specifies the maximum number of iterations in which a solution will be attempted (larger values result in better accuracy but longer execution times, and vice versa). period is an integer or floating point item which specifies an estimated period. If omitted, the difference between values in the list which contains x values should be equal, and the values should be in sequential order, otherwise the differences between x values may vary. categories_name (if present) is the VAT symbol name of a TI-Basic list which contains the category for each item. categories_list represents a list of integer items determining which categories will be included (this makes sense only if categories_name is used).

Uses: HeapAllocHighThrow, HeapAllocThrow, HeapFree, HeapFreeIndir, HeapLock, HeapUnlock, HLock, remaining_element_count, push_approx, push_red_row_ech, ER_catch, ER_success, ER_throwVar, delete_expression, estack_to_ushort, HToESI, next_expression_index, NG_approxESI, NG_tokenize, push_Float, push_internal_simplify, push_quantum, push_quantum_pair, top_estack, sprintf, strcat, XR_stringPtr, atan2, cos, fabs, is_transfinite, sin, sqrt, ck_valid_float, estack_to_float, hStrAppend, is_cFloat_agg, PlotInit, PlotPut, RM_Type, statFree, statStart, DerefSym, SymFindMain, VarRecall, VarStore, _bcd_math, ROM Call 0x4CB

See also: cmd_linreg, cmd_quadreg, cmd_cubicreg, cmd_quartreg, cmd_powerreg, cmd_expreg, cmd_lnreg, cmd_onevar, cmd_twovar, cmd_medmed, cmd_logistic