Sure, I am attaching the key code file.
functions-gmm-full.jl (36.7 KB)
functions-model.jl (60.2 KB)
functions-model-definitions.jl (17.2 KB)
gmm_wrappers.jl (16.6 KB)
- To estimate parameters, I call
curve_fit
from LsqFit.jl in the file gmm_wrappers.jl
. See below the first round of results, which are super slightly different. These differences later grow.
- the key function to compute the model is
model_dt_dynamic()
in functions-model-definitions.jl
- I’ve used checksums to verify that
DATA
, PARAMS
are identical on Windows/Linux
- unless LsqFit is generating slightly different
theta
inputs, those should be identical also.
- I tried a couple of times to use the values of
theta
below directly, and I do seem to get the same result on Windows / Linux. I did not do this systematically.
Results on local machine (Windows):
[1st stage] iter 1: starting
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.045718475638708116
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.045718475638708116
theta [102.12199794490081, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.045718536449015974 <----------
theta [102.1207611621758, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.04571841482194174
theta [102.1213795535383, 108.68133385621667, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.045718635328641316
theta [102.1213795535383, 108.68001763445301, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.04571831594289727 <----------
theta [102.1213795535383, 108.68067574533484, 6.0554544523933395e-6, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.04571847411729412
theta [102.1213795535383, 108.68067574533484, -6.0554544523933395e-6, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.0457184771601207
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54554413899048, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.045718362519457996 <----------
theta [102.1213795535383, 108.68067574533484, 0.0, 34.5451257635858, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.04571858875926351 <----------
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.283430119697144, 22.264706885783603, 13.620450125437278] 0.04571846316407449
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28280903450759, 22.264706885783603, 13.620450125437278] 0.045718488113449605 <----------
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264841708702047, 13.620450125437278] 0.04571843169465825
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.26457206286516, 13.620450125437278] 0.0457185195832849
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620532603452634] 0.04571842651225944
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620367647421922] 0.04571852475945836
0 4.571848e-02 NaN
* lambda: 10.0
Results on server (Unix):
[1st stage] iter 1: starting
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.045718475638708116
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.045718475638708116
theta [102.12199794490081, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.04571853644901597 <----------
theta [102.1207611621758, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.04571841482194174
theta [102.1213795535383, 108.68133385621667, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.045718635328641316
theta [102.1213795535383, 108.68001763445301, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.045718315942897284 <----------
theta [102.1213795535383, 108.68067574533484, 6.0554544523933395e-6, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.04571847411729412
theta [102.1213795535383, 108.68067574533484, -6.0554544523933395e-6, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.0457184771601207
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54554413899048, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.04571836251945799 <----------
theta [102.1213795535383, 108.68067574533484, 0.0, 34.5451257635858, 51.28311957710237, 22.264706885783603, 13.620450125437278] 0.0457185887592635 <----------
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.283430119697144, 22.264706885783603, 13.620450125437278] 0.04571846316407449
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28280903450759, 22.264706885783603, 13.620450125437278] 0.0457184881134496 <----------
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264841708702047, 13.620450125437278] 0.04571843169465825
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.26457206286516, 13.620450125437278] 0.0457185195832849
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620532603452634] 0.04571842651225944
theta [102.1213795535383, 108.68067574533484, 0.0, 34.54533495128814, 51.28311957710237, 22.264706885783603, 13.620367647421922] 0.04571852475945836
0 4.571848e-02 NaN
* lambda: 10.0