Skip to content

Commit

Permalink
Merge pull request #14 from fipelle/dev
Browse files Browse the repository at this point in the history
Dev: Finalised SKF and SKS implementation
  • Loading branch information
fipelle authored Jul 27, 2022
2 parents f8a7889 + 7808b9a commit 770d5b3
Show file tree
Hide file tree
Showing 33 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/models/dfm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ function initialise(estim::DFMSettings, trends_skeleton::Nothing)
# Build state-space parameters
B, C, D, Q, X0, P0 = initialise_cycles(estim, data);
Q = Symmetric(Q);
R = Symmetric(Matrix(estim.ε * I, estim.n, estim.n));
R = estim.ε * I;

# Generate sspace
sspace = KalmanSettings(estim.Y, B, R, C, D, Q, X0, P0, compute_loglik=false);
Expand Down
2 changes: 1 addition & 1 deletion test/input/dfm/en_baseline.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0.8530343547952473, 0.9999623055355494, 0.7429436408702647, 0.8296310852845952, 1.1308899682418514, 1.225820492253665, 1.0088442898948604, 0.880029465697873, 1.0186283152607216, 0.8079752753006321]
[0.8530340602023277, 0.9998883035503796, 0.7429350378200925, 0.8295688190827926, 1.1306627870186892, 1.2258350826523041, 1.008852566234687, 0.8800639664809817, 1.0186306116627128, 0.8080249539812132]
2 changes: 1 addition & 1 deletion test/input/dfm/en_baseline_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0.9188490170221325, 0.8944887381480445, 0.776148743480139, 0.8389729964779207, 1.1315278653096246, 1.237697598775596, 1.004725341293506, 0.8971490395647279, 1.063868314965728, 0.8191196878672844]
[0.9188508639733765, 0.8944628064410117, 0.7761493122520237, 0.8389668288599301, 1.1315441341142636, 1.2377154151689862, 1.004738694261999, 0.8972449404624099, 1.0638686740385301, 0.819099350445172]
2 changes: 1 addition & 1 deletion test/input/dfm/en_full_sparse.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.1411313544864008, 1.0264534985603047, 0.987256222846602, 1.2375433088981955, 2.4919106648557867, 2.289467674195409, 1.5663022474407127, 1.127081815604002, 1.325631510233351, 0.9160831470696633]
[1.1410850235653014, 1.0268235879619052, 0.9872563268275965, 1.2375421727236788, 2.4920128701442015, 2.2894682822297905, 1.5716530600687688, 1.1270885248835798, 1.3257499037951535, 0.916075439772016]
2 changes: 1 addition & 1 deletion test/input/dfm/en_full_sparse_and_messy.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.0327768125640566, 0.8992868210058322, 0.9500684979439815, 1.253231713071543, 2.3436142169382532, 2.2969799535292332, 1.5821111778296366, 1.150280809019495, 1.2161669684036973, 1.2141770980804956]
[1.0327765331758652, 0.8992864729797636, 0.9500676084679474, 1.2532253266987152, 2.3435555374334536, 2.296968446761632, 1.5821124059446694, 1.1502783514518637, 1.2161751636994533, 1.2137031026581264]
2 changes: 1 addition & 1 deletion test/input/dfm/en_full_sparse_and_messy_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.041315779675676, 1.108673248336458, 1.0072288286197917, 1.2097510169757641, 2.5061695025989352, 2.219115937232337, 1.6224553746547672, 1.1770167096449151, 1.4025400913463184, 1.00437303367525]
[1.0413157002018065, 1.1086803402934073, 1.007229031115973, 1.2096902198756467, 2.506178237306952, 2.2237800420235416, 1.6224632901379803, 1.1770019115705534, 1.402510591922586, 1.0043980753005388]
2 changes: 1 addition & 1 deletion test/input/dfm/en_full_sparse_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.0238522793026565, 1.107346104528619, 1.1502748810568997, 1.2394383540893037, 2.5863501757875236, 2.1486522620313977, 1.709019334536575, 1.1692574239567195, 1.3015531532884776, 1.009297738497619]
[1.023852034341448, 1.107267809359877, 1.1502812566052587, 1.239436674071749, 2.5868542409001822, 2.148656027436264, 1.7090248960364416, 1.1692594094103312, 1.3015539791252504, 1.009324001744583]
2 changes: 1 addition & 1 deletion test/input/dfm/en_sparse_dynamics.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0.8852655164554388, 0.8086676776397602, 0.8406760355267685, 1.0350694644554252, 2.688302264207576, 1.9657566812772957, 1.3099231335926933, 1.0204704930825097, 1.2744383995997195, 1.2480360248856959]
[0.8852658577814903, 0.808665958104899, 0.8406742321738065, 1.0303243386457324, 2.687608270797006, 1.9657497891405837, 1.3099097832262971, 1.0204815182339066, 1.2744426688429145, 1.2480992703605696]
2 changes: 1 addition & 1 deletion test/input/dfm/en_sparse_dynamics_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0.9345481761308683, 1.0450819529619053, 0.8722622567297645, 1.0454659584864694, 2.6876610179901634, 1.946869008192055, 1.4040712759478127, 1.0481938884303588, 1.1983469035541188, 1.3099026012947426]
[0.9345462718634046, 1.045106154020258, 0.8722592713353177, 1.0454651265340027, 2.6877437652012723, 1.9468743601516936, 1.404034115561825, 1.0481881519978595, 1.1983516390378557, 1.3098323306026016]
2 changes: 1 addition & 1 deletion test/input/dfm/lasso_baseline.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0.9993097422463302, 0.9173758410555773, 0.7375668817824412, 0.8178937123337401, 1.1359362650045992, 1.1909037498993134, 1.0272534113117662, 0.8795548332370278, 1.0548052158714163, 0.8197324676052272]
[0.9993114403965118, 0.917511166719462, 0.7375569391912726, 0.8178464847923825, 1.1357056214142967, 1.1909074576422671, 1.0272613983262229, 0.8796006085413233, 1.0547930036669575, 0.8197328838798406]
2 changes: 1 addition & 1 deletion test/input/dfm/lasso_baseline_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.0213288314954936, 0.9032216798254536, 0.7706091070729337, 0.8355263480624466, 1.1640892765048112, 1.2193297609107505, 1.0216183118198128, 0.9015425457556927, 1.0680381643491494, 0.8244572177285069]
[1.021328942660665, 0.9032026562820442, 0.7706101548883844, 0.8355196730996373, 1.1641112766889155, 1.2193381193969328, 1.021626310937559, 0.9016709598675869, 1.0680375187546913, 0.8239585174096556]
2 changes: 1 addition & 1 deletion test/input/dfm/lasso_full_sparse.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.1817579469297348, 1.0612118398791903, 0.9344750222844108, 1.2400851096319097, 2.2492770656967, 2.263251902397874, 1.6029629747889227, 1.1378705165587824, 1.3286691443794942, 1.2181277159708348]
[1.1817363929267624, 1.061346406540387, 0.9344749032824352, 1.2400764813143974, 2.249506100359353, 2.263251918757379, 1.6029814163295462, 1.1378644476717172, 1.3287314453706467, 1.2179538543661326]
2 changes: 1 addition & 1 deletion test/input/dfm/lasso_full_sparse_and_messy.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.2344292173062912, 0.9031759026211628, 0.953505620113848, 1.211762447130664, 2.3589066852270886, 2.2803402621486515, 1.5791386270889705, 1.1585269135808844, 1.2403751300923618, 1.3172977037386726]
[1.2344428720683478, 0.9031763177642397, 0.9535050236731883, 1.2118722521284764, 2.3588589789739354, 2.2803236403077562, 1.579139751868024, 1.1585192377224356, 1.2407759067684965, 1.317131055314701]
2 changes: 1 addition & 1 deletion test/input/dfm/lasso_full_sparse_and_messy_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.2089339607679337, 1.1120227661368238, 1.0130452950504933, 1.225515822835846, 2.214616661475294, 2.214395737234993, 1.6002442117887283, 1.1830841348411645, 1.7676517190581134, 1.220978554701284]
[1.2089354807220474, 1.1119872831042439, 1.0130456035617161, 1.2254611096020769, 2.214609574892326, 2.2192291604502383, 1.6002500296184268, 1.1830266894971202, 1.7671214161088575, 1.221103650350773]
2 changes: 1 addition & 1 deletion test/input/dfm/lasso_full_sparse_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.1871836072716464, 1.122859490839476, 1.166975662689267, 1.213070482812953, 2.2830169046951294, 2.14829526195516, 1.6795092777552787, 1.1738359056727912, 1.6287760961036897, 1.2448515810641325]
[1.1871772456906802, 1.1262558586677118, 1.1669800661656389, 1.2131003959485744, 2.2819891530534724, 2.148294881689899, 1.6795259404616805, 1.173838590711945, 1.6290954057989224, 1.2448424346795544]
2 changes: 1 addition & 1 deletion test/input/dfm/lasso_sparse_dynamics.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0.8831536755094748, 0.8214332265040922, 0.8409032764053478, 1.0056219216355409, 2.7520196159763546, 1.970991376449123, 1.3138847063650194, 1.0269413592161718, 1.2738562251675796, 1.259553778685172]
[0.8831543206787766, 0.8214498796916149, 0.8409017774997833, 1.019803862534158, 2.7521924332401073, 1.9709826620267679, 1.3138617922851894, 1.027002397180248, 1.2738669151425495, 1.260351781086864]
2 changes: 1 addition & 1 deletion test/input/dfm/lasso_sparse_dynamics_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0.9260939881138147, 1.0331683601060921, 0.8829753785094068, 1.0352268776749507, 2.646145749503603, 1.921371754976738, 1.299288002370156, 1.0537737425195306, 1.2004003793977231, 1.2870628750382174]
[0.926092139343615, 1.0331929476569237, 0.8829763361510129, 1.0352255672210502, 2.6462153252309006, 1.9213774724830461, 1.2992736434032635, 1.053765116064689, 1.2004043325948164, 1.2870187289326038]
2 changes: 1 addition & 1 deletion test/input/dfm/mle_baseline.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.0837280437471677, 0.9753030770558616, 0.7188193774097487, 0.9308855269756331, 1.1742756709412931, 1.2536774845327923, 1.0334573507774343, 0.9252573337386304, 1.0930398764697857, 0.8225259189696617]
[1.0837281461148929, 0.9752841619278121, 0.7188102806199176, 0.9309122910800273, 1.1732615540519853, 1.2536920245904986, 1.033453205838118, 0.9253745717389609, 1.0930388812185592, 0.8225377361619397]
2 changes: 1 addition & 1 deletion test/input/dfm/mle_baseline_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.1033273670997499, 0.9787079651259144, 0.7227030173772339, 0.9426805293786276, 1.230161076803913, 1.1996482486675095, 1.0470315999924256, 0.9852216804765739, 1.0949574791508068, 0.9733739032708218]
[1.1033340304949522, 0.9787562006887, 0.7227020132944956, 0.9426969474834179, 1.229855239688311, 1.1996528133159992, 1.0470423355855645, 0.9853157125701308, 1.094957762829401, 0.9733423285039123]
2 changes: 1 addition & 1 deletion test/input/dfm/mle_full_sparse.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.3762730267703713, 1.205848185595222, 1.0476852511428203, 1.3393023944916809, 1.7107633050959983, 2.2196032109260844, 1.7464926392928404, 1.1611778509534438, 1.9960588333860643, 1.5430113862185373]
[1.3762723992621204, 1.205835980440884, 1.0476850305215, 1.3393097337377788, 1.710869491974804, 2.219613850007813, 1.746477462186901, 1.161180904723116, 1.9960652281987112, 1.5427867009922696]
2 changes: 1 addition & 1 deletion test/input/dfm/mle_full_sparse_and_messy.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.3845215773054758, 1.1580230336406383, 1.0438124082249078, 1.2878382292955803, 1.7363734003860274, 2.252084147787137, 1.7134548038769424, 1.173542081023673, 1.7870161621785392, 1.6008493306202767]
[1.3845221162246921, 1.1580126718193229, 1.0438121515705467, 1.2878738663610985, 1.7359509612646624, 2.252086100291961, 1.7134384861748442, 1.1735392020655266, 1.787032335700113, 1.601179307180585]
2 changes: 1 addition & 1 deletion test/input/dfm/mle_full_sparse_and_messy_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.4156575898263224, 1.158046548009902, 1.0878721654615187, 1.2485704428687083, 1.7106085814506762, 2.2319748993849995, 1.6814370877435951, 1.2097166006202142, 1.8441491799175922, 1.6292143986012644]
[1.415665074583545, 1.1580630846642863, 1.087871746002161, 1.248569999326016, 1.7109045236129077, 2.237162500659722, 1.6814512824161325, 1.2097037245976865, 1.8441392396135576, 1.6291986073200468]
2 changes: 1 addition & 1 deletion test/input/dfm/mle_full_sparse_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.3990927285122163, 1.1824800309289414, 1.2391088482446895, 1.2820979539463755, 1.701991214057459, 2.1413375965229173, 1.6679682124481405, 1.207788624298796, 1.9952604704133363, 1.5219445448760807]
[1.399088699873307, 1.1824845890166287, 1.2391085139370446, 1.2820943439295256, 1.7024824934099712, 2.1413372111814706, 1.6679702256245383, 1.2077912352153648, 1.995274982853617, 1.5219685114670247]
2 changes: 1 addition & 1 deletion test/input/dfm/mle_sparse_dynamics.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.3134086645476026, 1.1502059476857378, 0.8919181261984249, 1.061450110980484, 2.036944233605907, 2.072558280151166, 1.403078867420272, 1.0521477973093283, 1.245367719183002, 1.5832622524011748]
[1.313404016250044, 1.1502035768830328, 0.891862637045761, 1.061856616066819, 2.0357133511452847, 2.0725452186462903, 1.4030718888618736, 1.0521434208481386, 1.2453892756707052, 1.583252936791246]
2 changes: 1 addition & 1 deletion test/input/dfm/mle_sparse_dynamics_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.2897759389765426, 1.1684645684604704, 0.9437790990141064, 1.060363307095085, 1.9078197851086192, 1.9735821706965413, 1.4078419506056987, 1.0874256573563976, 1.243382231042154, 1.5081703401668578]
[1.2897749984000622, 1.168660969159202, 0.9437782997894993, 1.0603606210339285, 1.9078788193426417, 1.9735800730997308, 1.4078250887904038, 1.0874116656404134, 1.2434175464974002, 1.5081710302883087]
2 changes: 1 addition & 1 deletion test/input/dfm/ridge_baseline.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0.867478395412445, 1.0082750559405187, 0.7638778247592294, 0.8266673211784978, 0.9620906299595168, 1.1661460375190822, 1.0001890249528318, 0.8847225323523923, 1.0258352403811617, 0.8189239062906557]
[0.867478078488853, 1.0032147781558483, 0.7638800954197391, 0.8265913411737501, 0.9619559346385035, 1.1661487604738374, 1.000196404556444, 0.8847475805378544, 1.025835654033326, 0.8189643942999845]
2 changes: 1 addition & 1 deletion test/input/dfm/ridge_baseline_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0.9081728246711536, 0.8695531781649509, 0.7986833945151266, 0.84129204344975, 1.1051144205628263, 1.2072784307562405, 0.9925382713535016, 0.8945860469540416, 1.062406130864383, 0.8232625755550762]
[0.9081748816530051, 0.8694551765766383, 0.7986827515051946, 0.8412909469784106, 1.1051304991395916, 1.2072941832708382, 0.9925480409643942, 0.8946598713355394, 1.0624085415294056, 0.8232467470997233]
2 changes: 1 addition & 1 deletion test/input/dfm/ridge_full_sparse.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.0166213364386594, 0.8826963903781919, 0.9684986107402724, 1.247744566393186, 2.331318215323777, 2.265036520789484, 1.6823997323975972, 1.1259264308412322, 1.2905183960415452, 0.9170524882171263]
[1.0166213439397795, 0.882729364554258, 0.9684986147987048, 1.2477429289116013, 2.331381448108531, 2.2650364852711613, 1.6824358124006382, 1.125937957556518, 1.2905169409594102, 0.9170692042891079]
2 changes: 1 addition & 1 deletion test/input/dfm/ridge_full_sparse_and_messy.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.0318238108595077, 0.8951339545458649, 0.9504478282472067, 1.2517944364136975, 2.5048920840316744, 2.2540892524329097, 1.6845792417056025, 1.1396615489209843, 1.2885729063913829, 0.91718686974081]
[1.031823653292847, 0.8951336044726992, 0.950446565597753, 1.2518248114479025, 2.5047924175776264, 2.2540782297578863, 1.684582764557546, 1.1396667131803713, 1.2884402965599313, 0.9172192830899063]
2 changes: 1 addition & 1 deletion test/input/dfm/ridge_full_sparse_and_messy_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.0479207263483385, 1.0766651866598296, 1.0007382731213958, 1.2310532303839903, 2.3304302593918473, 2.179602828970087, 1.662606960279033, 1.172867367000999, 1.3527349400188258, 1.0111147185174343]
[1.0479207148835288, 1.0767725528094882, 1.0007383533257972, 1.2310374613182726, 2.330432975551164, 2.1839144625334366, 1.6626183013144047, 1.1728842398346755, 1.3527608989034825, 1.011122087134351]
2 changes: 1 addition & 1 deletion test/input/dfm/ridge_full_sparse_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.0294141547578295, 1.0860284775816598, 1.1320040598729884, 1.238503409848144, 2.276017314015097, 2.1403106000114986, 1.7125900202933035, 1.164120306857508, 1.2884708974942822, 1.0140864421308264]
[1.029414070318683, 1.08598467353071, 1.132015785125199, 1.2385037953485973, 2.270817745525892, 2.1403156188629127, 1.7126290951504983, 1.1641226612614475, 1.2884587521098085, 1.0141034823709685]
2 changes: 1 addition & 1 deletion test/input/dfm/ridge_sparse_dynamics.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0.8842419744578429, 0.8104980294089675, 0.8756302562899557, 1.0373027892370874, 2.69252204527495, 2.015070979827702, 1.3317898246937223, 1.0154022617243894, 1.2631670360415121, 1.2359437350508833]
[0.884242228835067, 0.8104971656300552, 0.8756244950701884, 1.0371557152000586, 2.6920296698411796, 2.0150629416272094, 1.3317613391795444, 1.0154068802438665, 1.2631681904095764, 1.235971277808825]
2 changes: 1 addition & 1 deletion test/input/dfm/ridge_sparse_dynamics_with_idio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0.9147409118300829, 1.0142264977241802, 0.8730245285399624, 1.0420195035523772, 2.656653883750702, 1.9052901128269912, 1.3097361298340673, 1.0443610850719554, 1.2254205961478781, 1.253322054296873]
[0.9147399562162071, 1.0142751895033406, 0.873022658480445, 1.042018289975215, 2.656739423511519, 1.9052967437342172, 1.309716083576784, 1.044357646024599, 1.225421969394446, 1.253341845727791]

0 comments on commit 770d5b3

Please sign in to comment.