{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Simulation\n", "\n", "Functions\n", "\n", "`np.random.standard_normal`, `np.random.standard_t`, `np.random.RandomState`\n", "\n", "### Exercise 5\n", "\n", "Simulate 100 standard Normal random variables\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2023-09-28T12:33:26.957782Z", "iopub.status.busy": "2023-09-28T12:33:26.957782Z", "iopub.status.idle": "2023-09-28T12:33:27.127917Z", "shell.execute_reply": "2023-09-28T12:33:27.127392Z" } }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 6\n", "\n", "Simulate 100 random variables from a $N\\left(.08,.2^{2}\\right)$" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2023-09-28T12:33:27.127917Z", "iopub.status.busy": "2023-09-28T12:33:27.127917Z", "iopub.status.idle": "2023-09-28T12:33:27.135532Z", "shell.execute_reply": "2023-09-28T12:33:27.135532Z" } }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 7\n", "\n", "Simulate 100 random variables from a Students t with 8 degrees of freedom\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2023-09-28T12:33:27.137046Z", "iopub.status.busy": "2023-09-28T12:33:27.137046Z", "iopub.status.idle": "2023-09-28T12:33:27.143130Z", "shell.execute_reply": "2023-09-28T12:33:27.143130Z" } }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 8\n", "\n", "Simulate 100 random variables from a Students t with 8 degrees of freedom with a mean of 8% and a volatility of 20%. Note: $V\\left[X\\right]=\\frac{\\nu}{\\nu-2}$ when $X\\sim t_{\\nu}$." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2023-09-28T12:33:27.143130Z", "iopub.status.busy": "2023-09-28T12:33:27.143130Z", "iopub.status.idle": "2023-09-28T12:33:27.151159Z", "shell.execute_reply": "2023-09-28T12:33:27.151159Z" } }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "### Exercise 9\n", "\n", "Simulate two identical sets of 100 standard normal random variables by resetting the random number generator." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2023-09-28T12:33:27.153170Z", "iopub.status.busy": "2023-09-28T12:33:27.153170Z", "iopub.status.idle": "2023-09-28T12:33:27.159989Z", "shell.execute_reply": "2023-09-28T12:33:27.159989Z" } }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "### Exercise 10\n", "\n", "Repeat exercise 7 using only `standard_normal`." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2023-09-28T12:33:27.176217Z", "iopub.status.busy": "2023-09-28T12:33:27.176217Z", "iopub.status.idle": "2023-09-28T12:33:27.184669Z", "shell.execute_reply": "2023-09-28T12:33:27.184669Z" } }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.5" }, "pycharm": { "stem_cell": { "cell_type": "raw", "metadata": { "collapsed": false }, "source": [] } } }, "nbformat": 4, "nbformat_minor": 4 }