Question: Python Homework 2 Statistical society (1986). Far every s=1,2,3. we denote by the random variable Xa the US collar amount of a damage fram a

 Python Homework 2 Statistical society (1986). Far every s=1,2,3. we denoteby the random variable Xa the US collar amount of a damagefram a poliey holder's traffie ace dent which will occur during the

Python Homework 2 Statistical society (1986). Far every s=1,2,3. we denote by the random variable Xa the US collar amount of a damage fram a poliey holder's traffie ace dent which will occur during the year 2022 . maraga. The total cosis for the insurance company by the end of 2022 will thus be given by the random surn SN:=X1+X2++XN=k=1NXk. Nete that the totel number N of accitents is random! The goal of the currant eraccise is to approximate via simulation: + the panditionel expected tatal cosir [SNNj] for the insurance company in 2022 given thet the rumber of elaime is equel to j, and - the expected tatal costs + the probabilitias that the total cast will nat axeced KC USD, I.e., F[S,K]forK=$30,000,sodK=840,000 As usuel, we stert with leading seme peckeges: irpart zungy as irgort forde irport foth Step 1. First, write a tunctian randomstmil which simulates from the ditribut on of 5N given that N - j. The cutaut ahauld just ba a singla scalarl Hint: Use proper buid-in functions from the NumPy-package in your cade in order to sample from an Exponential vistritution scheck out the Gettingstartev aython filel: sj1,500ESyNj=M1k=1Msj(n) and check the accuracy of this appraximation. randomSumi) naw. The cutput of the funation simulataril should be an array of length M. E[SN]=E[N]E[X1]=20$1,500=$30,000. Check bia the empirical maen that $30,000[R[SN]=M1m=1nsNimj where si{1),bi(2),,sN(M) denote M independent reslizations (samples) from the random variable SN. Use Ad=50C0 simulations. Step 6: Aecall from class that the desired prubabilities PSNK for K=$30,000, and 415,000 can be camputed as expectatiuns vis an indicator functien PSNK=1{wNK} Wa usa onca mare the amparlolal maan to approximate R[1SkE}]M1N=NM1{NN1E} with M independent realizatians (samples) trem the random variable SN (sagain denoted by sN(1);sN(2),,sN(2)). Ar arlte your ann cose here ratum erpirlcalprob KCprobestinst107 11580,29,28028,10% Test your function with warying M=100,1000,10000 simulations: printirCprobestinstionl1590, 2s, 3902e, 1021\} printikCprobestindiont1598, 2s, 39620, 18208)! printiKCprobestintioni158e, 2s, 45020, 10201? printiKCprobestinotionl1590, 2s, 45020, 10290)|

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!