Cosine Regression - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP Prime Software Library (/forum-15.html) +--- Thread: Cosine Regression (/thread-8743.html) |
Cosine Regression - Eddie W. Shore - 07-28-2017 10:21 PM Introduction The program COSREG attempts to fit data to the curve: Y = A*cos(C*(X-D)) +B The user will provide the x-data, y-data, and the period of the data. Radians mode will be used. HP Prime Program: COSREG Arguments x list, y list, estimated period Code:
The coefficients are returned in a list. Cosine Regression: Y = A * COS(C*(X – D)) + B Example 1 X = {0, π/4, π/2, 3π/4 ,1} Y = {5, 2, -1, 2, 5} Period: π Results: A = 3 C = 2 D = 0 B = 2 (Y = 2 COS(2X) + 3) |