Perhaps someone can provide a more ad hoc solution, but if not, then you can find a Java implementation of the above algorithm (including a sine regression fit) here:
http://scribblethink.org/C
Main Topics
Browse All TopicsI need to write the code for a sine regression in Java ME. I have written the one that uses the asin(x) and returns a nice y=a+bsin(x), but it does not allow for changes in the period or for horizontal shifts.
I need a method that returns the standard coefficients, a, b, c, d for y=a+bsin(cx+d).
I have been stuck for a week on this and can't seem to find anyone to help. I just don't know how to do it. I would appreciate any help offered. Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Perhaps someone can provide a more ad hoc solution, but if not, then you can find a Java implementation of the above algorithm (including a sine regression fit) here:
http://scribblethink.org/C
Business Accounts
Answer for Membership
by: InteractiveMindPosted on 2009-08-13 at 16:02:54ID: 25093931
Have you looked at the Levenberg-Maquardt algorithm? ki/Levenbe rgMarquar dt_algorit hm
http://en.wikipedia.org/wi