Repository Public
1{"job":{"id":"7643cb3f-faa6-4698-a35f-b33f6143b10a","tool":"pca","params":{"symbols":["AAPL","MSFT","NVDA","GOOGL","AMZN","JPM"],"basis":"correlation","return_type":"log","frequency":"daily","data_period":756,"n_components":5,"rolling_window":126,"absorption_fraction":0.2},"status":"done","startedAt":1795217741083,"finishedAt":1795217753343,"error":null,"progress":1,"engineVersion":"1.0.0","durationMs":12260,"projectId":null,"sessionId":null,"cancellable":false,"code":"import numpy as np, pandas as pd\n# px: adjusted closes, one column per symbol (AAPL, MSFT, NVDA, GOOGL, AMZN, JPM), common sessions, daily\npx = pd.read_csv(\"closes.csv\", index_col=0, parse_dates=True).dropna()\nr = np.log(px / px.shift(1)).dropna().loc[\"2023-11-11\":]\nC = r.corr().to_numpy()\nlam, V = np.linalg.eigh(C); lam, V = lam[::-1], V[:, ::-1]\nprint(\"explained:\", lam / lam.sum())\nT, N = r.shape\nprint(\"Marchenko-Pastur upper bound:\", 1.0 * (1 + np.sqrt(N / T)) ** 2)","result":{"success":true,"schema":"lab/1","engine":"pca","engineVersion":"1.0.0","title":"Principal components","headline":"PCA of 6 assets over 759 daily returns (2023-11-13 → 2026-11-20, correlation basis): PC1 explains 46.9% of the variance with loadings all of the same sign (a market mode); 1 component above the Marchenko-Pastur noise bound.","summary":[{"label":"Assets","value":6,"unit":"count","kind":"observed"},{"label":"Observations","value":759,"unit":"count","kind":"observed"},{"label":"PC1 explained variance","value":0.4687918441593652,"unit":"percent","kind":"calculated","decimals":1},{"label":"Cumulative, first 5","value":0.9384222337931257,"unit":"percent","kind":"calculated","decimals":1},{"label":"Components above MP bound","value":1,"unit":"count","kind":"calculated","note":"heuristic"},{"label":"Kaiser rule","value":1,"unit":"count","kind":"calculated","note":"heuristic"},{"label":"Bai-Ng IC_p2","value":5,"unit":"count","kind":"calculated","note":"heuristic; at the upper limit of the search (5), not informative"},{"label":"Absorption ratio (top 1)","value":0.4687918441593652,"unit":"percent","kind":"calculated","decimals":1},{"label":"First-component share, latest window","value":0.37058737370892986,"unit":"percent","kind":"calculated","decimals":1,"note":"126-period window; full sample 46.9%; range over the windows 32.4% – 71.9%"},{"label":"Effective number of components","value":4.615731733104908,"unit":"count","kind":"calculated","decimals":2,"note":"exp of the entropy of the explained-variance shares"}],"tables":[{"id":"eigenvalues","title":"Spectrum","columns":[{"key":"component","label":"Component","type":"text"},{"key":"eigenvalue","label":"Eigenvalue","decimals":4,"type":"number"},{"key":"explained","label":"Explained variance","unit":"percent","decimals":2,"type":"number"},{"key":"cumulative","label":"Cumulative","unit":"percent","decimals":2,"type":"number"},{"key":"above_noise_bound","label":"Above MP bound","type":"text"},{"key":"reconstruction_rmse","label":"Reconstruction RMSE with k components","decimals":5,"type":"number"}],"rows":[{"component":"PC1","eigenvalue":2.8127510649561924,"explained":0.4687918441593652,"cumulative":0.4687918441593652,"above_noise_bound":true,"reconstruction_rmse":0.7283599912456976},{"component":"PC2","eigenvalue":0.8296492634396992,"explained":0.1382748772399498,"cumulative":0.6070667213993151,"above_noise_bound":false,"reconstruction_rmse":0.626430826146353},{"component":"PC3","eigenvalue":0.7108097840456118,"explained":0.11846829734093525,"cumulative":0.7255350187402503,"above_noise_bound":false,"reconstruction_rmse":0.5235488203775233},{"component":"PC4","eigenvalue":0.6829099184739907,"explained":0.11381831974566507,"cumulative":0.8393533384859153,"above_noise_bound":false,"reconstruction_rmse":0.4005433882035322},{"component":"PC5","eigenvalue":0.5944133718432625,"explained":0.09906889530721037,"cumulative":0.9384222337931257,"above_noise_bound":false,"reconstruction_rmse":0.24798515294291215},{"component":"PC6","eigenvalue":0.3694665972412456,"explained":0.06157776620687424,"cumulative":1,"above_noise_bound":false,"reconstruction_rmse":0}],"note":"Marchenko-Pastur upper bound λ₊ = 1.1857 (N/T = 0.008). Reconstruction RMSE is in units of the decomposed data (standardised returns); the unexplained share with k components is 1 − cumulative."},{"id":"loadings","title":"Loadings (eigenvectors)","columns":[{"key":"symbol","label":"Symbol","type":"text"},{"key":"pc1","label":"PC1","decimals":4,"type":"number"},{"key":"pc2","label":"PC2","decimals":4,"type":"number"},{"key":"pc3","label":"PC3","decimals":4,"type":"number"},{"key":"pc4","label":"PC4","decimals":4,"type":"number"},{"key":"pc5","label":"PC5","decimals":4,"type":"number"},{"key":"communality","label":"Variance explained by PC1-5","unit":"percent","decimals":1,"type":"number"}],"rows":[{"symbol":"AAPL","pc1":0.3676203476018125,"pc2":0.35825370839626264,"pc3":-0.7186739784897079,"pc4":0.4351973709914944,"pc5":0.15788869159950286,"communality":0.9978971134569393},{"symbol":"MSFT","pc1":0.4338095955332994,"pc2":-0.2550239453762293,"pc3":0.08395149080498017,"pc4":0.3045880198231053,"pc5":-0.6971102668551272,"communality":0.9405204653908172},{"symbol":"NVDA","pc1":0.3947922678731896,"pc2":-0.24462478957409253,"pc3":0.48566878308213984,"pc4":0.45544213909628256,"pc5":0.5837434664531826,"communality":0.9999114632408791},{"symbol":"GOOGL","pc1":0.4255784644619775,"pc2":-0.22900071732996297,"pc3":-0.24993942684219425,"pc4":-0.6179721592535119,"pc5":0.3187576019955908,"communality":0.918541509656554},{"symbol":"AMZN","pc1":0.4864184081251358,"pc2":-0.18125166759811145,"pc3":0.014364306014175283,"pc4":-0.29779829159672805,"pc5":-0.2050663747291641,"communality":0.7784668708509641},{"symbol":"JPM","pc1":0.3210664773891786,"pc2":0.8133156118544425,"pc3":0.42179336480726703,"pc4":-0.1995706198501057,"pc5":-0.06850821417064891,"communality":0.9951959801626052}],"note":"Each column is a unit-length eigenvector; signs are normalised so that each column sums to a positive number (the sign of a component is arbitrary)."},{"id":"selection","title":"Number of components: heuristics","columns":[{"key":"rule","label":"Rule","type":"text"},{"key":"components","label":"Components","type":"integer"},{"key":"detail","label":"Detail","type":"text"}],"rows":[{"rule":"Marchenko-Pastur","components":1,"detail":"eigenvalues above λ₊ = σ²(1+√(N/T))² = 1.186"},{"rule":"Marchenko-Pastur, dominant mode removed","components":4,"detail":"σ² reduced to the variance left after PC1: bound 0.630"},{"rule":"Kaiser","components":1,"detail":"eigenvalues above the average eigenvalue (1 for a correlation matrix)"},{"rule":"Bai-Ng IC_p2","components":5,"detail":"minimum of the criterion over k = 0…5 (at the upper limit: not informative)"}],"note":"Heuristics, not tests: they rest on asymptotics in both N and T and on idealised noise (independent, identically distributed, finite fourth moments). They often disagree."}],"charts":[{"id":"rolling_share","title":"Market-mode strength (126-period window)","type":"line","x":{"label":"Window end","type":"time"},"y":{"label":"Share of total variance","unit":"percent"},"series":[{"name":"First component share","kind":"calculated","x":["2024-05-14","2024-05-21","2024-05-24","2024-06-03","2024-06-06","2024-06-13","2024-06-18","2024-06-26","2024-07-01","2024-07-08","2024-07-12","2024-07-18","2024-07-24","2024-07-30","2024-08-05","2024-08-09","2024-08-14","2024-08-21","2024-08-26","2024-09-03","2024-09-06","2024-09-13","2024-09-18","2024-09-25","2024-09-30","2024-10-07","2024-10-10","2024-10-17","2024-10-22","2024-10-29","2024-11-01","2024-11-08","2024-11-13","2024-11-20","2024-11-25","2024-12-03","2024-12-06","2024-12-13","2024-12-18","2024-12-24","2024-12-31","2025-01-07","2025-01-14","2025-01-21","2025-01-27","2025-01-31","2025-02-05","2025-02-12","2025-02-18","2025-02-25","2025-02-28","2025-03-07","2025-03-12","2025-03-19","2025-03-26","2025-03-31","2025-04-07","2025-04-10","2025-04-17","2025-04-23","2025-04-30","2025-05-05","2025-05-09","2025-05-15","2025-05-21","2025-05-28","2025-06-03","2025-06-09","2025-06-13","2025-06-18","2025-06-26","2025-07-01","2025-07-09","2025-07-14","2025-07-21","2025-07-24","2025-07-31","2025-08-05","2025-08-12","2025-08-15","2025-08-22","2025-08-27","2025-09-04","2025-09-09","2025-09-16","2025-09-19","2025-09-26","2025-10-01","2025-10-08","2025-10-13","2025-10-20","2025-10-23","2025-10-29","2025-11-04","2025-11-10","2025-11-14","2025-11-20","2025-11-26","2025-12-03","2025-12-08","2025-12-15","2025-12-18","2025-12-26","2025-12-31","2026-01-08","2026-01-13","2026-01-21","2026-01-28","2026-02-02","2026-02-09","2026-02-12","2026-02-20","2026-02-25","2026-03-04","2026-03-09","2026-03-13","2026-03-19","2026-03-25","2026-03-31","2026-04-07","2026-04-13","2026-04-17","2026-04-22","2026-04-29","2026-05-04","2026-05-11","2026-05-14","2026-05-21","2026-05-27","2026-06-03","2026-06-08","2026-06-15","2026-06-18","2026-06-26","2026-07-01","2026-07-09","2026-07-14","2026-07-21","2026-07-24","2026-07-31","2026-08-05","2026-08-12","2026-08-17","2026-08-24","2026-08-27","2026-09-02","2026-09-09","2026-09-15","2026-09-21","2026-09-25","2026-10-01","2026-10-07","2026-10-12","2026-10-19","2026-10-22","2026-10-29","2026-11-03","2026-11-10","2026-11-13","2026-11-20"],"y":[0.47282129383725624,0.47100832418115757,0.4657216868660478,0.4641346925579268,0.45989182338787415,0.446832804643414,0.44681712570495075,0.4405760276748276,0.44264110322705186,0.43464070683656014,0.43716972142463084,0.4450906974881688,0.4560044839017419,0.45568494936807585,0.4653524563161757,0.4699070632545836,0.466597985712907,0.4671538034412106,0.46650894293176853,0.47634649389422273,0.4831376425560594,0.4871208217840262,0.4872198478202668,0.49223900318549946,0.4938238840464426,0.4918723409166801,0.4892427853631432,0.4833589315876809,0.4768909425461541,0.49035860673647774,0.4862731745041869,0.49905911150545385,0.4958410549917848,0.5003078768417409,0.4978467283069818,0.49979742295719176,0.4995987312021572,0.5035672654096897,0.5172880288956283,0.5249066998392754,0.5277645282572897,0.532720837618687,0.5294966627282194,0.5300390482172034,0.49897246452279537,0.4929387784377796,0.4620753579823112,0.46140217588335625,0.4567062854544499,0.45888892134407816,0.46552934673017893,0.46392577875249147,0.47343439344586563,0.49004852741141186,0.4956039720226931,0.5048088690472876,0.557662013042727,0.6431537406442767,0.6525539828172648,0.6627182951652069,0.6658543171752317,0.6581011890850758,0.6534515623912969,0.6687118581567009,0.6701667888247471,0.6780853938534387,0.6805327409697122,0.682225007041846,0.6898610428220933,0.6916951483447278,0.6867199137909655,0.6823723097125499,0.6805782747737333,0.680893328155515,0.6768116774819022,0.6789959722615111,0.6931520846505327,0.7047397414898069,0.7121830893574724,0.7113834392850301,0.7170472093082485,0.7192442166503915,0.7138818903701253,0.7044901694860276,0.6990611238162399,0.6953161786904605,0.6895318943632918,0.684347324558763,0.6468732230731699,0.5057971224976044,0.47589688658831314,0.44182395710111905,0.44855659119029057,0.4342283074259531,0.41232691506470803,0.41689544009586627,0.42516195338246554,0.4072633697357543,0.40452643393843407,0.39611456782990795,0.37617442893621417,0.38139790400785595,0.38276518103219975,0.3872072469684609,0.3702213689570784,0.3710933269168477,0.38776443445779846,0.3861473691164352,0.3582625758246883,0.34296732051485646,0.35135299142510806,0.35192646165968106,0.3511045094554958,0.3448590104005971,0.3470101904079013,0.3583576417677659,0.3632156597559108,0.37232398280332474,0.4120802439938376,0.41392748765843085,0.42524317728231553,0.4071644282962031,0.40795898031414773,0.39659956443438077,0.38135286573929805,0.3925820538365944,0.3866817679715999,0.381841648383452,0.3741246493600388,0.3624465465550785,0.3723280811582384,0.38669368605836485,0.38578072870009367,0.37860654690660683,0.37795457505402585,0.37876591030525164,0.3779555440334288,0.3820845252656478,0.3752695689252097,0.35967451260286315,0.3622593573027776,0.36748474714944335,0.3622778600825902,0.3584114649341406,0.35175214014767386,0.3532186879457581,0.35647364399372,0.34954629134504345,0.3483253461605285,0.34485789120639876,0.32661764357624934,0.323635704627334,0.32735738301942785,0.32601564662048516,0.3306251409383908,0.34109399659855705,0.34300115968672884,0.35237330804907063,0.3525299336420799,0.37058737370892986]},{"name":"Absorption ratio (top 1 of 6)","kind":"calculated","x":["2024-05-14","2024-05-21","2024-05-24","2024-06-03","2024-06-06","2024-06-13","2024-06-18","2024-06-26","2024-07-01","2024-07-08","2024-07-12","2024-07-18","2024-07-24","2024-07-30","2024-08-05","2024-08-09","2024-08-14","2024-08-21","2024-08-26","2024-09-03","2024-09-06","2024-09-13","2024-09-18","2024-09-25","2024-09-30","2024-10-07","2024-10-10","2024-10-17","2024-10-22","2024-10-29","2024-11-01","2024-11-08","2024-11-13","2024-11-20","2024-11-25","2024-12-03","2024-12-06","2024-12-13","2024-12-18","2024-12-24","2024-12-31","2025-01-07","2025-01-14","2025-01-21","2025-01-27","2025-01-31","2025-02-05","2025-02-12","2025-02-18","2025-02-25","2025-02-28","2025-03-07","2025-03-12","2025-03-19","2025-03-26","2025-03-31","2025-04-07","2025-04-10","2025-04-17","2025-04-23","2025-04-30","2025-05-05","2025-05-09","2025-05-15","2025-05-21","2025-05-28","2025-06-03","2025-06-09","2025-06-13","2025-06-18","2025-06-26","2025-07-01","2025-07-09","2025-07-14","2025-07-21","2025-07-24","2025-07-31","2025-08-05","2025-08-12","2025-08-15","2025-08-22","2025-08-27","2025-09-04","2025-09-09","2025-09-16","2025-09-19","2025-09-26","2025-10-01","2025-10-08","2025-10-13","2025-10-20","2025-10-23","2025-10-29","2025-11-04","2025-11-10","2025-11-14","2025-11-20","2025-11-26","2025-12-03","2025-12-08","2025-12-15","2025-12-18","2025-12-26","2025-12-31","2026-01-08","2026-01-13","2026-01-21","2026-01-28","2026-02-02","2026-02-09","2026-02-12","2026-02-20","2026-02-25","2026-03-04","2026-03-09","2026-03-13","2026-03-19","2026-03-25","2026-03-31","2026-04-07","2026-04-13","2026-04-17","2026-04-22","2026-04-29","2026-05-04","2026-05-11","2026-05-14","2026-05-21","2026-05-27","2026-06-03","2026-06-08","2026-06-15","2026-06-18","2026-06-26","2026-07-01","2026-07-09","2026-07-14","2026-07-21","2026-07-24","2026-07-31","2026-08-05","2026-08-12","2026-08-17","2026-08-24","2026-08-27","2026-09-02","2026-09-09","2026-09-15","2026-09-21","2026-09-25","2026-10-01","2026-10-07","2026-10-12","2026-10-19","2026-10-22","2026-10-29","2026-11-03","2026-11-10","2026-11-13","2026-11-20"],"y":[0.47282129383725624,0.47100832418115757,0.4657216868660478,0.4641346925579268,0.45989182338787415,0.446832804643414,0.44681712570495075,0.4405760276748276,0.44264110322705186,0.43464070683656014,0.43716972142463084,0.4450906974881688,0.4560044839017419,0.45568494936807585,0.4653524563161757,0.4699070632545836,0.466597985712907,0.4671538034412106,0.46650894293176853,0.47634649389422273,0.4831376425560594,0.4871208217840262,0.4872198478202668,0.49223900318549946,0.4938238840464426,0.4918723409166801,0.4892427853631432,0.4833589315876809,0.4768909425461541,0.49035860673647774,0.4862731745041869,0.49905911150545385,0.4958410549917848,0.5003078768417409,0.4978467283069818,0.49979742295719176,0.4995987312021572,0.5035672654096897,0.5172880288956283,0.5249066998392754,0.5277645282572897,0.532720837618687,0.5294966627282194,0.5300390482172034,0.49897246452279537,0.4929387784377796,0.4620753579823112,0.46140217588335625,0.4567062854544499,0.45888892134407816,0.46552934673017893,0.46392577875249147,0.47343439344586563,0.49004852741141186,0.4956039720226931,0.5048088690472876,0.557662013042727,0.6431537406442767,0.6525539828172648,0.6627182951652069,0.6658543171752317,0.6581011890850758,0.6534515623912969,0.6687118581567009,0.6701667888247471,0.6780853938534387,0.6805327409697122,0.682225007041846,0.6898610428220933,0.6916951483447278,0.6867199137909655,0.6823723097125499,0.6805782747737333,0.680893328155515,0.6768116774819022,0.6789959722615111,0.6931520846505327,0.7047397414898069,0.7121830893574724,0.7113834392850301,0.7170472093082485,0.7192442166503915,0.7138818903701253,0.7044901694860276,0.6990611238162399,0.6953161786904605,0.6895318943632918,0.684347324558763,0.6468732230731699,0.5057971224976044,0.47589688658831314,0.44182395710111905,0.44855659119029057,0.4342283074259531,0.41232691506470803,0.41689544009586627,0.42516195338246554,0.4072633697357543,0.40452643393843407,0.39611456782990795,0.37617442893621417,0.38139790400785595,0.38276518103219975,0.3872072469684609,0.3702213689570784,0.3710933269168477,0.38776443445779846,0.3861473691164352,0.3582625758246883,0.34296732051485646,0.35135299142510806,0.35192646165968106,0.3511045094554958,0.3448590104005971,0.3470101904079013,0.3583576417677659,0.3632156597559108,0.37232398280332474,0.4120802439938376,0.41392748765843085,0.42524317728231553,0.4071644282962031,0.40795898031414773,0.39659956443438077,0.38135286573929805,0.3925820538365944,0.3866817679715999,0.381841648383452,0.3741246493600388,0.3624465465550785,0.3723280811582384,0.38669368605836485,0.38578072870009367,0.37860654690660683,0.37795457505402585,0.37876591030525164,0.3779555440334288,0.3820845252656478,0.3752695689252097,0.35967451260286315,0.3622593573027776,0.36748474714944335,0.3622778600825902,0.3584114649341406,0.35175214014767386,0.3532186879457581,0.35647364399372,0.34954629134504345,0.3483253461605285,0.34485789120639876,0.32661764357624934,0.323635704627334,0.32735738301942785,0.32601564662048516,0.3306251409383908,0.34109399659855705,0.34300115968672884,0.35237330804907063,0.3525299336420799,0.37058737370892986],"style":"dashed"}],"note":"Each point uses the 126 periods ending at that date (past data only). With a short window the first share is biased upwards: under pure noise its expectation is about (1+√(N/w))²/N = 24.7%."},{"id":"scree","title":"Scree: explained variance","type":"bar","x":{"label":"Component","type":"category"},"y":{"label":"Share of total variance","unit":"percent"},"series":[{"name":"Explained variance","kind":"calculated","x":["PC1","PC2","PC3","PC4","PC5","PC6"],"y":[0.4687918441593652,0.1382748772399498,0.11846829734093525,0.11381831974566507,0.09906889530721037,0.06157776620687424],"style":"bar"},{"name":"Cumulative","kind":"calculated","x":["PC1","PC2","PC3","PC4","PC5","PC6"],"y":[0.4687918441593652,0.6070667213993151,0.7255350187402503,0.8393533384859153,0.9384222337931257,1],"style":"line"}]},{"id":"eigenvalues","title":"Eigenvalues and the noise bound","type":"bar","x":{"label":"Component","type":"category"},"y":{"label":"Eigenvalue","log":false},"series":[{"name":"Eigenvalue","kind":"calculated","x":["PC1","PC2","PC3","PC4","PC5","PC6"],"y":[2.8127510649561924,0.8296492634396992,0.7108097840456118,0.6829099184739907,0.5944133718432625,0.3694665972412456],"style":"bar"},{"name":"Marchenko-Pastur upper bound","kind":"calculated","x":["PC1","PC2","PC3","PC4","PC5","PC6"],"y":[1.1857268281296758,1.1857268281296758,1.1857268281296758,1.1857268281296758,1.1857268281296758,1.1857268281296758],"style":"dashed"}],"note":"Eigenvalues below the dashed line are not distinguishable from those of uncorrelated noise of the same dimensions."},{"id":"loadings_pc1","title":"Loadings of the leading components","type":"bar","x":{"label":"Symbol","type":"category"},"y":{"label":"Loading"},"series":[{"name":"PC1","kind":"calculated","x":["AAPL","MSFT","NVDA","GOOGL","AMZN","JPM"],"y":[0.3676203476018125,0.4338095955332994,0.3947922678731896,0.4255784644619775,0.4864184081251358,0.3210664773891786],"style":"bar"},{"name":"PC2","kind":"calculated","x":["AAPL","MSFT","NVDA","GOOGL","AMZN","JPM"],"y":[0.35825370839626264,-0.2550239453762293,-0.24462478957409253,-0.22900071732996297,-0.18125166759811145,0.8133156118544425],"style":"bar"},{"name":"PC3","kind":"calculated","x":["AAPL","MSFT","NVDA","GOOGL","AMZN","JPM"],"y":[-0.7186739784897079,0.08395149080498017,0.48566878308213984,-0.24993942684219425,0.014364306014175283,0.42179336480726703],"style":"bar"}]},{"id":"loadings_map","title":"Loadings map","type":"heatmap","x":{"label":"Component","type":"category"},"y":{"label":"Symbol"},"series":[],"z":{"label":"Loading","unit":null},"matrix":{"x":["PC1","PC2","PC3","PC4","PC5"],"y":["AAPL","MSFT","NVDA","GOOGL","AMZN","JPM"],"z":[[0.3676203476018125,0.35825370839626264,-0.7186739784897079,0.4351973709914944,0.15788869159950286],[0.4338095955332994,-0.2550239453762293,0.08395149080498017,0.3045880198231053,-0.6971102668551272],[0.3947922678731896,-0.24462478957409253,0.48566878308213984,0.45544213909628256,0.5837434664531826],[0.4255784644619775,-0.22900071732996297,-0.24993942684219425,-0.6179721592535119,0.3187576019955908],[0.4864184081251358,-0.18125166759811145,0.014364306014175283,-0.29779829159672805,-0.2050663747291641],[0.3210664773891786,0.8133156118544425,0.42179336480726703,-0.1995706198501057,-0.06850821417064891]]}},{"id":"components","title":"Component series (cumulated scores)","type":"line","x":{"label":"Date","type":"time"},"y":{"label":"Cumulated score (standardised units)"},"series":[{"name":"PC1","kind":"calculated","x":["2023-11-13","2023-11-20","2023-11-28","2023-12-04","2023-12-11","2023-12-18","2023-12-26","2024-01-02","2024-01-09","2024-01-17","2024-01-24","2024-01-30","2024-02-06","2024-02-13","2024-02-21","2024-02-28","2024-03-05","2024-03-12","2024-03-19","2024-03-26","2024-04-02","2024-04-09","2024-04-16","2024-04-23","2024-04-29","2024-05-06","2024-05-13","2024-05-20","2024-05-24","2024-06-03","2024-06-10","2024-06-17","2024-06-25","2024-07-01","2024-07-09","2024-07-16","2024-07-23","2024-07-29","2024-08-05","2024-08-12","2024-08-19","2024-08-23","2024-08-30","2024-09-09","2024-09-16","2024-09-23","2024-09-27","2024-10-04","2024-10-11","2024-10-18","2024-10-24","2024-10-31","2024-11-07","2024-11-14","2024-11-20","2024-11-27","2024-12-05","2024-12-12","2024-12-19","2024-12-26","2025-01-03","2025-01-13","2025-01-21","2025-01-27","2025-02-03","2025-02-10","2025-02-18","2025-02-24","2025-03-03","2025-03-10","2025-03-17","2025-03-21","2025-03-28","2025-04-04","2025-04-11","2025-04-21","2025-04-25","2025-05-02","2025-05-09","2025-05-16","2025-05-22","2025-05-30","2025-06-06","2025-06-13","2025-06-20","2025-06-27","2025-07-07","2025-07-14","2025-07-21","2025-07-25","2025-08-01","2025-08-08","2025-08-15","2025-08-21","2025-08-28","2025-09-05","2025-09-12","2025-09-18","2025-09-25","2025-10-02","2025-10-09","2025-10-15","2025-10-22","2025-10-29","2025-11-05","2025-11-12","2025-11-18","2025-11-25","2025-12-03","2025-12-10","2025-12-16","2025-12-23","2025-12-31","2026-01-08","2026-01-14","2026-01-22","2026-01-29","2026-02-05","2026-02-12","2026-02-19","2026-02-26","2026-03-05","2026-03-12","2026-03-18","2026-03-25","2026-04-01","2026-04-09","2026-04-15","2026-04-22","2026-04-29","2026-05-06","2026-05-13","2026-05-19","2026-05-27","2026-06-03","2026-06-10","2026-06-16","2026-06-24","2026-07-01","2026-07-09","2026-07-15","2026-07-22","2026-07-29","2026-08-05","2026-08-11","2026-08-18","2026-08-25","2026-09-01","2026-09-09","2026-09-15","2026-09-22","2026-09-29","2026-10-06","2026-10-12","2026-10-19","2026-10-26","2026-11-02","2026-11-06","2026-11-13","2026-11-20"],"y":[-0.7697607287963905,3.112122994453464,2.4698385140016024,-0.6784853106648577,0.6842551034938178,4.160887329806894,4.318536542730686,1.8813823296116474,3.543184452192111,4.0275343859291075,9.240123057566404,10.214693167850339,10.99340720019319,10.760898279297212,9.236341355459643,10.899412371707367,10.102816271806518,12.90790486791246,14.571236138712809,14.782761524590372,15.009203423223099,15.151172551687479,11.678801205430554,10.972837902802032,13.249160355573565,16.203333844275402,16.622245414479085,18.26704120015528,19.496644378756656,18.980275911942954,21.155512608628847,24.68231829445803,24.48497307760236,27.033100546205613,29.867937555532748,28.0905329418451,24.536543210234306,19.260186388824337,8.263242082953106,12.92091559119096,19.621465039627065,18.925496312243126,18.115377957963286,11.366842120529444,14.862598729264779,17.43783066995896,16.81346876601494,16.252627819503207,17.720433001987214,18.663121175718352,17.994359027351543,15.931671525959356,23.690565760373584,23.195227596998038,21.01702289706627,20.87644780052757,24.907415673476876,27.378266543428104,23.839649014332792,27.302863426096124,24.223570657541423,20.922433158669794,24.414615604765647,22.817442457990715,21.777742823167777,21.349800578771337,22.479976109854036,17.53216884613599,10.95425380664274,4.137311766108389,4.410961942653915,5.115619195394168,1.1467703372566342,-13.007238868574866,-2.2505634635694785,-11.570471576698061,0.08313400585025388,3.479472798974475,1.56081059423341,9.874682790511772,7.931446405101828,8.499409456631348,10.860609318766762,9.718310872199968,9.618436729269764,15.247454436553049,16.072218434895735,16.72685620361662,19.081771267237144,20.28776928765526,16.150636348537347,21.097618398143897,21.832996840653774,18.265470629265735,22.11214409040937,22.346670657177132,23.915698086305817,25.40929138689664,24.662745323277136,25.446001848220288,25.406017051885737,22.754991511225786,22.882951049882934,30.167907662992402,30.381685152405403,30.45310868088063,23.882224949582593,26.81954582946297,27.693106793240155,26.94922826638652,24.103115413369295,27.045317224220554,25.637766872021185,26.66774706917935,23.368433560070343,20.613608020012453,21.878631650920124,16.630709014942976,11.935260287181567,11.901439587490781,12.930097544319228,11.701081572943778,8.556244092032227,7.478752038643298,5.210900121003846,4.951770081752137,10.864246778518808,16.901563123942854,19.79418446295363,20.06093287662357,24.397444271849725,24.04702017900224,21.967786131437617,23.02683270346495,19.871516520437083,14.469775930392434,18.124380570074404,11.94339656214105,14.49777349767837,16.45183268695125,20.36571194609239,16.709411595368415,13.145065454191142,25.389702127982886,24.307054467171163,22.04010252392717,21.615080673296376,21.452790298329347,19.613992424988385,20.283948597621528,21.567202278233907,19.078222355215456,21.740229142113048,22.456894133395707,20.829960622454077,17.23545878786177,11.534688607795271,12.872465624300878,13.356491909933318,-1.3322676295501878e-14]},{"name":"PC2","kind":"calculated","x":["2023-11-13","2023-11-20","2023-11-28","2023-12-04","2023-12-11","2023-12-18","2023-12-26","2024-01-02","2024-01-09","2024-01-17","2024-01-24","2024-01-30","2024-02-06","2024-02-13","2024-02-21","2024-02-28","2024-03-05","2024-03-12","2024-03-19","2024-03-26","2024-04-02","2024-04-09","2024-04-16","2024-04-23","2024-04-29","2024-05-06","2024-05-13","2024-05-20","2024-05-24","2024-06-03","2024-06-10","2024-06-17","2024-06-25","2024-07-01","2024-07-09","2024-07-16","2024-07-23","2024-07-29","2024-08-05","2024-08-12","2024-08-19","2024-08-23","2024-08-30","2024-09-09","2024-09-16","2024-09-23","2024-09-27","2024-10-04","2024-10-11","2024-10-18","2024-10-24","2024-10-31","2024-11-07","2024-11-14","2024-11-20","2024-11-27","2024-12-05","2024-12-12","2024-12-19","2024-12-26","2025-01-03","2025-01-13","2025-01-21","2025-01-27","2025-02-03","2025-02-10","2025-02-18","2025-02-24","2025-03-03","2025-03-10","2025-03-17","2025-03-21","2025-03-28","2025-04-04","2025-04-11","2025-04-21","2025-04-25","2025-05-02","2025-05-09","2025-05-16","2025-05-22","2025-05-30","2025-06-06","2025-06-13","2025-06-20","2025-06-27","2025-07-07","2025-07-14","2025-07-21","2025-07-25","2025-08-01","2025-08-08","2025-08-15","2025-08-21","2025-08-28","2025-09-05","2025-09-12","2025-09-18","2025-09-25","2025-10-02","2025-10-09","2025-10-15","2025-10-22","2025-10-29","2025-11-05","2025-11-12","2025-11-18","2025-11-25","2025-12-03","2025-12-10","2025-12-16","2025-12-23","2025-12-31","2026-01-08","2026-01-14","2026-01-22","2026-01-29","2026-02-05","2026-02-12","2026-02-19","2026-02-26","2026-03-05","2026-03-12","2026-03-18","2026-03-25","2026-04-01","2026-04-09","2026-04-15","2026-04-22","2026-04-29","2026-05-06","2026-05-13","2026-05-19","2026-05-27","2026-06-03","2026-06-10","2026-06-16","2026-06-24","2026-07-01","2026-07-09","2026-07-15","2026-07-22","2026-07-29","2026-08-05","2026-08-11","2026-08-18","2026-08-25","2026-09-01","2026-09-09","2026-09-15","2026-09-22","2026-09-29","2026-10-06","2026-10-12","2026-10-19","2026-10-26","2026-11-02","2026-11-06","2026-11-13","2026-11-20"],"y":[-0.2901559256738375,1.6669782743053467,1.5059514929492233,4.582314407978327,4.458329696082058,5.615873660478706,5.409422685974968,6.426127966208293,4.719585562540368,2.0102434701019214,2.1179494905537273,2.3143972955616507,1.3411438653016803,-0.1351833233309185,2.2809107311681593,1.9350811263588248,1.2723159047092323,0.23430779097960108,0.7783659218305199,-0.3675724632242842,0.09148315701805598,-0.3682278232099403,-4.883843769743441,-1.4187600511533789,-1.38749883702405,-2.3208443731448978,0.09731456472460187,-1.6782476960671482,-1.390687226862233,-0.6301265503777523,-3.10705499606341,-3.486250705691286,-3.919401099343756,-1.8290490110715978,-1.036971932923695,2.138392775025218,1.0144705050637999,2.6957825124307933,1.1660982760583198,3.2562010956569187,3.3642997921720665,4.352729518457307,6.676765122289413,6.289967211935407,0.43096509366591057,1.3875770957910645,1.064239343483103,1.3346866952548948,3.5399698919104523,4.488516084996341,3.6102071605963517,2.7505605291515427,2.8231575251511614,4.30600840075241,4.7651673130607515,7.752469681513637,5.183000468354244,3.1151819074167038,2.3354134792869052,4.120350368255066,3.2223454194265586,3.863712403212987,4.881717849575268,7.365787146108071,7.511693435976778,8.05681894475563,11.313337825255298,9.159121634175014,10.8309058582119,4.672830591467312,2.380702923452837,4.438426119877504,6.401850330251735,-0.7517336547196938,2.443086826104513,3.8908999229956818,4.2143709305263695,3.5328703622341475,3.137284894352062,4.020855872565205,1.312284270654934,1.2745910115159294,0.5267398089938162,-0.824560060306558,2.0068096116663554,1.4783848989906645,3.3975884397653333,1.568897571257829,0.9304063955966805,1.849279148669782,-0.6761550918022834,0.2391470634392947,0.2662436077277569,0.9579903000195165,1.7851089098406532,0.7832148263773948,1.267366296158336,2.026184097821097,4.27126460143905,2.102588959323916,1.1671302778909494,1.4889097731667205,-0.4567872575906041,-0.9058414287254876,0.3489583110039868,1.9971465713827672,-0.39235516940945403,-0.33198610110409443,1.5624679834315618,0.3637118140315785,2.0438165589050157,1.926765090546302,1.3607363259578262,0.8520451636583986,-2.3517765658576475,-3.827855010420924,-2.972389949513095,2.2579555634078057,0.3841096127622321,1.148626802884582,1.2722738257908184,-2.752719477074165,-4.757630095950349,-4.14228670771014,-1.191935905036343,-1.1689448860814045,-0.23290578351858385,-4.056426951667628,-3.7334745364547053,-5.438123388748189,-4.797718655586951,-7.119349122979853,-7.58712600735705,-6.327074731101125,-5.231803236767607,-3.0797666510619184,0.11472864849375419,2.668038378956334,1.1295245293339717,2.57665719178697,3.509143151329147,4.922741003773956,6.695687466801824,-0.0953047288183756,-0.05738978373521464,1.2910885665186294,-0.18474847031011044,0.5166517378553594,-0.09105552122372906,0.33745424635325993,-2.4199872197742955,-3.7458842438949387,-5.620948446849445,-5.0016330419222665,-4.482289259559245,-3.052494222820959,0.35165954168466,-1.3406884266531551,1.8098137252754194,1.304512053934559e-15]},{"name":"PC3","kind":"calculated","x":["2023-11-13","2023-11-20","2023-11-28","2023-12-04","2023-12-11","2023-12-18","2023-12-26","2024-01-02","2024-01-09","2024-01-17","2024-01-24","2024-01-30","2024-02-06","2024-02-13","2024-02-21","2024-02-28","2024-03-05","2024-03-12","2024-03-19","2024-03-26","2024-04-02","2024-04-09","2024-04-16","2024-04-23","2024-04-29","2024-05-06","2024-05-13","2024-05-20","2024-05-24","2024-06-03","2024-06-10","2024-06-17","2024-06-25","2024-07-01","2024-07-09","2024-07-16","2024-07-23","2024-07-29","2024-08-05","2024-08-12","2024-08-19","2024-08-23","2024-08-30","2024-09-09","2024-09-16","2024-09-23","2024-09-27","2024-10-04","2024-10-11","2024-10-18","2024-10-24","2024-10-31","2024-11-07","2024-11-14","2024-11-20","2024-11-27","2024-12-05","2024-12-12","2024-12-19","2024-12-26","2025-01-03","2025-01-13","2025-01-21","2025-01-27","2025-02-03","2025-02-10","2025-02-18","2025-02-24","2025-03-03","2025-03-10","2025-03-17","2025-03-21","2025-03-28","2025-04-04","2025-04-11","2025-04-21","2025-04-25","2025-05-02","2025-05-09","2025-05-16","2025-05-22","2025-05-30","2025-06-06","2025-06-13","2025-06-20","2025-06-27","2025-07-07","2025-07-14","2025-07-21","2025-07-25","2025-08-01","2025-08-08","2025-08-15","2025-08-21","2025-08-28","2025-09-05","2025-09-12","2025-09-18","2025-09-25","2025-10-02","2025-10-09","2025-10-15","2025-10-22","2025-10-29","2025-11-05","2025-11-12","2025-11-18","2025-11-25","2025-12-03","2025-12-10","2025-12-16","2025-12-23","2025-12-31","2026-01-08","2026-01-14","2026-01-22","2026-01-29","2026-02-05","2026-02-12","2026-02-19","2026-02-26","2026-03-05","2026-03-12","2026-03-18","2026-03-25","2026-04-01","2026-04-09","2026-04-15","2026-04-22","2026-04-29","2026-05-06","2026-05-13","2026-05-19","2026-05-27","2026-06-03","2026-06-10","2026-06-16","2026-06-24","2026-07-01","2026-07-09","2026-07-15","2026-07-22","2026-07-29","2026-08-05","2026-08-11","2026-08-18","2026-08-25","2026-09-01","2026-09-09","2026-09-15","2026-09-22","2026-09-29","2026-10-06","2026-10-12","2026-10-19","2026-10-26","2026-11-02","2026-11-06","2026-11-13","2026-11-20"],"y":[0.3280549356097951,0.5902262521878436,-0.026470642664688737,0.7476866951741024,0.11568224043860009,1.7125726229548817,1.9087033434602794,4.038828003592772,5.458962119934653,6.382759406024885,5.270947061589269,7.848042950428573,9.317993739758096,10.874776652142243,11.653285484917447,15.28757760081293,20.56611718874633,20.64680358556371,19.377232708497726,21.458598190232667,21.235934207744737,20.067109722126066,18.044480432518718,19.018699237699526,17.838007628734772,16.448440325793275,15.893500196786048,14.654706555384918,17.660502626998564,18.051550091404277,18.882230530358793,14.51014726673259,15.393485150159815,14.824906847864755,13.48778035854555,12.722184987595378,13.64519509507875,14.140652628699844,12.266788758247113,13.395696290588644,15.741231491873734,15.853961253910764,15.14121637960395,14.79171005335892,15.505418135084941,13.694248092243587,13.735519695534013,14.231440371457992,17.05092943566468,16.42491791624288,17.559753851436135,16.236961534040187,19.180178912279032,19.778869951119937,19.184130694799745,18.513342859753767,17.676560087532323,14.185966240578322,12.075397729571094,12.381574123981975,15.603510964971257,16.07906795035833,20.967056662350696,17.595753841853337,16.874633871768545,20.460489816955207,19.138141857919614,15.809365667523915,15.824339366245018,13.313641596508695,18.115170791450527,17.983564902502568,17.62581601930818,17.811059193501823,21.034231985431067,19.349828544948224,19.20941222244191,21.886995014672546,24.61218017850171,25.02398147917978,25.631011208143253,26.346038679322987,26.61294690694004,28.070690933100483,28.961137453459436,30.988377218072376,29.927352597408504,30.143146233805655,29.751211436107635,30.222839955367096,31.98104621123119,26.573740669668823,25.900711463564356,26.808181103365964,26.092086414353307,21.43332691601386,24.42673520688255,23.567138640188066,20.676743664169134,21.143581305722712,22.184343104212957,21.248583164182367,18.664872621506884,19.264390340964713,18.06902161461562,18.061919233731373,15.844059724569563,12.557789137987562,12.609707049567072,13.550041677914402,14.624116793708547,16.696199039022762,16.196537023733335,18.379710275996626,15.436058034017634,17.203671212698218,15.944056549357105,11.340961268471581,15.07182916087747,16.065004583269605,13.479833011343898,14.551214995387697,13.928493155204032,14.825368844980211,15.380512583814314,14.266674405691884,14.970926421976145,14.647032244007928,14.689989250944572,14.829013882483075,10.829300908786895,8.811969398048378,8.55883961965719,6.56350741786626,8.053087179601478,10.032986469357445,10.809562896149448,11.772217357843394,11.190545195914957,8.871647925823607,8.814457641708831,9.995896914154573,6.477985381829809,13.80890054945368,15.51952888282039,14.760773685209024,13.74211910102751,12.376354840234779,14.134950689103345,10.493294788788385,9.380055301966163,10.58342583964913,10.635029644887139,8.985474632218642,8.217587424176921,9.033884642281402,10.538324362355663,8.216018079955479,4.718358396863309,2.0872192862952943e-14]}],"note":"Score of component j at date t: the period's (standardised) returns projected on eigenvector j. In-sample: the eigenvectors use the whole period, so this is a description, not a tradable index."}],"diagnostics":[{"name":"Bartlett sphericity test","statistic":1050.5932884935125,"pvalue":1.9162859748169822e-214,"conclusion":"Rejects uncorrelated returns at the 5% level: there is common variation for components to capture.","passed":true,"df":15},{"name":"Kaiser-Meyer-Olkin sampling adequacy","statistic":0.808551603661481,"pvalue":null,"conclusion":"KMO = 0.81: correlations are largely shared (above 0.6, suitable for a factor description).","passed":true},{"name":"Largest eigenvalue vs Marchenko-Pastur bound","statistic":2.8127510649561924,"pvalue":null,"conclusion":"λ₁ = 2.813 against a noise bound of 1.186: the first component is clearly not noise.","passed":true},{"name":"Observations per asset T/N","statistic":126.5,"pvalue":null,"conclusion":"T/N = 126.5. Enough for the leading eigenvalues; the small ones remain noisy.","passed":true}],"assumptions":["Returns are log returns on adjusted closes over the 759 sessions common to all 6 symbols; the correlation matrix is the sample estimate over the whole period.","Components are statistical constructs, orthogonal in sample by construction; they need not correspond to economic factors, and their signs are arbitrary.","The Marchenko-Pastur bound assumes independent, identically distributed noise with finite fourth moments and large N and T; fat tails and volatility clustering push sample eigenvalues above it without any common factor."],"warnings":["Only 6 assets: Marchenko-Pastur and Bai-Ng are large-N results and are weak guides here."],"methodology":"**Decomposition.** With $X$ the $T\\times N$ matrix of demeaned and standardised returns, $C = X'X/(T-1) = V\\Lambda V'$, eigenvalues $\\lambda_1\\ge\\dots\\ge\\lambda_N\\ge 0$, eigenvectors (loadings) in the columns of $V$. Explained variance of component $j$: $\\lambda_j/\\sum_i\\lambda_i$. Scores: $F = XV$.\n\n**Noise bound.** For $N$ uncorrelated series of variance $\\sigma^2$ observed $T$ times, the eigenvalues of the sample covariance fall (as $N,T\\to\\infty$, $N/T\\to q$) in $[\\sigma^2(1-\\sqrt q)^2,\\ \\sigma^2(1+\\sqrt q)^2]$ (Marchenko-Pastur). Eigenvalues above $\\lambda_+$ are candidates for genuine common components. The second line of the table recomputes the bound with $\\sigma^2 = 1-\\lambda_1/N$ (Laloux et al.).\n\n**Kaiser.** Keep $\\lambda_j$ above the average eigenvalue. **Bai-Ng.** $IC_{p2}(k) = \\ln V(k) + k\\,\\frac{N+T}{NT}\\ln\\min(N,T)$ with $V(k) = \\frac{1}{NT}\\sum_{i,t}\\hat e_{it}^2$ the mean squared residual after $k$ components; the estimate minimises it.\n\n**Reconstruction.** $\\hat X_k = F_kV_k'$, RMSE$(k) = \\sqrt{V(k)}$, unexplained share $= \\sum_{j>k}\\lambda_j/\\sum_j\\lambda_j$.\n\n**Absorption ratio.** $AR = \\sum_{j\\le n}\\lambda_j/\\sum_j\\lambda_j$ with $n$ a fixed share of $N$ (Kritzman et al., 2011): a high value means returns are tightly coupled. **Rolling.** The same quantities on trailing windows.\n\n**Bartlett.** $-(T-1-\\frac{2N+5}{6})\\ln|R| \\sim \\chi^2_{N(N-1)/2}$ under $R=I$ and normality.","provenance":{"data":[{"symbol":"AAPL","provider":"FMP","retrievedAt":"2026-11-20T23:35:44+00:00","start":"2023-10-30","end":"2026-11-20","observations":769,"frequency":"1d","adjusted":"split_div","currency":null},{"symbol":"MSFT","provider":"FMP","retrievedAt":"2026-11-20T23:35:44+00:00","start":"2023-10-30","end":"2026-11-20","observations":769,"frequency":"1d","adjusted":"split_div","currency":null},{"symbol":"NVDA","provider":"FMP","retrievedAt":"2026-11-20T23:35:45+00:00","start":"2023-10-30","end":"2026-11-20","observations":769,"frequency":"1d","adjusted":"split_div","currency":null},{"symbol":"GOOGL","provider":"FMP","retrievedAt":"2026-11-20T23:35:48+00:00","start":"2023-10-30","end":"2026-11-20","observations":769,"frequency":"1d","adjusted":"split_div","currency":null},{"symbol":"AMZN","provider":"FMP","retrievedAt":"2026-11-20T23:35:52+00:00","start":"2023-10-30","end":"2026-11-20","observations":769,"frequency":"1d","adjusted":"split_div","currency":null},{"symbol":"JPM","provider":"FMP","retrievedAt":"2026-11-20T23:35:52+00:00","start":"2023-10-30","end":"2026-11-20","observations":769,"frequency":"1d","adjusted":"split_div","currency":null}],"spec":{"symbols":["AAPL","MSFT","NVDA","GOOGL","AMZN","JPM"],"basis":"correlation","return_type":"log","frequency":"daily","data_period":756,"start":null,"end":null,"n_components":5,"rolling_window":126,"absorption_fraction":0.2},"seed":null,"software":{"python":"3.14.4","numpy":"2.4.6","pandas":"3.0.3","scipy":"1.17.1","statsmodels":"0.14.6","arch":"8.0.0","scikit-learn":"1.8.0"},"computedAt":"2026-11-20T23:35:52+00:00","durationMs":11181,"reproduce":"import numpy as np, pandas as pd\n# px: adjusted closes, one column per symbol (AAPL, MSFT, NVDA, GOOGL, AMZN, JPM), common sessions, daily\npx = pd.read_csv(\"closes.csv\", index_col=0, parse_dates=True).dropna()\nr = np.log(px / px.shift(1)).dropna().loc[\"2023-11-11\":]\nC = r.corr().to_numpy()\nlam, V = np.linalg.eigh(C); lam, V = lam[::-1], V[:, ::-1]\nprint(\"explained:\", lam / lam.sum())\nT, N = r.shape\nprint(\"Marchenko-Pastur upper bound:\", 1.0 * (1 + np.sqrt(N / T)) ** 2)"}}}}2