{"record":{"id":"313cd3d43398d0e1","repo":"HKUDS/Vibe-Trading","slug":"no-common-dates-and-assets-between-factor-panel-an","errorCode":null,"errorMessage":"No common dates and assets between factor_panel and forward_returns","messagePattern":"No common dates and assets between factor_panel and forward_returns","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/quantlib/factormodel.py","lineNumber":785,"sourceCode":"    Returns:\n        :class:`FactorICResult` containing mean IC, IC IR, t-statistic, p-value,\n        higher moments, and full IC time series.\n\n    Raises:\n        ValueError: If inputs are empty, share no common dates or assets, or method is unknown.\n    \"\"\"\n    if method not in (\"spearman\", \"pearson\"):\n        raise ValueError(f\"method must be 'spearman' or 'pearson', got {method!r}\")\n\n    if factor_panel.empty or forward_returns.empty:\n        raise ValueError(\"factor_panel and forward_returns must be non-empty\")\n\n    # Align dates and assets\n    common_dates = factor_panel.index.intersection(forward_returns.index)\n    common_assets = factor_panel.columns.intersection(forward_returns.columns)\n\n    if common_dates.empty or common_assets.empty:\n        raise ValueError(\"No common dates and assets between factor_panel and forward_returns\")\n\n    f_sub = factor_panel.loc[common_dates, common_assets]\n    r_sub = forward_returns.loc[common_dates, common_assets]\n\n    ic_records: dict[object, float] = {}\n\n    for date in common_dates:\n        f_row = f_sub.loc[date].dropna()\n        r_row = r_sub.loc[date].dropna()\n        shared = f_row.index.intersection(r_row.index)\n        if len(shared) < min_cross_section:\n            continue\n\n        f_vals = f_row.loc[shared].to_numpy(dtype=float)\n        r_vals = r_row.loc[shared].to_numpy(dtype=float)\n\n        if method == \"spearman\":\n            f_vals = rankdata(f_vals)","sourceCodeStart":767,"sourceCodeEnd":803,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/quantlib/factormodel.py#L767-L803","documentation":"IC analysis correlates factor values with forward returns per date per shared asset set; if the intersection of dates or of column (asset) labels is empty, no correlation is computable.","triggerScenarios":"Panel dates are DatetimeIndex(2024-01) while returns use Timestamps, or asset tickers differ ('AAPL' vs 'AAPL_EQ').","commonSituations":"Date dtype mismatch (date vs datetime vs string) between data sources; one feed uses FIGI/ISIN while the other uses tickers.","solutions":["Compare the index/column dtypes and values of both frames","Normalize dates with pd.to_datetime on both indexes","Map asset identifiers to a common scheme before the call"],"exampleFix":"# before\nic = factor_ic_analysis(panel, rets)\n# after\nrets.index = pd.to_datetime(rets.index)\nrets = rets.rename(columns=id_map)\nic = factor_ic_analysis(panel, rets)","handlingStrategy":"validation","validationCode":"assert (factor_panel.index.intersection(forward_returns.index).size > 0\n        and factor_panel.columns.intersection(forward_returns.columns).size > 0)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize index dtype with pd.to_datetime at load","Map both feeds to one asset identifier scheme"],"tags":["quantlib","factormodel","ic-analysis","index-alignment"],"backgroundTag":"disjoint-index-alignment","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}