Database Reference
In-Depth Information
5.
Eye-balling this graph, I decided to go with a simple, but very general, sine wave
formula. This may not be the best itting function, but it should do well enough
for this demonstration:
(defn sine-wave [theta x]
(let [[amp ang-freq phase shift] theta]
(i/plus
(i/mult amp (i/sin (i/plus (i/mult ang-freq x)
phase)))
shift)))
6.
The non-linear modeling function then determines the parameters that make the
function it the data best. Before that can happen, we need to pick some starting
parameters. This involves a lot of guesswork. After playing around some, and trying
out different values until I got something in the neighborhood of the data, here's what
I came up with:
(def start [3500.0 0.07 Math/PI 2500.0])
 
Search WWH ::




Custom Search