diff --git a/lectures/util_rand_resp.md b/lectures/util_rand_resp.md index 15cc967..8423b67 100644 --- a/lectures/util_rand_resp.md +++ b/lectures/util_rand_resp.md @@ -19,31 +19,21 @@ plt.rcParams['font.family'] = ['Source Han Serif SC'] import numpy as np ``` -# Expected Utilities of Random Responses +# 随机回答的期望效用 +## 概述 -## Overview +{doc}`这篇 QuantEcon 讲座 ` 描述了 Warner {cite}`warner1965randomized` 传统中的随机回答调查,这种调查旨在保护受访者的隐私。 +Lars Ljungqvist {cite}`ljungqvist1993unified` 分析了受访者是否如实回答的决定如何取决于**期望效用**。 -{doc}`This QuantEcon lecture ` describes randomized response surveys in the tradition of Warner {cite}`warner1965randomized` that are designed to protect respondents' privacy. +该讲座讲述了 Ljungqvist 如何使用他的框架来阐明其他研究者提出的替代性随机回答调查技术,例如 {cite}`lanke1975choice`、{cite}`lanke1976degree`、{cite}`leysieffer1976respondent`、{cite}`anderson1976estimation`、{cite}`fligner1977comparison`、{cite}`greenberg1977respondent`、{cite}`greenberg1969unrelated`。 +## 隐私度量 -Lars Ljungqvist {cite}`ljungqvist1993unified` analyzed how a respondent's decision about whether to answer truthfully depends on **expected utility**. +我们考虑只有"是"和"否"两种可能答案的随机回答模型。 - - -The lecture tells how Ljungqvist used his framework to shed light on alternative randomized response survey techniques -proposed, for example, by {cite}`lanke1975choice`, {cite}`lanke1976degree`, {cite}`leysieffer1976respondent`, -{cite}`anderson1976estimation`, {cite}`fligner1977comparison`, {cite}`greenberg1977respondent`, -{cite}`greenberg1969unrelated`. - - - -## Privacy Measures - -We consider randomized response models with only two possible answers, "yes" and "no." - -The design determines probabilities +该设计决定了以下概率: $$ \begin{aligned} @@ -52,21 +42,19 @@ $$ \end{aligned} $$ - -These design probabilities in turn can be used to compute the conditional probability of belonging to the sensitive group $A$ for a given response, say $r$: +这些设计概率反过来可以用来计算给定回答 $r$ 时属于敏感群体 $A$ 的条件概率: $$ \text{Pr}(A|r)=\frac{\pi_A \text{Pr}(r|A)}{\pi_A \text{Pr}(r|A)+ (1-\pi_A) \text{Pr}(r|A^{'})} $$ (eq:util-rand-one) +## 概念集合 -## Zoo of Concepts +在这里我们描述一些研究者提出的概念 -At this point we describe some concepts proposed by various researchers +### Leysieffer 和 Warner(1976) -### Leysieffer and Warner(1976) - -The response $r$ is regarded as jeopardizing with respect to $A$ or $A^{'}$ if +如果响应$r$相对于$A$或$A^{'}$满足以下条件,则被视为具有危害性: $$ \begin{aligned} @@ -76,13 +64,13 @@ $$ \end{aligned} $$ (eq:util-rand-two) -From Bayes's rule: +根据贝叶斯法则: $$ \frac{\text{Pr}(A|r)}{\text{Pr}(A^{'}|r)}\times \frac{(1-\pi_A)}{\pi_A} = \frac{\text{Pr}(r|A)}{\text{Pr}(r|A^{'})} $$ (eq:util-rand-three) -If this expression is greater (less) than unity, it follows that $r$ is jeopardizing with respect to $A$($A^{'}$). Then, the natural measure of jeopardy will be: +如果这个表达式大于(小于)1,则表明$r$相对于$A$($A^{'}$)具有危害性。因此,危害性的自然度量将是: $$ \begin{aligned} @@ -92,8 +80,7 @@ g(r|A^{'})&=\frac{\text{Pr}(r|A^{'})}{\text{Pr}(r|A)} \end{aligned} $$ (eq:util-rand-four) - -Suppose, without loss of generality, that $\text{Pr}(\text{yes}|A)>\text{Pr}(\text{yes}|A^{'})$, then a yes (no) answer is jeopardizing with respect $A$($A^{'}$), that is, +假设在不失一般性的情况下,$\text{Pr}(\text{yes}|A)>\text{Pr}(\text{yes}|A^{'})$,则"是"("否")的回答相对于$A$($A^{'}$)具有危害性,即: $$ \begin{aligned} @@ -103,180 +90,178 @@ g(\text{no}|A^{'})&>1 \end{aligned} $$ -Leysieffer and Warner proved that the variance of the estimate can only be decreased through an increase in one or both of these two measures of jeopardy. +Leysieffer和Warner证明,估计的方差只能通过增加这两个危害性度量中的一个或两个来降低。 -An efficient randomized response model is, therefore, any model that attains the maximum acceptable levels of jeopardy that are consistent with cooperation of the respondents. +因此,一个有效的随机化响应模型就是在与受访者合作一致的情况下,达到最大可接受危害性水平的任何模型。 -As a special example, Leysieffer and Warner considered "a problem in which there is no jeopardy in a no answer"; that is, $g(\text{no}|A^{'})$ can be of unlimited magnitude. +作为一个特例,Leysieffer和Warner考虑了"一个'否'的回答不具有危害性的问题";也就是说,$g(\text{no}|A^{'})$可以是无限大的。 -Evidently, an optimal design must have +显然,最优设计必须满足 $$ \text{Pr}(\text{yes}|A)=1 $$ -which implies that +这意味着 $$ \text{Pr}(A|\text{no})=0 $$ -### Lanke(1976) +### Lanke(1976) -Lanke (1975) {cite}`lanke1975choice` argued that "it is membership in Group A that people may want to hide, not membership in the complementary Group A'." +Lanke (1975) {cite}`lanke1975choice` 认为"人们可能想要隐藏的是属于A组的身份,而不是属于补集A'组的身份。" -For that reason, Lanke (1976) {cite}`lanke1976degree` argued that an appropriate measure of protection is to minimize +因此,Lanke (1976) {cite}`lanke1976degree` 认为一个合适的保护度量是最小化 $$ \max \left\{ \text{Pr}(A|\text{yes}) , \text{Pr}(A|\text{no}) \right\} $$ (eq:util-rand-five-a) -Holding this measure constant, he explained under what conditions the smallest variance of the estimate was achieved with the unrelated question model or Warner's (1965) original model. +在保持这个度量不变的情况下,他解释了在什么条件下,使用无关问题模型或Warner (1965)的原始模型可以获得最小方差估计。 -### 2.3 Fligner, Policello, and Singh +### 2.3 Fligner, Policello和Singh -Fligner, Policello, and Singh reached similar conclusion as Lanke (1976). {cite}`fligner1977comparison` +Fligner, Policello和Singh得出了与Lanke (1976)类似的结论。{cite}`fligner1977comparison` -They measured "private protection" as +他们将"隐私保护"度量为 $$ \frac{1-\max \left\{ \text{Pr}(A|\text{yes}) , \text{Pr}(A|\text{no}) \right\}}{1-\pi_A} $$ (eq:util-rand-six) - -### 2.4 Greenberg, Kuebler, Abernathy, and Horvitz (1977) +### 2.4 Greenberg, Kuebler, Abernathy和Horvitz (1977) {cite}`greenberg1977respondent` -Greenberg, Kuebler, Abernathy, and Horvitz (1977) stressed the importance of examining the risk to respondents who do not belong to $A$ as well as the risk to those who do belong to the sensitive group. +Greenberg, Kuebler, Abernathy和Horvitz (1977)强调了检查不属于A组的受访者风险以及属于敏感群体的受访者风险的重要性。 -They defined the hazard for an individual in $A$ as the probability that he or she is perceived as belonging to $A$: +他们将A组个体的风险定义为被认为属于A组的概率: $$ + \text{Pr}(\text{yes}|A)\times \text{Pr}(A|\text{yes})+\text{Pr}(\text{no}|A)\times \text{Pr}(A|\text{no}) $$ (eq:util-rand-seven-a) -Similarly, the hazard for an individual who does not belong to $A$ would be +类似地,对于不属于$A$的个体,其风险为 $$ \text{Pr}(\text{yes}|A^{'})\times \text{Pr}(A|\text{yes})+\text{Pr}(\text{no}|A^{'}) \times \text{Pr}(A|\text{no}) $$ (eq:util-rand-seven-b) -Greenberg et al. (1977) also considered an alternative related measure of hazard that "is likely to be closer to the actual concern felt by a respondent." +Greenberg等人(1977)还考虑了另一个相关的风险度量,"这可能更接近受访者实际感受到的担忧。" -The "limited hazard" for an individual in $A$ and $A^{'}$ is +对于在$A$和$A^{'}$中的个体,其"有限风险"分别为 $$ \text{Pr}(\text{yes}|A)\times \text{Pr}(A|\text{yes}) $$ (eq:util-rand-eight-a) -and +和 $$ \text{Pr}(\text{yes}|A^{'})\times \text{Pr}(A|\text{yes}) $$ (eq:util-rand-eight-b) -This measure is just the first term in {eq}`eq:util-rand-seven-a`, i.e., the probability that an individual answers "yes" and is perceived to belong to $A$. +这个度量仅仅是{eq}`eq:util-rand-seven-a`中的第一项,即个体回答"是"且被认为属于$A$的概率。 -## Respondent's Expected Utility +## 受访者的期望效用 -### Truth Border +### 真实边界 -Key assumptions that underlie a randomized response technique for estimating the fraction of a population that belongs to $A$ are: +用于估计属于$A$的人群比例的随机回答技术的关键假设是: -- **Assumption 1**: Respondents feel discomfort from being thought of as belonging to $A$. +- **假设1**: 受访者对被认为属于$A$感到不适。 -- **Assumption 2**: Respondents prefer to answer questions truthfully than to lie, so long as the cost of doing so is not too high. The cost is taken to be the discomfort in 1. +- **假设2**: 只要代价不太高,受访者更倾向于如实回答问题而不是撒谎。这里的代价指的是假设1中的不适感。 -Let $r_i$ denote individual $i$'s response to the randomized question. +让$r_i$表示个体$i$对随机问题的回答。 -$r_i$ can only take values "yes" or "no". +$r_i$只能取值"是"或"否"。 -For a given design of a randomized response interview and a given belief about the fraction of the population -that belongs to $A$, the respondent's answer is associated with a conditional probability $ \text{Pr}(A|r_i)$ that the individual belongs to $A$. +对于给定的随机回应访谈设计和关于属于集合$A$的人口比例的某个信念,受访者的回答与该个体属于$A$的条件概率$\text{Pr}(A|r_i)$相关联。 -Given $r_i$ and complete privacy, the individual's utility is higher if $r_i$ represents a truthful answer rather than a lie. +在给定$r_i$和完全隐私的情况下,如果$r_i$代表真实答案而不是谎言,个体的效用会更高。 -In terms of a respondent's expected utility as a function of $ \text{Pr}(A|r_i)$ and $r_i$ +就受访者的期望效用作为$\text{Pr}(A|r_i)$和$r_i$的函数而言: -- The higher is $ \text{Pr}(A|r_i)$, the lower isindividual $i$'s expected utility. +- $\text{Pr}(A|r_i)$越高,个体$i$的期望效用越低。 -- expected utility is higher if $r_i$ represents a truthful answer rather than a lie +- 如果$r_i$代表真实答案而不是谎言,期望效用会更高。 -Define: +定义: -- $\phi_i \in \left\{\text{truth},\text{lie}\right\}$, a dichotomous variable that indicates whether or not $r_i$ is a truthful statement. +- $\phi_i \in \left\{\text{truth},\text{lie}\right\}$,一个二分变量,表示$r_i$是否为真实陈述。 -- $U_i\left(\text{Pr}(A|r_i),\phi_i\right)$, a utility function that is differentiable in its first argument, summarizes individual $i$'s expected utility. +- $U_i\left(\text{Pr}(A|r_i),\phi_i\right)$,一个对其第一个参数可微的效用函数,概括了个体$i$的期望效用。 -Then there is an $r_i$ such that +则存在一个$r_i$使得 $$ \frac{\partial U_i\left(\text{Pr}(A|r_i),\phi_i\right) }{\partial \text{Pr}(A|r_i)} <0, \text{ for } \phi_i \in \left\{\text{truth},\text{lie}\right\} $$ (eq:util-rand-nine-a) -and +且 $$ U_i\left(\text{Pr}(A|r_i),\text{truth}\right)>U_i\left(\text{Pr}(A|r_i),\text{lie}\right) , \text{ for } \text{Pr}(A|r_i) \in [0,1] $$ (eq:util-rand-nine-b) -Suppose now that correct answer for individual $i$ is "yes". +现在假设个体$i$的正确答案是"是"。 -Individual $i$ would choose to answer truthfully if +如果满足以下条件,个体$i$会选择如实回答: $$ U_i\left(\text{Pr}(A|\text{yes}),\text{truth}\right)\geq U_i\left(\text{Pr}(A|\text{no}),\text{lie}\right) $$ (eq:util-rand-ten-a) - -If the correct answer is "no", individual $i$ would volunteer the correct answer only if +如果正确答案是"否",个人$i$只有在以下情况下才会提供正确答案: $$ U_i\left(\text{Pr}(A|\text{no}),\text{truth}\right)\geq U_i\left(\text{Pr}(A|\text{yes}),\text{lie}\right) $$ (eq:util-rand-ten-b) -Assume that +假设 $$ \text{Pr}(A|\text{yes})>\pi_A>\text{Pr}(A|\text{no}) $$ -so that a "yes" answer increases the odds that an individual belongs to $A$. +因此"是"的答案增加了个人属于$A$的概率。 -Constraint {eq}`eq:util-rand-ten-b` holds for sure. +约束{eq}`eq:util-rand-ten-b`必定成立。 -Consequently, constraint {eq}`eq:util-rand-ten-a` becomes the single necessary condition for individual $i$ always to answer truthfully. +因此,约束{eq}`eq:util-rand-ten-a`成为个人$i$始终如实回答的唯一必要条件。 -At equality, constraint $(10.\text{a})$ determines conditional probabilities that make the individual indifferent between telling the truth and lying when the correct answer is "yes": +在等式情况下,约束$(10.\text{a})$确定了当正确答案为"是"时,使个人在说真话和说谎之间无差异的条件概率: $$ U_i\left(\text{Pr}(A|\text{yes}),\text{truth}\right)= U_i\left(\text{Pr}(A|\text{no}),\text{lie}\right) $$ (eq:util-rand-eleven) -Equation {eq}`eq:util-rand-eleven` defines a "truth border". +方程{eq}`eq:util-rand-eleven`定义了一个"真实边界"。 -Differentiating {eq}`eq:util-rand-eleven` with respect to the conditional probabilities shows that the truth border has a positive slope in the space of conditional probabilities: +对{eq}`eq:util-rand-eleven`中的条件概率求导表明,在条件概率空间中,真实边界具有正斜率: $$ \frac{\partial \text{Pr}(A|\text{no})}{\partial \text{Pr}(A|\text{yes})}=\frac{\frac{\partial U_i\left(\text{Pr}(A|\text{yes}),\text{truth}\right) }{\partial \text{Pr}(A|\text{yes})}}{\frac{\partial U_i\left(\text{Pr}(A|\text{no}),\text{lie}\right) }{\partial \text{Pr}(A|\text{no})}}>0 $$ (eq:util-rand-twelve) -The source of the positive relationship is: +正相关关系的来源是: -- The individual is willing to volunteer a truthful "yes" answer so long as the utility from doing so (i.e., the left side of {eq}`eq:util-rand-eleven`) is at least as high as the utility of lying on the right side of {eq}`eq:util-rand-eleven`. +- 只要说真话的效用(即{eq}`eq:util-rand-eleven`左侧)至少与说谎的效用({eq}`eq:util-rand-eleven`右侧)一样高,个人就愿意主动说出真实的"是"。 -- Suppose now that $\text{Pr}(A|\text{yes})$ increases. That reduces the utility of telling the truth. To preserve indifference between a truthful answer and a lie, $\text{Pr}(A|\text{no})$ must increase to reduce the utility of lying. +- 假设现在$\text{Pr}(A|\text{yes})$增加。这会降低说真话的效用。为了保持说真话和说谎之间的无差异,$\text{Pr}(A|\text{no})$必须增加以降低说谎的效用。 -### Drawing a Truth Border +### 绘制真实边界 -We can deduce two things about the truth border: +我们可以推断出关于真实边界的两点: -- The truth border divides the space of conditional probabilities into two subsets: "truth telling" and "lying". Thus, sufficient privacy elicits a truthful answer, whereas insufficient privacy results in a lie. The truth border depends on a respondent's utility function. +- 真实边界将条件概率空间分为两个子集:"说真话"和"说谎"。因此,充分的隐私会引出真实答案,而不充分的隐私则会导致谎言。真实边界取决于受访者的效用函数。 -- Assumptions in {eq}`eq:util-rand-nine-a` and {eq}`eq:util-rand-nine-a` are sufficient only to guarantee a positive slope of the truth border. The truth border can have either a concave or a convex shape. +- {eq}`eq:util-rand-nine-a`和{eq}`eq:util-rand-nine-a`中的假设仅足以保证真实边界的正斜率。真实边界可以是凹形或凸形。 -We can draw some truth borders with the following Python code: +我们可以用以下Python代码绘制一些真实边界: ```{code-cell} ipython3 x1 = np.arange(0, 1, 0.001) @@ -298,24 +283,23 @@ plt.ylim([0, 1]) plt.xlabel('Pr(A|yes)') plt.ylabel('Pr(A|no)') -plt.text(0.42, 0.3, "Truth Telling", fontdict={'size':28, 'style':'italic'}) -plt.text(0.8, 0.1, "Lying", fontdict={'size':28, 'style':'italic'}) +plt.text(0.42, 0.3, "说真话", fontdict={'size':28, 'style':'italic'}) +plt.text(0.8, 0.1, "说谎", fontdict={'size':28, 'style':'italic'}) plt.legend(loc=0, fontsize='large') -plt.title('Figure 1.1') +plt.title('图1.1') plt.show() ``` -Figure 1.1 three types of truth border. +图1.1 三种真实边界类型。 - -Without loss of generality, we consider the truth border: +在不失一般性的情况下,我们考虑真实边界: $$ U_i(\text{Pr}(A|r_i),\phi_i)=-\text{Pr}(A|r_i)+f(\phi_i) $$ -and plot the "truth telling" and "lying area" of individual $i$ in Figure 1.2: +并在图1.2中绘制个体$i$的"说真话"和"说谎区域": ```{code-cell} ipython3 x1 = np.arange(0, 1, 0.001) @@ -323,32 +307,32 @@ y1 = x1 - 0.4 z1 = x1 z2 = 0 plt.figure(figsize=(12, 10)) -plt.plot(x1, y1,'r-',label='Truth Border of: $U_i(Pr(A|r_i),\phi_i)=-Pr(A|r_i)+f(\phi_i)$') +plt.plot(x1, y1,'r-',label='真实边界:$U_i(Pr(A|r_i),\phi_i)=-Pr(A|r_i)+f(\phi_i)$') plt.plot(x1, x1, ':', linewidth=2) -plt.fill_between(x1, y1, z1, facecolor='blue', alpha=0.05, label='truth telling') -plt.fill_between(x1, z2, y1, facecolor='green', alpha=0.05, label='lying') +plt.fill_between(x1, y1, z1, facecolor='blue', alpha=0.05, label='说真话') +plt.fill_between(x1, z2, y1, facecolor='green', alpha=0.05, label='说谎') plt.xlim([0, 1]) plt.ylim([0, 1]) plt.xlabel('Pr(A|yes)') plt.ylabel('Pr(A|no)') -plt.text(0.5, 0.4, "Truth Telling", fontdict={'size':28, 'style':'italic'}) -plt.text(0.8, 0.2, "Lying", fontdict={'size':28, 'style':'italic'}) +plt.text(0.5, 0.4, "说真话", fontdict={'size':28, 'style':'italic'}) +plt.text(0.8, 0.2, "说谎", fontdict={'size':28, 'style':'italic'}) plt.legend(loc=0, fontsize='large') -plt.title('Figure 1.2') +plt.title('图1.2') plt.show() ``` -## Utilitarian View of Survey Design +## 调查设计的功利主义观点 -### Iso-variance Curves +### 等方差曲线 -A statistician's objective is +统计学家的目标是 -- to find a randomized response survey design that minimizes the bias and the variance of the estimator. +- 找到一个随机回答调查设计,使估计量的偏差和方差最小化。 -Given a design that ensures truthful answers by all respondents, Anderson(1976, Theorem 1) {cite}`anderson1976estimation` showed that the minimum variance estimate in the two-response model has variance +在一个确保所有受访者都会诚实回答的设计中,Anderson(1976, 定理1) {cite}`anderson1976estimation` 证明了在两响应模型中最小方差估计的方差为 $$ \begin{aligned} @@ -357,11 +341,11 @@ V(\text{Pr}(A|\text{yes}) , \text{Pr}(A|\text{no})) \end{aligned} $$ (eq:util-rand-thirteen) -where the random sample with replacement consists of $n$ individuals. +其中有放回随机样本包含 $n$ 个个体。 -We can use Expression {eq}`eq:util-rand-thirteen` to draw iso-variance curves. +我们可以使用表达式 {eq}`eq:util-rand-thirteen` 来绘制等方差曲线。 -The following inequalities restrict the shapes of iso-variance curves: +以下不等式限制了等方差曲线的形状: $$ \frac{d \text{ Pr}(A|\text{no})}{d\text{ Pr}(A|\text{yes})}\bigg|_{\text{constant variance}}=\frac{\pi_A-\text{Pr}(A|\text{no})}{\text{Pr}(A|\text{yes})-\pi_A}>0 @@ -371,23 +355,23 @@ $$ \frac{d^2 \text{ Pr}(A|\text{no})}{d\text{ Pr}(A|\text{yes})^2}\bigg|_{\text{constant variance}}=- \frac{2 \left[\pi_A-\text{Pr}(A|\text{no})\right]}{\left[\text{Pr}(A|\text{yes})-\pi_A \right]^2}<0 $$ (eq:util-rand-fourteen-b) -From expression {eq}`eq:util-rand-thirteen`, {eq}`eq:util-rand-fourteen-a` and {eq}`eq:util-rand-fourteen-b` we can see that: +从表达式 {eq}`eq:util-rand-thirteen`、{eq}`eq:util-rand-fourteen-a` 和 {eq}`eq:util-rand-fourteen-b` 我们可以看出: -- Variance can be reduced only by increasing the distance of $\text{Pr}(A|\text{yes})$ and/or $\text{Pr}(A|\text{no})$ from $r_A$. +- 方差只能通过增加 $\text{Pr}(A|\text{yes})$ 和/或 $\text{Pr}(A|\text{no})$ 与 $r_A$ 的距离来减小。 -- Iso-variance curves are always upward-sloping and concave. +- 等方差曲线始终向上倾斜且呈凹形。 -### Drawing Iso-variance Curves +### 绘制等方差曲线 -We use Python code to draw iso-variance curves. +我们使用Python代码来绘制等方差曲线。 -The pairs of conditional probabilities can be attained using Warner's (1965) model. +这些条件概率对可以使用Warner(1965)的模型获得。 -Note that: +注意: -- Any point on the iso-variance curves can be attained with the unrelated question model as long as the statistician can completely control the model design. +- 只要统计学家能完全控制模型设计,等方差曲线上的任何点都可以通过无关问题模型达到。 -- Warner's (1965) original randomized response model is less flexible than the unrelated question model. +- Warner(1965)的原始随机化回应模型比无关问题模型灵活性较低。 ```{code-cell} ipython3 class Iso_Variance: @@ -426,72 +410,72 @@ class Iso_Variance: plt.show() ``` -Properties of iso-variance curves are: +iso-方差曲线的特性是: -- All points on one iso-variance curve share the same variance +- 同一条iso-方差曲线上的所有点具有相同的方差 -- From $V_1$ to $V_9$, the variance of the iso-variance curve increase monotonically, as colors brighten monotonically +- 从$V_1$到$V_9$,iso-方差曲线的方差单调增加,颜色也单调变亮 -Suppose the parameters of the iso-variance model follow those in Ljungqvist {cite}`ljungqvist1993unified`, which are: +假设iso-方差模型的参数遵循Ljungqvist {cite}`ljungqvist1993unified`中的设定,即: - $\pi=0.3$ - $n=100$ -Then we can plot the iso-variance curve in Figure 2: +那么我们可以在图2中绘制iso-方差曲线: ```{code-cell} ipython3 var = Iso_Variance(pi=0.3, n=100) var.plotting_iso_variance_curve() ``` -### Optimal Survey +### 最优调查设计 -A point on an iso-variance curves can be attained with the unrelated question design. +在等方差曲线上的一点可以通过无关问题设计来实现。 -We now focus on finding an "optimal survey design" that +我们现在专注于寻找"最优调查设计",它需要: -- Minimizes the variance of the estimator subject to privacy restrictions. +- 在满足隐私限制的前提下,最小化估计量的方差。 -To obtain an optimal design, we first superimpose all individuals' truth borders on the iso-variance mapping. +为了获得最优设计,我们首先将所有个体的诚实边界叠加到等方差图上。 -To construct an optimal design +构建最优设计需要: -- The statistician should find the intersection of areas above all truth borders; that is, the set of conditional probabilities ensuring truthful answers from all respondents. +- 统计学家应该找到所有诚实边界线以上区域的交集;即确保所有受访者诚实回答的条件概率集合。 -- The point where this set touches the lowest possible iso-variance curve determines an optimal survey design. +- 该集合与最低可能的等方差曲线的切点确定了最优调查设计。 -Consquently, a minimum variance unbiased estimator is pinned down by an individual who is the least willing to volunteer a truthful answer. +因此,最小方差无偏估计量是由最不愿意提供诚实答案的个体所决定的。 -Here are some comments about the model design: +关于模型设计的一些说明: -- An individual's decision of whether or not to answer truthfully depends on his or her belief about other respondents' behavior, because this determines the individual's calculation of $\text{ Pr}(A|\text{yes})$ and $\text{ Pr}(A|\text{no})$. +- 个体是否诚实回答的决定取决于他或她对其他受访者行为的预期,因为这决定了个体对$\text{ Pr}(A|\text{yes})$和$\text{ Pr}(A|\text{no})$的计算。 -- An equilibrium of the optimal design model is a Nash equilibrium of a noncooperative game. +- 最优设计模型的均衡是非合作博弈的纳什均衡。 -- Assumption {eq}`eq:util-rand-nine-b` is sufficient to guarantee existence of an optimal model design. By choosing $\text{ Pr}(A|\text{yes})$ and $\text{ Pr}(A|\text{no})$ sufficiently close to each other, all respondents will find it optimal to answer truthfully. The closer are these probabilities, the higher the variance of the estimator becomes. +- 假设{eq}`eq:util-rand-nine-b`足以保证最优模型设计的存在。通过选择足够接近的$\text{ Pr}(A|\text{yes})$和$\text{ Pr}(A|\text{no})$,所有受访者都会发现如实回答是最优选择。这些概率越接近,估计量的方差就越大。 -- If respondents experience a large enough increase in expected utility from telling the truth, then there is no need to use a randomized response model. The smallest possible variance of the estimate is then obtained at $\text{ Pr}(A|\text{yes})=1$ and $\text{ Pr}(A|\text{no})=0$ ; that is, when respondents answer truthfully to direct questioning. +- 如果受访者从说实话中获得的预期效用增加足够大,那么就不需要使用随机化回答模型。在$\text{ Pr}(A|\text{yes})=1$和$\text{ Pr}(A|\text{no})=0$时可以获得最小可能的估计方差;也就是说,当受访者对直接提问如实回答时。 -- A more general design problem would be to minimize some weighted sum of the estimator's variance and bias. It would be optimal to accept some lies from the most "reluctant" respondents. +- 一个更普遍的设计问题是最小化估计量的方差和偏差的某种加权和。接受一些最"不情愿"的受访者的谎言可能是最优的。 -## Criticisms of Proposed Privacy Measures +## 对提议隐私措施的批评 -We can use a utilitarian approach to analyze some privacy measures. +我们可以用功利主义方法来分析一些隐私措施。 -We'll enlist Python Code to help us. +我们将使用Python代码来帮助我们。 -### Analysis of Method of Lanke's (1976) +### 对Lanke(1976)方法的分析 -Lanke (1976) recommends a privacy protection criterion that minimizes: +Lanke(1976)建议一个隐私保护标准,即最小化: $$ \max \left\{ \text{Pr}(A|\text{yes}) , \text{Pr}(A|\text{no}) \right\} $$ (eq:util-rand-five-b) -Following Lanke's suggestion, the statistician should find the highest possible $\text{ Pr}(A|\text{yes})$ consistent with truth telling while $\text{ Pr}(A|\text{no})$ is fixed at 0. The variance is then minimized at point $X$ in Figure 3. +按照Lanke的建议,统计学家应该在保持$\text{ Pr}(A|\text{no})$固定为0的情况下,寻找与诚实回答相一致的最大可能的$\text{ Pr}(A|\text{yes})$值。在图3中,方差在点$X$处达到最小。 -However, we can see that in Figure 3, point $Z$ offers a smaller variance that still allows cooperation of the respondents, and it is achievable following our discussion of the truth border in Part III: +然而,我们可以看到在图3中,点$Z$提供了一个更小的方差,它仍然能够保证受访者的配合,而且根据我们在第三部分对真实边界的讨论,这是可以实现的: ```{code-cell} ipython3 pi = 0.3 @@ -509,9 +493,9 @@ plt.figure(figsize=(12, 10)) plt.plot(x, x, 'c:', linewidth=2) plt.plot(x0, y1, 'c:', linewidth=2) plt.plot(y2, x2, 'c:', linewidth=2) -plt.plot(x, y, 'r-', label='Truth Border') -plt.fill_between(x, y, z, facecolor='blue', alpha=0.05, label='truth telling') -plt.fill_between(x, 0, y, facecolor='green', alpha=0.05, label='lying') +plt.plot(x, y, 'r-', label='真实边界') +plt.fill_between(x, y, z, facecolor='blue', alpha=0.05, label='诚实回答') +plt.fill_between(x, 0, y, facecolor='green', alpha=0.05, label='说谎') for i in range(len(nv)): y = pi - (pi**2 * (1 - pi)**2) / (n * (nv[i] / n) * (x0 - pi + 1e-8)) plt.plot(x0, y, 'k--', alpha=1 - 0.07 * i, label=f'V{i+1}') @@ -523,58 +507,57 @@ plt.xlim([0, 1]) plt.ylim([0, 0.5]) plt.xlabel('Pr(A|yes)') plt.ylabel('Pr(A|no)') -plt.text(0.45, 0.35, "Truth Telling", fontdict={'size':28, 'style':'italic'}) -plt.text(0.85, 0.35, "Lying",fontdict = {'size':28, 'style':'italic'}) -plt.text(0.515, 0.095, "Optimal Design", fontdict={'size':16,'color':'b'}) +plt.text(0.45, 0.35, "诚实回答", fontdict={'size':28, 'style':'italic'}) +plt.text(0.85, 0.35, "说谎",fontdict = {'size':28, 'style':'italic'}) +plt.text(0.515, 0.095, "最优设计", fontdict={'size':16,'color':'b'}) plt.legend(loc=0, fontsize='large') -plt.title('Figure 3') +plt.title('图3') plt.show() ``` -### Method of Leysieffer and Warner (1976) - -Leysieffer and Warner (1976) recommend a two-dimensional measure of jeopardy that reduces to a single dimension when there is no jeopardy in a 'no' answer", which means that +### Leysieffer和Warner方法(1976) +Leysieffer和Warner(1976)建议使用二维风险度量,当"否"答案不存在风险时可简化为一维,这意味着 $$ \text{Pr}(\text{yes}|A)=1 $$ -and +和 $$ \text{Pr}(A|\text{no})=0 $$ -This is not an optimal choice under a utilitarian approach. +从功利主义的角度来看,这不是最优选择。 -### Analysis on the Method of Chaudhuri and Mukerjee's (1988) +### Chaudhuri和Mukerjee方法(1988)的分析 {cite}`Chadhuri_Mukerjee_88` -Chaudhuri and Mukerjee (1988) argued that the individual may find that since "yes" may sometimes relate to the sensitive group A, a clever respondent may falsely but safely always be inclined to respond "no". In this situation, the truth border is such that individuals choose to lie whenever the truthful answer is "yes" and +Chaudhuri和Mukerjee(1988)认为,由于"是"有时可能与敏感群体A相关,聪明的受访者可能会倾向于总是安全但虚假地回答"否"。在这种情况下,真实边界使得个人在真实答案为"是"时选择说谎,且 $$ \text{Pr}(A|\text{no})=0 $$ -Here the gain from lying is too high for someone to volunteer a "yes" answer. +在这里,说谎带来的收益太高,以至于没有人愿意回答"是"。 -This means that +这意味着 $$ U_i\left(\text{Pr}(A|\text{yes}),\text{truth}\right)< U_i\left(\text{Pr}(A|\text{no}),\text{lie}\right) $$ -in any situation always. +在任何情况下都成立。 -As a result, there is no attainable model design. +因此,不存在可实现的模型设计。 -However, under a utilitarian approach there should exist other survey designs that are consistent with truthful answers. +然而,从功利主义的角度来看,应该存在其他与真实答案相一致的调查设计。 -In particular, respondents will choose to answer truthfully if the relative advantage from lying is eliminated. +特别是,如果消除了说谎带来的相对优势,受访者将选择如实回答。 -We can use Python to show that the optimal model design corresponds to point Q in Figure 4: +我们可以用Python来展示最优模型设计对应图4中的Q点: ```{code-cell} ipython3 def f(x): @@ -602,96 +585,97 @@ plt.figure(figsize=(12, 10)) plt.plot(x, x, 'c:', linewidth=2) plt.plot(x0, y1,'c:', linewidth=2) plt.plot(y2, x2,'c:', linewidth=2) -plt.plot(x3, y3,'b-', label='Truth Border') -plt.fill_between(x, y, z, facecolor='blue', alpha=0.05, label='Truth telling') -plt.fill_between(x3, 0, y3,facecolor='green', alpha=0.05, label='Lying') +plt.plot(x3, y3,'b-', label='真实边界') +plt.fill_between(x, y, z, facecolor='blue', alpha=0.05, label='说实话') +plt.fill_between(x3, 0, y3,facecolor='green', alpha=0.05, label='说谎') for i in range(len(nv)): y = pi - (pi**2 * (1 - pi)**2) / (n * (nv[i] / n) * (x0 - pi + 1e-8)) plt.plot(x0, y, 'k--', alpha=1 - 0.07 * i, label=f'V{i+1}') plt.scatter(0.61, 0.146, c='r', marker='*', label='Z', s=150) plt.xlim([0, 1]) plt.ylim([0, 0.5]) -plt.xlabel('Pr(A|yes)') -plt.ylabel('Pr(A|no)') -plt.text(0.45, 0.35, "Truth Telling", fontdict={'size':28, 'style':'italic'}) -plt.text(0.8, 0.1, "Lying", fontdict={'size':28, 'style':'italic'}) -plt.text(0.63, 0.141, "Optimal Design", fontdict={'size':16,'color':'r'}) +plt.xlabel('Pr(A|是)') +plt.ylabel('Pr(A|否)') +plt.text(0.45, 0.35, "说实话", fontdict={'size':28, 'style':'italic'}) +plt.text(0.8, 0.1, "说谎", fontdict={'size':28, 'style':'italic'}) +plt.text(0.63, 0.141, "最优设计", fontdict={'size':16,'color':'r'}) plt.legend(loc=0, fontsize='large') -plt.title('Figure 4') +plt.title('图4') plt.show() ``` -### Method of Greenberg et al. (1977) +### Greenberg等人(1977)的方法 - {cite}`greenberg1977respondent` +{cite}`greenberg1977respondent` -Greenberg et al. (1977) defined the hazard for an individual in $A$ as the probability that he or she is perceived as belonging to $A$: +Greenberg等人(1977)将属于群体$A$的个体的风险定义为他/她被认为属于$A$的概率: $$ \text{Pr}(\text{yes}|A)\times \text{Pr}(A|\text{yes})+\text{Pr}(\text{no}|A)\times \text{Pr}(A|\text{no}) $$ (eq:util-rand-seven-aa) -The hazard for an individual who does not belong to $A$ is +不属于群体$A$的个体的风险是: $$ \text{Pr}(\text{yes}|A^{'})\times \text{Pr}(A|\text{yes})+\text{Pr}(\text{no}|A^{'}) \times \text{Pr}(A|\text{no}) $$ (eq:util-rand-seven-bb) -They also considered an alternative related measure of hazard that they said "is likely to be closer to the actual concern felt by a respondent." +他们还考虑了另一个相关的风险度量,他们认为这个度量"可能更接近受访者实际感受到的担忧。" -Their "limited hazard" for an individual in $A$ and $A^{'}$ is +对于属于$A$和$A^{'}$的个体,他们的"有限风险"分别是: $$ \text{Pr}(\text{yes}|A)\times \text{Pr}(A|\text{yes}) $$ (eq:util-rand-eight-aa) -and +和 $$ \text{Pr}(\text{yes}|A^{'})\times \text{Pr}(A|\text{yes}) $$ (eq:util-rand-eight-bb) -According to Greenberg et al. (1977), a respondent commits himself or herself to answer truthfully on the basis of a probability in {eq}`eq:util-rand-seven-aa` or {eq}`eq:util-rand-eight-aa` **before** randomly selecting the question to be answered. +根据Greenberg等人(1977)的说法,受访者在随机选择要回答的问题**之前**,就已经承诺根据{eq}`eq:util-rand-seven-aa`或{eq}`eq:util-rand-eight-aa`中的概率如实回答。 -Suppose that the appropriate privacy measure is captured by the notion of "limited hazard" in {eq}`eq:util-rand-eight-aa` and {eq}`eq:util-rand-eight-bb`. +假设适当的隐私度量由{eq}`eq:util-rand-eight-aa`和{eq}`eq:util-rand-eight-bb`中的"有限风险"概念来表示。 -Consider an unrelated question model where the unrelated question is replaced by the instruction "Say the word 'no'", which implies that +考虑一个无关问题模型,其中无关问题被替换为指令"说'不'",这意味着 $$ + \text{Pr}(A|\text{yes})=1 $$ -and it follows that: +由此可得: -- Hazard for an individual in $A^{'}$ is 0. +- $A^{'}$中个体的风险为0。 -- Hazard for an individual in $A$ can also be made arbitrarily small by choosing a sufficiently small $\text{Pr}(\text{yes}|A)$. +- 通过选择足够小的$\text{Pr}(\text{yes}|A)$,$A$中个体的风险也可以任意小。 -Even though this hazard can be set arbitrarily close to 0, an individual in $A$ will completely reveal his or her identity whenever truthfully answering the sensitive question. +尽管这个风险可以被设定为接近0,但$A$中的个体在如实回答敏感问题时会完全暴露其身份。 -However, under utilitarian framework, it is obviously contradictory. +然而,在功利主义框架下,这显然是矛盾的。 -If the individuals are willing to volunteer this information, it seems that the randomized response design was not necessary in the first place. +如果个体愿意主动提供这些信息,那么随机回答设计似乎从一开始就是不必要的。 -It ignores the fact that respondents retain the option of lying until they have seen the question to be answered. +这忽略了一个事实,即受访者在看到需要回答的问题之前,仍然保留说谎的选择。 -## Concluding Remarks +## 总结说明 +随机回答程序的合理性在于: -The justifications for a randomized response procedure are that +- 认为受访者会因被视为属于敏感群体而感到不适。 -- Respondents are thought to feel discomfort from being perceived as belonging to the sensitive group. +- 除非过于暴露,受访者更倾向于如实回答问题而不是说谎。 -- Respondents prefer to answer questions truthfully than to lie, unless it is too revealing. +如果隐私度量与受访者的理性行为不完全一致,那么所有为得出最优模型设计所做的努力都将是徒劳的。 -If a privacy measure is not completely consistent with the rational behavior of the respondents, all efforts to derive an optimal model design are futile. +功利主义方法在假设受访者会最大化其预期效用的前提下,为模拟受访者行为提供了一个系统的方法。 -A utilitarian approach provides a systematic way to model respondents' behavior under the assumption that they maximize their expected utilities. +在功利主义分析中: -In a utilitarian analysis: -- A truth border divides the space of conditional probabilities of being perceived as belonging to the sensitive group, $\text{Pr}(A|\text{yes})$ and $\text{Pr}(A|\text{no})$, into the truth-telling region and the lying region. +- 真实边界将感知属于敏感群体的条件概率空间$\text{Pr}(A|\text{yes})$和$\text{Pr}(A|\text{no})$划分为说真话区域和说谎区域。 -- The optimal model design is obtained at the point where the truth border touches the lowest possible iso-variance curve. +- 最优模型设计是在真实边界接触到最低可能的等方差曲线的点上获得的。 -A practical implication of the analysis of {cite}`ljungqvist1993unified` is that uncertainty about respondents' demands for privacy can be acknowledged by **choosing $\text{Pr}(A|\text{yes})$ and $\text{Pr}(A|\text{no})$ sufficiently close to each other**. +{cite}`ljungqvist1993unified`分析的一个实际含义是,可以通过**选择足够接近的$\text{Pr}(A|\text{yes})$和$\text{Pr}(A|\text{no})$**来承认对受访者隐私需求的不确定性。 diff --git a/tools/translation.log b/tools/translation.log index 7f9cfd4..0419c75 100644 --- a/tools/translation.log +++ b/tools/translation.log @@ -13648,3 +13648,110 @@ Processing chunk 25/25 of lectures/prob_meaning.md (length: 975 chars) 2025-03-20 21:20:49,278 - INFO - Result for prob_meaning.md: Successfully processed prob_meaning.md 2025-03-20 21:20:49,278 - INFO - All translations completed successfully! +2025-03-24 14:28:57,165 - INFO - Files to translate: ['util_rand_resp.md'] +2025-03-24 14:28:57,165 - INFO - Processing lectures/util_rand_resp.md +2025-03-24 14:28:57,231 - INFO - Split lectures/util_rand_resp.md into 20 chunks +2025-03-24 14:28:57,231 - INFO - +Processing chunk 1/20 of lectures/util_rand_resp.md (length: 409 chars) +2025-03-24 14:29:02,136 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:29:02,140 - INFO - Received response for chunk 1 (length: 409 chars) +2025-03-24 14:29:02,140 - INFO - Wrote chunk 1 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:29:02,140 - INFO - +Processing chunk 2/20 of lectures/util_rand_resp.md (length: 1466 chars) +2025-03-24 14:29:09,992 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:29:09,993 - INFO - Received response for chunk 2 (length: 879 chars) +2025-03-24 14:29:09,993 - INFO - Wrote chunk 2 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:29:09,993 - INFO - +Processing chunk 3/20 of lectures/util_rand_resp.md (length: 1479 chars) +2025-03-24 14:29:24,181 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:29:24,182 - INFO - Received response for chunk 3 (length: 931 chars) +2025-03-24 14:29:24,182 - INFO - Wrote chunk 3 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:29:24,182 - INFO - +Processing chunk 4/20 of lectures/util_rand_resp.md (length: 1422 chars) +2025-03-24 14:29:37,836 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:29:37,837 - INFO - Received response for chunk 4 (length: 834 chars) +2025-03-24 14:29:37,837 - INFO - Wrote chunk 4 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:29:37,837 - INFO - +Processing chunk 5/20 of lectures/util_rand_resp.md (length: 1480 chars) +2025-03-24 14:29:50,918 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:29:50,919 - INFO - Received response for chunk 5 (length: 803 chars) +2025-03-24 14:29:50,919 - INFO - Wrote chunk 5 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:29:50,919 - INFO - +Processing chunk 6/20 of lectures/util_rand_resp.md (length: 1459 chars) +2025-03-24 14:29:59,744 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:29:59,745 - INFO - Received response for chunk 6 (length: 804 chars) +2025-03-24 14:29:59,745 - INFO - Wrote chunk 6 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:29:59,745 - INFO - +Processing chunk 7/20 of lectures/util_rand_resp.md (length: 1269 chars) +2025-03-24 14:30:06,823 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:30:06,824 - INFO - Received response for chunk 7 (length: 770 chars) +2025-03-24 14:30:06,824 - INFO - Wrote chunk 7 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:30:06,824 - INFO - +Processing chunk 8/20 of lectures/util_rand_resp.md (length: 2492 chars) +2025-03-24 14:30:25,654 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:30:25,655 - INFO - Received response for chunk 8 (length: 1751 chars) +2025-03-24 14:30:25,655 - INFO - Wrote chunk 8 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:30:25,655 - INFO - +Processing chunk 9/20 of lectures/util_rand_resp.md (length: 940 chars) +2025-03-24 14:30:32,410 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:30:32,411 - INFO - Received response for chunk 9 (length: 783 chars) +2025-03-24 14:30:32,411 - INFO - Wrote chunk 9 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:30:32,411 - INFO - +Processing chunk 10/20 of lectures/util_rand_resp.md (length: 1419 chars) +2025-03-24 14:30:41,602 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:30:41,606 - INFO - Received response for chunk 10 (length: 1020 chars) +2025-03-24 14:30:41,606 - INFO - Wrote chunk 10 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:30:41,606 - INFO - +Processing chunk 11/20 of lectures/util_rand_resp.md (length: 1927 chars) +2025-03-24 14:30:51,739 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:30:51,739 - INFO - Received response for chunk 11 (length: 1540 chars) +2025-03-24 14:30:51,739 - INFO - Wrote chunk 11 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:30:51,739 - INFO - +Processing chunk 12/20 of lectures/util_rand_resp.md (length: 519 chars) +2025-03-24 14:30:54,435 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:30:54,437 - INFO - Received response for chunk 12 (length: 288 chars) +2025-03-24 14:30:54,437 - INFO - Wrote chunk 12 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:30:54,437 - INFO - +Processing chunk 13/20 of lectures/util_rand_resp.md (length: 1205 chars) +2025-03-24 14:31:00,240 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:31:00,241 - INFO - Received response for chunk 13 (length: 380 chars) +2025-03-24 14:31:00,241 - INFO - Wrote chunk 13 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:31:00,241 - INFO - +Processing chunk 14/20 of lectures/util_rand_resp.md (length: 1262 chars) +2025-03-24 14:31:07,289 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:31:07,295 - INFO - Received response for chunk 14 (length: 546 chars) +2025-03-24 14:31:07,295 - INFO - Wrote chunk 14 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:31:07,295 - INFO - +Processing chunk 15/20 of lectures/util_rand_resp.md (length: 1673 chars) +2025-03-24 14:31:17,514 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:31:17,516 - INFO - Received response for chunk 15 (length: 1370 chars) +2025-03-24 14:31:17,516 - INFO - Wrote chunk 15 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:31:17,516 - INFO - +Processing chunk 16/20 of lectures/util_rand_resp.md (length: 1538 chars) +2025-03-24 14:31:26,091 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:31:26,092 - INFO - Received response for chunk 16 (length: 774 chars) +2025-03-24 14:31:26,092 - INFO - Wrote chunk 16 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:31:26,092 - INFO - +Processing chunk 17/20 of lectures/util_rand_resp.md (length: 1247 chars) +2025-03-24 14:31:34,222 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:31:34,223 - INFO - Received response for chunk 17 (length: 1194 chars) +2025-03-24 14:31:34,223 - INFO - Wrote chunk 17 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:31:34,223 - INFO - +Processing chunk 18/20 of lectures/util_rand_resp.md (length: 1491 chars) +2025-03-24 14:31:42,345 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:31:42,345 - INFO - Received response for chunk 18 (length: 904 chars) +2025-03-24 14:31:42,346 - INFO - Wrote chunk 18 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:31:42,346 - INFO - +Processing chunk 19/20 of lectures/util_rand_resp.md (length: 1353 chars) +2025-03-24 14:31:51,115 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:31:51,116 - INFO - Received response for chunk 19 (length: 438 chars) +2025-03-24 14:31:51,116 - INFO - Wrote chunk 19 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:31:51,116 - INFO - +Processing chunk 20/20 of lectures/util_rand_resp.md (length: 612 chars) +2025-03-24 14:31:54,416 - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK" +2025-03-24 14:31:54,417 - INFO - Received response for chunk 20 (length: 247 chars) +2025-03-24 14:31:54,417 - INFO - Wrote chunk 20 translation to lectures/util_rand_resp_cn.md +2025-03-24 14:31:54,417 - INFO - All chunks translated and saved to lectures/util_rand_resp_cn.md +2025-03-24 14:31:54,417 - INFO - Result for util_rand_resp.md: Successfully processed util_rand_resp.md +2025-03-24 14:31:54,418 - INFO - +All translations completed successfully! diff --git a/tools/translation_history.json b/tools/translation_history.json index 51b78f8..98a797d 100644 --- a/tools/translation_history.json +++ b/tools/translation_history.json @@ -288,5 +288,10 @@ "hash": "63eccc98317151b4bc0c83af31b395bc", "last_modified": 1742203837.8098228, "last_translated": 1742204007.591847 + }, + "lectures/util_rand_resp.md": { + "hash": "8b7e183efc2092e438dc5a6cc6a1ab03", + "last_modified": 1742786858.046247, + "last_translated": 1742787114.4174118 } } \ No newline at end of file