{"id":5763,"date":"2016-11-18T12:30:39","date_gmt":"2016-11-18T18:30:39","guid":{"rendered":"http:\/\/www.ssc.wisc.edu\/~jfrees\/?page_id=5763"},"modified":"2019-01-06T13:09:18","modified_gmt":"2019-01-06T19:09:18","slug":"loss-data-analytics-model-selection","status":"publish","type":"page","link":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/loss-data-analytics\/loss-data-analytics-model-selection\/","title":{"rendered":"Model Selection Guided Tutorials"},"content":{"rendered":"<p>Here are a set of exercises that guide the viewer through some of the theoretical foundations of <em>Loss Data Analytics<\/em>. Each tutorial is based on one or more questions from the professional actuarial examinations &#8211; typically the Society of Actuaries Exam C.<\/p>\n<p><strong>Tutorial Structure.<\/strong> Each guided tutorial has a strategy set that describes the context. When you hit the &#8220;Start quiz&#8221; button, you begin the tutorial that is comprised of a series of mini-questions designed to lead you to the target question. At each stage, hints are provided as well as feedback on the correct solution of each mini-question.<\/p>\n<p><strong>Your Assignment.<\/strong> In reviewing these exercises, ideally the viewer will: <\/p>\n<ul>\n<li>Work the problem posed referring only to basic theory<\/li>\n<li>Even if you get the answer correct, review the strategy for this type of problem by clicking (revealing) the <font color=\"red\">Strategy for &#8230;<\/font>  header<\/li>\n<li>If you feel comfortable with the strategy and got the problem correct, then you may choose to move on. However, you might also decide to follow the step-by-step process for solving the problem by clicking on the &#8220;Start Quiz&#8221; button. It is not really a quiz \u2014 it is a guided tutorial.<\/li>\n<\/ul>\n<p><a id=\"displayText135\" href=\"javascript:toggleStrat('toggleText135','displayText135');\"><strong>Strategy for Solving Kernel Smoothing Problems<\/strong><\/a> <\/p>\n<div id=\"toggleText135\" style=\"display: none\">\n<hr \/>\n<p>One way that you can provide a smooth estimate of a density without reference to a parametric family is through a so-called <em>kernel density estimate<\/em>. A kernel density estimate of a probability density function \\(f(x)\\) has the following form:<br \/>\n$$  f_n(x) = \\frac{1}{nb} \\sum_{i=1}^n k\\left(\\frac{x-X_i}{b}\\right).$$ In this expression, \\(X_1, \\ldots, X_n\\) is our random sample of \\(n\\) observations, the positive constant \\(b\\) is known as the <em>bandwidth<\/em> and the function \\( k(\\cdot ) \\) is called a <em>kernel<\/em> function. The following are standard choices of the kernel function: <\/p>\n<ul>\n<li> uniform kernel, \\( k(y) = \\frac{1}{2} I(|y| \\le 1) \\)<\/li>\n<li>triangular kernel, \\(k(y) = (1-|y|)\\times I(|y| \\le 1)\\)<\/li>\n<li>Epanechnikov kernel, \\(k(y) = \\frac{3}{4}(1-y^2) \\times I(|y| \\le 1)\\)<\/li>\n<li>Gaussian kernel \\(k(y) = \\phi(y)\\), where \\(\\phi(\\cdot)\\) is the standard normal density function.<\/li>\n<\/ul>\n<p>For some situations, you can also use kernel methods to give a smooth approximation of the distribution function as follows:<br \/>\n$$  \\hat{F}_n(x) = \\frac{1}{n} \\sum_{i=1}^n K\\left(\\frac{x-X_i}{b}\\right).$$ Here, \\(  \\hat{F}_n(x)\\) is known as the <em>kernel density estimator of a distribution function<\/em>. The function \\(K \\) is a probability distribution function associated with the kernel density \\(k\\). To illustrate, for the uniform kernel, we have<br \/>\n$$ K(y) = \\begin{cases}<br \/>\n0 &#038;            y&lt;-1\\\\<br \/>\n\\frac{y+1}{2}&#038; -1 \\le y &lt; 1 \\\\<br \/>\n1 &#038; y \\ge 1 .\\\\ \\end{cases} $$ To solve questions using kernel smoothing, you can do the following:<\/p>\n<ol>\n<li> From the problem, identify the data points \\(X_i\\), the kernel function to be applied, and the bandwidth \\(b\\) .<\/li>\n<li>Rescale the observations about a point \\(x\\). Call the rescaled observations \\( y_i = (x &#8211; X_i)\/b \\).<\/li>\n<li>Apply the kernel density ( \\( k(y_i) \\) ) or distribution function ( \\( K(y_i) \\) ) , as appropriate. Kernels such as uniform, triangular and Epanechinikov have a limited domain, so make sure that you account for this feature when you evaluate the kernel function.<\/li>\n<li>Then, take the average. For the density estimator, divide this average by \\(b\\). (Not needed for the distribution function.)<\/li>\n<\/ol>\n<hr \/>\n<\/div>\n<p><div class=\"scbb-content-box scbb-content-box-gray\"><br \/>\n<strong>Kernel Smoothing 268<\/strong><br \/>\nYou are given the following ages at time of death for 10 individuals:<br \/>\n$$\\begin{array}{c}25 &#038;30&#038; 35&#038; 35&#038; 37 &#038;39 &#038;45 &#038;47 &#038;49 &#038;55 \\end{array} $$\n<p>With a bandwidth of \\(b=10\\):<br \/>\n(a) Calculate the kernel density estimate of \\(f(40)\\), using a uniform kernel.<br \/>\n(b) Calculate the kernel density estimate of \\(f(40)\\), using a triangular kernel.<br \/>\n(c) Calculate the kernel density estimate of \\(F(40)\\), using a uniform kernel.<br \/>\n(d) Calculate the kernel density estimate of \\(F(40)\\), using a triangular kernel.<br \/>\n[WpProQuiz 68]<br \/>\n<\/p><\/div><br \/>\n<hr \/><\/p>\n<p><a id=\"displayText252\" href=\"javascript:toggleStrat('toggleText252','displayText252');\"><strong>Strategy for Solving Nonparametric Estimators of the Distribution Function with Censored Data Problems<\/strong><\/a> <\/p>\n<div id=\"toggleText252\" style=\"display: none\">\n<hr \/>\n<p>Suppose that you have right-censored data and you wish to estimate the distribution or survival function without reference to a parametric model. Two options are available, one estimator due to Kaplan and Meier and another due to Nelson and &Aring;alen. The following summarizes these estimators <em>without adjustments needed for truncation<\/em>. To compute these estimators, you can do the following :<\/p>\n<ul>\n<li> Use the problem to identify the data and the non-censored losses\/events. Specifically, begin with a data set \\( \\{x_1, \\ldots, x_n \\} \\). Let \\(t_1 &lt; \\ldots &lt; t_k \\) be the subset of \\( \\{x_1, \\ldots, x_n \\} \\) that correspond to unique non-censored times. For each event time (non-censored losses) \\(t_j\\), let \\(s_j\\) be the number of events.<\/li>\n<li> For each event time (non-censored losses) \\(t_j\\), determine the <em>risk set<\/em>, defined to be<br \/>\n$$R_j=\\sum_{i=1}^n I(x_i \\geq t_j) $$\n<\/li>\n<li> The Kaplan-Meier estimator of the survival function \\(S(x) = 1 &#8211; F(x) \\) is defined to be<br \/>\n $$\\widehat{S}_{KM}(x)=\\prod_{j:t_j \\leq x}\\left(1-\\frac{s_j}{R_j}\\right)$$<\/li>\n<li> The Nelson-&Aring;alen estimator is defined to be<br \/>\n $$\\widehat{S}_{NA}(x)=e^{-\\hat{H}(x)}$$based on the following estimate of the cumulative hazard function<br \/>\n $$\\hat{H}(x)=\\sum_{j:t_j \\leq x} \\frac{s_j}{R_j} .$$\n<\/li>\n<li> To determine the reliability of the Kaplan-Meier estimator, you may use Greenwood&#8217;s approximation to the variance, given as:<br \/>\n$$\\widehat{Var}(\\widehat{S}_{KM}(x))=(\\widehat{S}_{KM}(x))^2 \\sum_{j:t_j \\leq x} \\frac{s_j}{R_j(R_j-s_j)} $$<\/p>\n<\/li>\n<hr \/>\n<\/div>\n<p><div class=\"scbb-content-box scbb-content-box-gray\"><br \/>\n<strong>Nonparametric Distribution Function Censored Data 252<\/strong><br \/>\nThe following is a sample of 10 payments :<br \/>\n$$\\begin{array}{c}4 &#038;4&#038; 5+&#038; 5+ &#038;5+ &#038;8 &#038;10+ &#038;10+ &#038;12 &#038;15 \\end{array} $$\n<p>where + indicates that a loss exceeded the policy limit. <\/p>\n<p>(a) Using the Kaplan-Meier product-limit estimator, calculate the probability that the loss on a policy exceeds 11, \\(\\widehat{S}(11)\\)<br \/>\n(b) Using the Nelson-&Aring;alen estimator, calculate the probability that the loss on a policy exceeds 11, \\(\\widehat{S}(11)\\)<br \/>\n(a) Calculate Greenwood&#8217;s approximation to the variance of the product-limit estimate \\(\\widehat{S}(11)\\)<\/p>\n<hr \/>\n<p>[WpProQuiz 69]<\/p><\/div><br \/>\n<hr \/><\/p>\n<p><a id=\"displayText199\" href=\"javascript:toggleStrat('toggleText199','displayText199');\"><strong>Strategy for Solving Problems Involving Estimators of the Distribution Function with Censored Data<\/strong><\/a> <\/p>\n<div id=\"toggleText199\" style=\"display: none\">\n<hr \/>\n<p>For right-censored data (without truncation), the following gives an expression for a nonparametric estimator of the survival function due to Nelson and &Aring;alen.  To compute this estimator:<\/p>\n<ul>\n<li> Use the problem to identify the data and the non-censored losses\/events. Specifically, begin with a data set \\( \\{x_1, \\ldots, x_n \\} \\). Let \\(t_1 &lt; \\ldots &lt; t_k \\) be the subset of \\( \\{x_1, \\ldots, x_n \\} \\) that correspond to unique non-censored times. For each event time (non-censored losses) \\(t_j\\), let \\(s_j\\) be the number of events.<\/li>\n<li> For each event time (non-censored losses) \\(t_j\\), determine the <em>risk set<\/em>, defined to be \\(R_j=\\sum_{i=1}^n I(x_i \\geq t_j) \\).<\/li>\n<li> The Nelson-&Aring;alen estimator of the survival function \\(S(x) = 1 &#8211; F(x) \\) is defined to be<br \/>\n $$\\widehat{S}_{NA}(x)=e^{-\\hat{H}(x)}$$which based on the following estimate of the cumulative hazard function<br \/>\n $$\\hat{H}(x)=\\sum_{j:t_j \\leq x} \\frac{s_j}{R_j} .$$<\/li>\n<li>Here is another set of notation that facilitates a connection to the parametric estimator. For each observation \\(x_i\\), define \\( \\delta_i \\) to be a binary variable that indicates whether the observation was censored. With this, we can write the risk set at \\(x_j\\) to be \\(R(x_j)=\\sum_{i=1}^n \\delta_i I(x_i  \\geq x_j) \\) and the cumulative hazard as  $$\\hat{H}(x)=\\sum_{j:x_j \\leq x} \\frac{\\delta_j}{R(x_j)} .$$<\/li>\n<\/ul>\n<p>For a parametric fit, suppose that we have a density (f) and distribution function (F) that depends on \\( \\theta \\). Define the log-likelihood to be<br \/>\n$$ L(\\theta) =\\sum_{i=1}^n \\left\\{ (1-\\delta_i) \\ln f(x_i) + \\delta_i \\ln \\left(1-F(x_i) \\right) \\right\\}.$$ The maximum likelihood estimator \\(\\hat{\\theta}\\) is defined to be that value of \\( \\theta \\) that maximizes  \\( L(\\theta) \\). Often, this is done by taking a derivative of \\( L(\\theta) \\), setting it equal to zero, and solving for \\( \\theta \\).<\/p>\n<hr \/>\n<\/div>\n<p><div class=\"scbb-content-box scbb-content-box-gray\"><br \/>\n<strong>Distribution Function for Censored Data 199<\/strong><br \/>\nYou consider personal auto property damage claims in a certain region. A a sample of four claims is:<br \/>\n              130   240   300   540<br \/>\nThe values of two additional claims are known to exceed 1000.\n<p>You wish to compare a nonparametric fit to a fit based on the parametric Weibull distribution<br \/>\n$$ F(x) = 1- \\exp \\left[- \\left(\\frac{x}{\\theta} \\right)^{0.2} \\right], \\ \\ \\ x &gt; 0$$(a) Using the nonparametric Nelson-&Aring;alen estimator, calculate the probability that the loss on a policy exceeds 500, \\(\\widehat{S}_{NA}(500)\\)<br \/>\n(b) Using the Weibull distribution, calculate the maximum likelihood estimator of \\( \\theta \\).<br \/>\n(c) With your fitted Weibull distribution from part (b), determine the estimate of the survival function at 500, \\( S(500) \\).<\/p>\n<hr \/>\n<p>[WpProQuiz 70]<\/p><\/div><br \/>\n<hr \/><\/p>\n<p><a id=\"displayText64\" href=\"javascript:toggleStrat('toggleText64','displayText64');\"><strong>Strategy for Solving Bayesian Estimation Problems <\/strong><\/a> <\/p>\n<div id=\"toggleText64\" style=\"display: none\">\n<hr \/>\n<p>For Bayesian estimation problems:<\/p>\n<ul>\n<li> Use the problem to identify the conditional <em>model distribution<\/em> of each observation given \\(\\theta\\), \\(f_{X|\\theta}(x|\\theta)\\). Then get the likelihood of the model distribution, which is typically the product of the model distributions for all observations,<br \/>\n$$f_{X|\\theta}(x_1&#8230;x_n|\\theta)=\\prod_{i=1}^N f_{X|\\theta}(x_i|\\theta) .$$\n<\/li>\n<li> From the question identify the <em>prior distribution<\/em> of \\(\\theta\\), \\(\\pi(\\theta)\\).<\/li>\n<li> Now obtain the <em>posterior distribution<\/em> using the Bayes theorem;<br \/>\n$$\\pi(\\theta|x_1&#8230;x_n)=\\frac{f_{X|\\theta}(x_1&#8230;x_n|\\theta)\\pi(\\theta)}{\\int f_{X|\\theta}(x_1&#8230;x_n|\\theta)\\pi(\\theta) d\\theta}$$Note that the denominator of this expression \\( f(x) = \\int f_{X|\\theta}(x_1&#8230;x_n|\\theta)\\pi(\\theta) d\\theta\\) is the <em>marginal distribution<\/em> of \\(x\\) and does not involve \\( \\theta \\). <\/li>\n<li> With this, to calculate the <em>posterior probability<\/em> that \\(a \\lt \\theta \\lt b\\);<br \/>\n$$\\pi(a \\lt \\theta \\lt b|x_1&#8230;x_n)=\\int_{a}^{b} \\pi(\\theta|x_1&#8230;x_n) d\\theta$$\n<\/li>\n<li>For a new data \\(y\\) , the<em> predictive distribution<\/em> is;<br \/>\n$$f(y|x_1&#8230;x_n)=\\int f(y|\\theta)\\pi(\\theta|x_1&#8230;x_n)d\\theta .$$Here, \\(f(y|\\theta)\\) is obtained from the conditional <em>model distribution<\/em>\n<\/li>\n<\/ul>\n<p>There are several ways that one can use the predictive distribution. For some problems, you may wish to calculate Bayesian prediction for a new data \\(y\\). Specifically, given the past observations \\(x_1&#8230;x_n\\), you can use<br \/>\n$$E(y|x_1&#8230;x_n)=\\int E(y|\\theta)\\pi(\\theta|x_1&#8230;x_n)d\\theta. $$Here, \\(E(y|\\theta)\\) is the expected value of the conditional model distribution.<\/p>\n<hr \/>\n<\/div>\n<p><div class=\"scbb-content-box scbb-content-box-gray\"><br \/>\n<strong>Bayesian Estimation 64<\/strong><br \/>\nFor a group of insureds, you are given;<br \/>\n(i) The amount of a claim in uniformly distributed but will not exceed a certain unknown limit \\(\\theta\\).<br \/>\n(ii)The prior distribution of \\(\\theta\\) is  \\(\\pi(\\theta)=\\frac{500}{{\\theta}^2}, \\theta&gt;500\\).<br \/>\n(iii) Two independents claims of 400 and 600 are observed. \n<p>(a) Calculate the posterior probability that \\(700 \\lt \\theta \\lt 900\\)<br \/>\n(b) Calculate the probability that the next claim will exceed 550. <\/p>\n<hr \/>\n<p>[WpProQuiz 71]<\/p><\/div><br \/>\n<hr \/><\/p>\n<p><a id=\"displayText143\" href=\"javascript:toggleStrat('toggleText143','displayText143');\"><strong>Strategy for Solving Moments\\Percentile Matching Problems <\/strong><\/a> <\/p>\n<div id=\"toggleText143\" style=\"display: none\">\n<hr \/>\n<p>Method of moments and percentile matching are estimation techniques that provide alternatives to the method of maximum likelihood. Because they are non-recursive, they also can be used to provide starting values to begin a maximum likelihood recursion.<\/p>\n<p>Under the <strong>method of moments<\/strong>, one matches the empirical (non-parametric) moments to moments specified by a parametric distribution.  Assume that you have a distribution with \\(c\\) parameters (typically, \\(c=1,2,3,4\\)). Then, <\/p>\n<ul>\n<li> Determine the parameters in terms of the moments \\(\\mathrm{E}~ X^k = \\mu_k^{\\prime} \\) for \\( k=1, 2, \\ldots, c\\).<\/li>\n<li> Determine the sample (also known as the empirical or nonparametric) moments given by<br \/>\n$$m_k =\\frac{1}{n}\\sum_{i=1}^{n} x^{k}, \\ \\ \\ \\ \\text{for~} k=1, 2, \\ldots,c$$<\/li>\n<li> Approximating \\(m_k \\approx \\mu_k^{\\prime}\\) for \\(k=1, 2, \\ldots,c\\), solve for the parameters. The resulting parameter estimates are method of moment estimators. <\/li>\n<\/ul>\n<p>In the same way, under the <strong>percentile matching<\/strong>, one matches the empirical (non-parametric) percentiles or quantiles to those specified by a parametric distribution.  As before, assume that you have a distribution with \\(c\\) parameters. Then, <\/p>\n<ul>\n<li> Determine the parameters in terms of the quantiles \\(\\pi_{q_k} = F^{-1}(q_k)\\) for selected proportions \\(q_k\\) for \\( k=1, 2, \\ldots, c\\).<\/li>\n<li> Determine the corresponding sample quantiles. It is common to use the <em>smoothed empirical percentile<\/em> given by<br \/>\n$$ \\hat{\\pi}_q = (1-h) X_{(j)} + h X_{(j+1)}$$<br \/>\nwhere \\(j=[(n+1)q]\\) and, \\(h=(n+1)q-j\\), and \\(X_{(1)}, \\ldots, X_{(n)}\\) are the ordered values (the <em>order statistics<\/em>) corresponding to \\(X_1, \\ldots, X_n\\).<\/li>\n<li> Approximating \\(\\hat{\\pi}_{q_k} \\approx \\pi_{q_k}\\) for \\(k=1, 2, \\ldots,c\\), solve for the parameters. The resulting parameter estimates are percentile matching estimators. <\/li>\n<\/ul>\n<hr \/>\n<\/div>\n<p><div class=\"scbb-content-box scbb-content-box-gray\"><br \/>\n<strong>Moments\\Percentile Matching 143<\/strong><br \/>\nThe parameters of the inverse Pareto distribution<br \/>\n$$F(x)=\\left(\\frac{x}{x+\\theta}\\right)^{\\tau}$$\n<p>are to be estimated based on the following on the following data :<br \/>\n$$\\begin{array}{c}15 &#038;45&#038; 140&#038; 250 &#038;560 &#038;1340  \\end{array} $$<\/p>\n<p>Calculate the estimate of \\(\\theta\\) obtained by<br \/>\n(a) matching \\(k\\)th moments with \\(k=-1\\) and \\(k=-2\\).<br \/>\n(b) percentile matching, using the 36th and 60th empirically smoothed percentile estimates .<\/p>\n<hr \/>\n<p>[WpProQuiz 72]<\/p><\/div><br \/>\n<hr \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here are a set of exercises that guide the viewer through some of the theoretical foundations of Loss Data Analytics. Each tutorial is based on one or more questions from the professional actuarial examinations &#8211; &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":5824,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false},"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P8cLPd-1uX","acf":[],"_links":{"self":[{"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/pages\/5763"}],"collection":[{"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/comments?post=5763"}],"version-history":[{"count":113,"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/pages\/5763\/revisions"}],"predecessor-version":[{"id":6045,"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/pages\/5763\/revisions\/6045"}],"up":[{"embeddable":true,"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/pages\/5824"}],"wp:attachment":[{"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/media?parent=5763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}