{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [] }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "a14457e43c724711801e16b4e8741b45": { "model_module": "@jupyter-widgets/controls", "model_name": "VBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [ "widget-interact" ], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "VBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "VBoxView", "box_style": "", "children": [ "IPY_MODEL_769ac13f859744e182a992d05a337f89", "IPY_MODEL_8ae9a0c6bebc4e25a847404ac4c1a672", "IPY_MODEL_86d9f682a7034a5c8d0c54e84983967d", "IPY_MODEL_6ba0125b48d149f2bcc682acc5cab2cf" ], "layout": "IPY_MODEL_50131c3a2fcf4bcbbf7a60877d30b73d" } }, "769ac13f859744e182a992d05a337f89": { "model_module": "@jupyter-widgets/controls", "model_name": "IntSliderModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "IntSliderModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "IntSliderView", "continuous_update": true, "description": "N° Observaciones", "description_tooltip": null, "disabled": false, "layout": "IPY_MODEL_0a166b3cf896413eaf1dd9a3f7661d1b", "max": 200, "min": 10, "orientation": "horizontal", "readout": true, "readout_format": "d", "step": 5, "style": "IPY_MODEL_22f69bb462354753baf033d3af6d3574", "value": 50 } }, "8ae9a0c6bebc4e25a847404ac4c1a672": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatSliderModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatSliderModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "FloatSliderView", "continuous_update": true, "description": "Correlación X1-X2", "description_tooltip": null, "disabled": false, "layout": "IPY_MODEL_816e3b469265470b82baf63911bfcb04", "max": 1, "min": -1, "orientation": "horizontal", "readout": true, "readout_format": ".2f", "step": 0.05, "style": "IPY_MODEL_26db0a5fbe6b41bf86f56bc487381b0d", "value": 0.8 } }, "86d9f682a7034a5c8d0c54e84983967d": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatSliderModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatSliderModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "FloatSliderView", "continuous_update": true, "description": "Ruido", "description_tooltip": null, "disabled": false, "layout": "IPY_MODEL_fbf8e30cb155411ca495a3fa665a326d", "max": 50, "min": 0, "orientation": "horizontal", "readout": true, "readout_format": ".2f", "step": 1, "style": "IPY_MODEL_65c45217d54b46ffbc1b79464363263f", "value": 5 } }, "6ba0125b48d149f2bcc682acc5cab2cf": { "model_module": "@jupyter-widgets/output", "model_name": "OutputModel", "model_module_version": "1.0.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_cf24f0672b6f4bb38bc35b85bfc41531", "msg_id": "", "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "=== Variance Inflation Factor (VIF) ===\n" ] }, { "output_type": "display_data", "data": { "text/plain": " Variable VIF\n0 X1 115.393690\n1 X2 110.553122\n2 X3 3.104472", "text/html": "\n
| \n | Variable | \nVIF | \n
|---|---|---|
| 0 | \nX1 | \n115.393690 | \n
| 1 | \nX2 | \n110.553122 | \n
| 2 | \nX3 | \n3.104472 | \n
simulador_vif
def simulador_vif(n=50, corr=0.8, ruido=5)
Simula variables independientes correlacionadas y calcula VIF.\n", "\n", "Parámetros:\n", "- n: número de observaciones\n", "- corr: correlación entre X1 y X2\n", "- ruido: desviación estándar del ruido aleatorio