{"action":"closed","issue":{"url":"https://api.github.com/repos/CSBLatvia/vardpoor/issues/4","repository_url":"https://api.github.com/repos/CSBLatvia/vardpoor","labels_url":"https://api.github.com/repos/CSBLatvia/vardpoor/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/CSBLatvia/vardpoor/issues/4/comments","events_url":"https://api.github.com/repos/CSBLatvia/vardpoor/issues/4/events","html_url":"https://github.com/CSBLatvia/vardpoor/issues/4","id":110026134,"number":4,"title":"F'(quantile) in linrmir","user":{"login":"DjalmaPessoa","id":5308071,"avatar_url":"https://avatars.githubusercontent.com/u/5308071?v=3","gravatar_id":"","url":"https://api.github.com/users/DjalmaPessoa","html_url":"https://github.com/DjalmaPessoa","followers_url":"https://api.github.com/users/DjalmaPessoa/followers","following_url":"https://api.github.com/users/DjalmaPessoa/following{/other_user}","gists_url":"https://api.github.com/users/DjalmaPessoa/gists{/gist_id}","starred_url":"https://api.github.com/users/DjalmaPessoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DjalmaPessoa/subscriptions","organizations_url":"https://api.github.com/users/DjalmaPessoa/orgs","repos_url":"https://api.github.com/users/DjalmaPessoa/repos","events_url":"https://api.github.com/users/DjalmaPessoa/events{/privacy}","received_events_url":"https://api.github.com/users/DjalmaPessoa/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"JBreidaks","id":9083064,"avatar_url":"https://avatars.githubusercontent.com/u/9083064?v=3","gravatar_id":"","url":"https://api.github.com/users/JBreidaks","html_url":"https://github.com/JBreidaks","followers_url":"https://api.github.com/users/JBreidaks/followers","following_url":"https://api.github.com/users/JBreidaks/following{/other_user}","gists_url":"https://api.github.com/users/JBreidaks/gists{/gist_id}","starred_url":"https://api.github.com/users/JBreidaks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JBreidaks/subscriptions","organizations_url":"https://api.github.com/users/JBreidaks/orgs","repos_url":"https://api.github.com/users/JBreidaks/repos","events_url":"https://api.github.com/users/JBreidaks/events{/privacy}","received_events_url":"https://api.github.com/users/JBreidaks/received_events","type":"User","site_admin":false},"assignees":[{"login":"JBreidaks","id":9083064,"avatar_url":"https://avatars.githubusercontent.com/u/9083064?v=3","gravatar_id":"","url":"https://api.github.com/users/JBreidaks","html_url":"https://github.com/JBreidaks","followers_url":"https://api.github.com/users/JBreidaks/followers","following_url":"https://api.github.com/users/JBreidaks/following{/other_user}","gists_url":"https://api.github.com/users/JBreidaks/gists{/gist_id}","starred_url":"https://api.github.com/users/JBreidaks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JBreidaks/subscriptions","organizations_url":"https://api.github.com/users/JBreidaks/orgs","repos_url":"https://api.github.com/users/JBreidaks/repos","events_url":"https://api.github.com/users/JBreidaks/events{/privacy}","received_events_url":"https://api.github.com/users/JBreidaks/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2015-10-06T14:54:28Z","updated_at":"2016-06-27T13:29:50Z","closed_at":"2016-06-27T13:29:50Z","body":"To estimate the derivative  of the cumulative distribution function, Osier(2009) proposes the formula:\r\n            \r\n    $$F'_K(x)= \\frac{1}{\\sqrt(2\\pi)}.\\frac{1}{Nh}\\sum_{k\\in U} \\exp\\left[-\\frac{(x-x_k)^2} {2h^2} \\right]$$\r\n            \r\nwith `h` estimated by:\r\n            \r\n    $$\\hat{h}= \\frac{\\hat{\\sigma}}{N^{-1/5}}$$\r\n            \r\nConsidering `h` fixed and defining the variable `z`:\r\n            \r\n    $$z_k = \\frac{1}{h\\sqrt(2\\pi)} \\exp\\left[-\\frac{(x-x_k)^2} {2h^2}\\right]$$\r\n            \r\nThen,  `F'_{K(x)}` is the mean of `z`: \r\n            \r\n    $$F'_{K(x)}= \\frac{\\sum_{k\\in U}z_k} {N}$$\r\n            \r\nAn estimate of the mean of `z` in the domain `C` is\r\n            \r\n    $$\\hat{F'}_K(x)= \\frac{\\sum_{k_\\in C}z_kw_k}{\\sum_{k_\\in C}w_k}= \\frac{\\sum_{k=1}^n I_Cz_kw_k}{\\sum_{k=1}^n I_Cw_k}$$\r\n\r\nwhere `I_C` is the indicator of the domain.\r\n            \r\nIn the function ```linrmir```,  to estimate the derivative in the quantile ```quant_under``` for people aged below 65 it was used:\r\n\r\n# 1. Linearization of the median income of people aged below 65\r\n            \r\n                u1 <- (quant_under_65-Y1) * dom1/h\r\n                vect_f1 <- exp(-(u1^2)/2)/sqrt(2*\\pi)\r\n                f_quant1 <- sum(vect_f1*wght)/(N1*h)   # Estimate of F'(quantile) in linrmir\r\n                \r\nFrom this, outside the domain, the values of u1 are 0 and the correspondent values of ```vec_f1``` are equal to  `1/ \\sqrt{2\\pi}`, independently of the distance from `x_k` to `x`. \r\n            \r\nThe denominator `N1` estimates the domain population and just adds the weights for observations in the domain while in the numerator, because `exp(0)=1`, all observations take part in the sum.      \r\n            \r\nThe estimate `\\hat{F'}_K(x)` using the same notation would be: \r\n            \r\n# 2. Linearization of the median income of people aged below 65\r\n            \r\n                u1 <- (quant_under_65-Y1)/h\r\n                vect_f1 <- exp(-(u1^2)/2)/sqrt(2*pi)\r\n                f_quant1 <- sum(dom1*vect_f1*wght)/(N1*h)   # Alternative Estimate of F'(quantile) \r\n            \r\nthe same applies for the value of the derivative at ```quant_over```.\r\n            \r\nI wonder if `dom1` was misplaced?\r\n            \r\nReferences:\r\n\r\nGuillaume Osier (2009). Variance estimation for complex indicators of poverty and inequality. *Journal of the European Survey Research Association*, Vol.3, No.3, pp. 167-195, ISSN 1864-3361, http://ojs.ub.uni-konstanz.de/srm/article/view/369.\r\n            \r\npessoad@gmail.com"}}
{"actor":{"display_login":"JBreidaks"}}