Created
November 7, 2012 01:24
-
-
Save jtobin/4028961 to your computer and use it in GitHub Desktop.
Stochastic partial differential equation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
target :: [Double] -> Double | |
target xs = go 0 0 xs | |
where go t0 t1 [] = -0.5 * t0 / h - 0.5 * h * t1 | |
go t0 t1 (u:us:uss) = go (t0 + (us - u)^2) (t1 + v (us + u)) uss | |
h = 1 / fromIntegral (length xs) | |
v x = (1 - x^2)^2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment