Click here to Skip to main content
15,921,643 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
It is a shopping project. In this project we are calculating the time difference in periodical item sets (if an item a is brought & after 3 days item b is brought then we calculate the all time difference of such periodicity). In my project paper there are 4 algorithms are there Trend Distribution function, Generalized periodicity detection, trend modeling & cyclic model analysis. In paper there is a formula f(x)=(24-x)/18*(sin(x)+1.5).(x,f(x)) are coordinates of graph. No much more is given about x&f(x) can you help me what is x & f(x)?

They have also calculated linear regression function y=ax+b. Can anyone help how to calculate it?
Posted
Updated 19-Feb-11 2:45am
v3

1 solution

x an f(x) are the parameters you supposed to know, if speed is one factor then distance traveled would be f(speed). Usally x on the x axis and f(x) on the y axis we plot in a scatter plot. The scatter plot usually not follow a straight line i.e a trend. So we do a regression to make a curve fit. The formula you given is a linear regression formula. But I wonder as you have a sin component in your formula, it follows a linear relationship.

Confirm it. If you want algorithm for linear or polynomial regression, that i can give. But better try it yourself and comeback if any doubts. There are lot of free library/ sample code available for these regressions.
 
Share this answer
 
Comments
Member 7685573 19-Feb-11 9:16am    
yes sin is correct.it is used to find better f(x) values if you know an sites for such code please give me ...thanks for answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900