text:
Article Text

Frequency, predictors and cardiovascular outcomes associated with transthoracic echocardiographic findings during acute ischaemic stroke hospitalisation
1. Richa Sharma1,
2. Scott Silverman2,
3. Shaun Patel2,
4. Lee H Schwamm2,
5. Danita Yoerger Sanborn3
1. 1Department of Neurology, Yale University School of Medicine, New Haven, Connecticut, USA
2. 2Department of Neurology, Massachusetts General Hospital, Boston, Massachusetts, USA
3. 3Department of Cardiology, Massachusetts General Hospital, Boston, Massachusetts, USA
1. Correspondence to Dr Richa Sharma; richa.sharma{at}yale.edu

## Abstract

Objective To characterise the clinical utility of transthoracic echocardiography (TTE) at the time of acute ischaemic stroke (AIS).

Background The utility of obtaining a TTE during AIS hospitalisation is uncertain.

Methods We studied AIS hospitalisations at a single centre (2002–2016). TTE abnormalities were classified as findings associated with: high stroke risk (Category I), cardiac events (Category II) and of unclear significance (Category III). We performed logistic regressions to predict Category I, II and III abnormalities. The odds of 1 year recurrent stroke hospitalisation captured by ICD 9 and 10 codes as a function of Category I, II and III abnormalities were assessed. Improvement in predictive capacity for 1 year recurrent ischaemic stroke hospitalisation beyond stroke risk factors was evaluated by net reclassification improvement.

Results There were 5523 AIS hospitalisations. Nearly 81% of admission TTEs were abnormal (18.7% Category I, 32.7% Category II, 72.8% Category III). Older patients with coronary artery disease, atrial fibrillation, hypertension, diabetes, and patent intracranial and extracranial vessels were likely to have an abnormal TTE. Category I finding was associated with lower odds of 1-year recurrent stroke hospitalisation (OR 0.54, 95% CI 0.30 to 0.96). Category I data significantly improved the predictive value for 1-year recurrent ischaemic stroke hospitalisation beyond stroke risk factors (net reclassification improvement 0.1563, 95% CI 0.0465 to 0.2661).

Conclusions TTE abnormalities associated with stroke and cardiac event risk were commonly detected during AIS hospitalisation. Detection of Category I TTE findings reduced the risk of recurrent stroke, potentially due to neutralisation of the cardioembolic source by targeted therapy, indicating the clinical utility of TTE.

• Stroke
• Embolism

## Data availability statement

Data are available upon reasonable request. The data that support the findings of this study are available from the corresponding author upon reasonable request by investigators.

This is an open access article distributed in accordance with the Creative Commons Attribution Non Commercial (CC BY-NC 4.0) license, which permits others to distribute, remix, adapt, build upon this work non-commercially, and license their derivative works on different terms, provided the original work is properly cited, appropriate credit is given, any changes made indicated, and the use is non-commercial. See: http://creativecommons.org/licenses/by-nc/4.0/.

## Request Permissions

If you wish to reuse any or all of this article please use the link below which will take you to the Copyright Clearance Center’s RightsLink service. You will be able to get a quick price and instant permission to reuse the content in many different ways.

#### What is already known on this topic

• Transthoracic echocardiography (TTE) studies are routinely performed in patients hospitalised with acute ischaemic stroke (AIS). The utility of obtaining a TTE during AIS hospitalisation is uncertain.

• We demonstrate that 18% of AIS TTE studies demonstrate high-risk cardioembolic sources of stroke and we identify clinical and radiographic predictors of these TTE findings. Detection of these abnormalities by TTE was associated with lower odds of 1 year recurrent stroke hospitalisation (OR 0.54, 95% CI 0.30 to 0.96) and improved the predictive capacity for 1 year recurrent ischaemic stroke hospitalisation beyond stroke risk factors.

#### How this study might affect research, practice, and/or policy

• These findings may inform future guidelines and clinical practice regarding the utilisation of TTE during AIS hospitalisation to facilitate prevention of recurrent stroke.

## Introduction

Patients with acute ischaemic stroke (AIS) routinely undergo transthoracic echocardiography (TTE) during the inpatient encounter, however the clinical utility of this study in patients who had a stroke is unknown. Cardiac abnormalities can coexist in patients with ischaemic stroke due to shared vascular risk factors. One meta-analysis demonstrated a prevalence of asymptomatic coronary artery disease (CAD) of 52% among patients with AIS and a 3% risk of myocardial infarction (MI) within 1 year in patients without any cardiac history.1 While some AIS and cardiac therapies overlap, others are uniquely aimed at each disease. Pharmacological, surgical and procedural interventions target certain cardiac conditions and decrease mortality, but are rarely used in patients without cardiac diagnoses.2 Quantifying cardiac abnormality frequencies and their progression over time in patients with AIS is critical to inform when to obtain a TTE for the purpose of mitigating risk of future stroke and cardiovascular events.

Prior studies describe the epidemiology of cardiac abnormalities detected by TTE in patients with AIS, however, these are limited by solely assessing findings pertinent to stroke prevention, cross-sectional design, small samples sizes and lack of generalisability due to being performed outside of the USA.3–5 Reflecting the paucity of evidence linking TTEs obtained during AIS admission and clinical outcomes, the yield of echocardiography in the AIS context is denoted as uncertain in the current guidelines.6

Clinicians face uncertainty about whether TTE in patients with AIS informs management to prevent future stroke and cardiovascular events while attempting to practice resource stewardship. Patient-level predictors of having a TTE abnormality during AIS admission need to be more clearly defined. It is unknown which patients with AIS with a prior TTE study will have a newly detected finding. Finally, it is important to determine whether detecting the presence of specific TTE findings during AIS hospitalisation are associated with risk of future stroke, MI and heart failure hospitalisation.

In this study, we aim to (1) Explore the frequency of findings on AIS admission TTE and their rates of progression over time, (2) Identify patient-level predictors of having specific TTE findings during AIS admission and new TTE findings if a prior study was normal, and (3) Determine the odds of 1 year hospitalisation for recurrent stroke, MI and heart failure associated with having specific TTE findings at the time of AIS admission.

## Methods

### Patient population

This retrospective study was performed at an academic institution from 2002 to 2016. The cohort was derived from the institution’s Get-With-The-Guidelines-Stroke database, a quality improvement initiative in which hospitals enter clinical and radiographic data of all patients hospitalised with a stroke diagnosis.7 Patients with AIS are identified retrospectively by administrative discharge ICD-9 and ICD-10 codes and prospectively by daily review of clinical logs. Data abstraction, entry and adjudication are performed by trained study personnel. There are logic checks and form controls to minimise data entry errors. The covariates in this study were age, gender, race, admission year, history of atrial fibrillation (AF), CAD/prior MI, hypertension (HTN), hyperlipidaemia (HLD), diabetes mellitus (DM), carotid disease, peripheral vascular disease (PVD) excluding the carotid artery, prior stroke or transient ischaemic attack, smoking, chronic kidney disease (CKD), heart valve prosthesis, National Institutes of Health Stroke Scale (NIHSS) at presentation (dichotomised as minor and major stroke by NIHSS <4 and >4),8 presenting symptoms, and home medications.

Hospitalisations were included in this cohort if age at admission was ≥18 years, AIS was diagnosed during hospitalisation and a TTE was performed during the AIS hospitalisation. Of the 8859 consecutive admissions to our hospital with AIS, a total of 5523 met these criteria. Subgroups consisted of admissions with (1) Prior, most recently performed TTE available in hospital system’s records (n=1106), (2) TTE performed ≥3 months after AIS hospitalisation (n=1077), and (3) TTE performed most recently prior to the AIS hospitalisation and at ≥3 months after the AIS hospitalisation (n=373).

### Echocardiographic features

All patients in this cohort underwent a two-dimensional TTE during admission for an AIS. TTEs were performed by trained hospital sonographers and interpreted by board-certified echocardiographers. TTE images were collected per Intersocietal Accreditation Commission of Echocardiography standards and included colour Doppler, continuous wave and pulse wave data. Images were analysed in apical two-chamber and four-chamber views as well as parasternal long-axis and short-axis views.

We classified TTE findings into three mutually exclusive categories based on the reading echocardiographer’s hard-coded interpretations in the database: (1) Features associated with a high risk of cardioembolic stroke (Category I), (2) Abnormalities warranting timely cardiac workup and treatment not necessarily related to stroke management (Category II), and (3) Possible indicators of stroke aetiology and/or cardiac disease with no immediate therapeutic consequence but may warrant further monitoring and long-term risk factor management (Category III). High-risk cardioembolic sources are abnormalities outlined in the 1993 TOAST (Trial of Org 10172 in Acute Stroke Treatment) publication9 plus the presence of a patent foramen ovale (PFO) which are associated with evidence-based secondary stroke prevention treatments.10–12 Category I features included: left ventricular (LV) thrombus, PFO (ascertained by Doppler and/or agitated saline contrast), atrial septal aneurysm, intracardiac tumour, left-sided endocarditis and left-sided valvular prosthesis. Category II abnormalities were: depressed ejection fraction (EF),13 14 LV aneurysm,15 LV segmental wall motion abnormality,16 aortic stenosis17 and regurgitation18 (moderate and severe by colour Doppler), and mitral stenosis19 and regurgitation20 (moderate and severe by colour Doppler). Category III findings included: dilated left atrium (LA),21 22 LV hypertrophy (LVH),23 mitral annular calcification (MAC),24 Lambl’s excrescence25 and aortic atheroma.26

### Outcomes

The outcomes of incident hospitalisation for recurrent ischaemic stroke and cardiac events were ascertained within the time frame of the day after AIS hospitalisation discharge to 1 year after discharge in the full cohort. We queried the Massachusetts General Hospital’s Research Patient Database Repository for discrete hospitalisations that occurred within the health system with a principal diagnoses of ischaemic stroke (ICD-9 434 .xx, 436 .xx; ICD-10 I63.3-I63.9), MI (ICD-9 410 .xx; ICD-10 I21.xx, I22.xx) and heart failure (ICD-9 428 .xx; ICD-10 I50.xx).27 We counted only the first incident hospitalisation for each of the individual outcomes of recurrent ischaemic stroke, MI and heart failure within 1 year after AIS discharge.

### Statistical analysis

#### Comparison of TTE abnormalities in patients who had an ischaemic stroke across time

Statistical analyses were performed in SAS software V.9.4 (Cary, North Carolina, USA). Baseline demographic and clinical characteristics are presented as percentages and means as appropriate. Among patients with both TTEs prior to and during AIS admission, exact McNemar’s testing was used to determine whether there was a significant difference in the proportion of patients with each prespecified cardiac abnormality at the two time points. This test was selected due to the lack of independence between repeated measures within the same group of patients.28 29 Statistical significance was set at p<0.05. This test was also applied among patients with both an inpatient TTE and TTE >3 months after admission. Among patients with TTEs available prior to, during, and ≥3 months after admission, we compared the proportions of patients with each cardiac abnormality at each time point by Cochran’s Q test.

#### Logistic regression modelling

To identify predictors of Category I, II and II abnormalities detected on AIS admission TTE, multivariable logistic regression models were developed using clinical and imaging covariates available at the time of or soon after presentation including age, gender, race, prior medical comorbidities and medication use, NIHSS at presentation, and radiographic findings (cortical infarct location, infratentorial infarct location, and vessel stenosis or occlusion). We excluded patients with prior history of heart failure from this analysis since heart failure was one of the TTE outcomes of interest. Among patients without a history of heart failure (n=5228), we modelled the likelihood of observing any of the prespecified TTE findings. We also modelled the likelihood of having a TTE abnormality in each of the three categories with specific management implications. Parsimonious models were created by stepwise selection (p values of entry and exit: 0.05). These models were also generated in a subgroup of patients with no prior history of heart failure, mechanical heart valve or AF (n=4234) since there are well-defined management approaches with these diagnoses and AIS. We created a multivariable logistic regression model to identify independent predictors of having a new TTE finding if a prior TTE showed no abnormalities. Finally, we ascertained the odds of (1) Incident hospitalisation for recurrent ischaemic stroke, (2) MI, and (3) Heart failure within 1 year of the index AIS hospitalisation in all patients with AIS regardless of baseline heart failure status as a function of having a Category 1, II and III TTE abnormality detected by the AIS TTE by univariate logistic regression modelling.

#### Net reclassification improvement analysis

We sought to evaluate the additive value of Category I findings in predicting incident hospitalisation for recurrent ischaemic stroke within the 1 year follow-up period. We calculated the net reclassification index and its two-sided 95% CI to understand the incremental predictive capacity of Category I TTE biomarker data above the baseline characteristics collected during AIS admission.30 These characteristics were the following: age, sex, race, and history of prior stroke, HTN, HLD, diabetes, AF and heart failure.

## Results

There were 5523 hospitalisations in the cohort (table 1). More than half were male, and the mean age of patients was 68.6 years. The majority of the cohort was Caucasian (86%) with HTN (68%), AF (20%), HLD (40%) and DM (23%). Average admission NIHSS was 8. Nearly 33% reported taking an antithrombotic (29% an antiplatelet, 4.9% an anticoagulant). Seventy-two per cent had cortical infarcts, 27% had infratentorial infarcts, and 30% had significant head or neck stenosis or occlusion of a head or neck artery. The accuracy of our automated method of radiology data extraction in a random sample of 100 selected for each variable was 98% for neuroanatomical location and 99% for vessel abnormality.

Table 1

Characteristics of the study cohort

Nearly 81% of admission TTEs had at least one abnormality of interest. The most frequent admission TTE findings were: dilated LA (44%), MAC (37%), LVH (26%), aortic atheroma (17%), PFO (16%), segmental LV wall motion abnormality (14%), moderate or severe mitral regurgitation (11%), and EF ≤35% (7.4%). In the cohort without a prior history of heart failure, a total of 4157 out of 5228 (79.5%) admission TTEs demonstrated at least one abnormality. There were 981 (18.7%) admission TTEs with a Category I finding, 1711 (32.7%) with a Category II finding and 3806 (72.8%) with a Category III finding. Among patients with no history of heart failure, mechanical cardiac valve or AF (n=4234), there were 3227 admission TTEs with any prespecified abnormality (76.2%), 854 with a Category I abnormality (20.1%), 1062 with a Category II abnormality (25.1%) and 2642 with a Category III abnormality (62.4%).

### Comparison of TTE abnormalities in patients who had a stroke across time

Among patients with TTEs both before and during AIS admission, the proportion of patients with the following abnormalities increased significantly on the subsequent TTE: PFOs (p<0.01), dilated left atria (p<0.01), LV thrombi (p=0.03), LVH (p=0.01), EF ≤15% and <35% (p<0.01 and p<0.01, respectively), Lambl’s excrescence (p<0.01), MAC (p=<0.01), aortic atheroma (p<0.01) and cardiac valvular prostheses (p<0.01) (table 2). Median time from prior TTE to the inpatient TTE was 539 days (IQR: 162–1317). Among those with an inpatient and follow-up TTE, there was an increase in the proportion of patients with: dilated LA (p<0.01), segmental LV wall motion abnormality (p=0.03), MAC (p<0.01), and moderate and severe mitral regurgitation (p<0.01).

Table 2

Findings on TTE during inpatient hospitalisation for ischaemic stroke versus a most recent prior TTE (left) and inpatient TTE versus follow-up TTE (right)

In the subgroup (n=373) with TTEs across all three time points (prior to AIS admission, during the inpatient AIS period and ≥3 months after the admission) (figure 1), higher proportions were noted with dilated LA (p<0.01), EF ≤35% (p<0.01), PFOs (p<0.01), atrial septal aneurysms (p=0.04), MAC (p<0.01), a new prosthetic valve (p<0.01), and moderate and severe mitral regurgitation (p=0.01) over time.

Figure 1

Cardiac abnormalities across serial transthoracic echocardiography (TTE). Percentages of patients with TTE abnormalities prior to ischaemic stroke admission, at the time of admission and after admission. (N=373). *Median time from first to the third TTE: 1094 days (IQR 559–1900). AR, aortic regurgitation; EF, ejection fraction; LV, left ventricular; MR, mitral regurgitation; PFO, patent foramen ovale.

### Multivariable modelling

Table 3

Multivariable logistic regression models predicting an abnormal TTE finding (left), a Category I finding (left-centre), a Category II finding (right-centre) and a Category III finding (right) among those with no prestroke history of heart failure

Among patients with no history of heart failure, mechanical cardiac valve or AF (n=4234), older age, Caucasian race, history of CAD, HTN or DM, and patent head and neck vessels were patient-level risk factors for having any of the prespecified TTE abnormalities (c-statistic 0.68, table 4). Younger, Caucasian patients with no history of HTN, DM, or antiplatelet use, NIHSS <4, infratentorial infarct, and patent head and neck vessels were more likely to have a Category I finding (c-statistic 0.67). A Category II abnormality was associated with patients who were older, had a history of CAD and HTN, a higher NIHSS, a cortical infarct, and patent head and neck vessels (c-statistic 0.72). Older, male patients with a history of CAD, HTN or DM, and higher NIHSS were more likely to have a Category III finding (c-statistic 0.72).

Table 4

Multivariable logistic regression models predicting an abnormal TTE finding (left), a Category I finding (left-centre), a Category II finding (right-centre) and a Category III finding (right) among those with no prestroke history of heart failure, mechanical heart valve or atrial fibrillation (n=4234)

We created a model predicting the odds of a new prespecified TTE finding (n=83) during AIS admission if a prior TTE in our system was unremarkable (n=891) (table 5). Older patients with CAD, PVD, CKD, no history of HLD and no known carotid disease were likely to develop a novel TTE finding at the time of AIS (c-statistic 0.71).

Table 5

Multivariable logistic regression model predicting a new abnormal TTE finding (n=83) in those with a prior normal TTE (n=891)

There were a total of 124 hospitalisations for recurrent stroke, 21 hospitalisations for MI and 28 hospitalisation for heart failure within 1 year of the index AIS hospitalisation. In univariate logistic regression modelling of all patients with AIS, the odds of an incident hospitalisation for recurrent ischaemic stroke within 1 year of discharge from the index AIS hospitalisation was significantly higher among patients with a Category I finding detected by the AIS TTE versus patients without a Category I finding (OR 0.54, 95% CI 0.30 to 0.96, p=0.0347, table 6). There was no significant difference in hospitalisations for MI (OR 1.45, 95% CI 0.53 to 3.97, p=0.4701) or heart failure (OR 1.01, 95% CI 0.38 to 2.65, p=0.9895) by Category I status. The odds of a recurrent stroke hospitalisation within 1 year of AIS were similar by Category II status (OR 0.77, 95% CI 0.51 to 1.16), but the odds of hospitalisation for MI (OR 2.46, 95% CI 1.04 to 5.80) and heart failure (OR 5.62, 95% CI 2.47 to 12.79) within 1 year were significantly higher among patients with Category II findings. There was no association between the odds of hospitalisation for any of the three conditions as a function of Category III status.

Table 6

Odds of hospitalisation for recurrent ischaemic stroke, myocardial infarction and heart failure as a function of TTE finding categories

There was significant net reclassification improvement with the additional input of Category I TTE data to baseline characteristics (net reclassification index 0.1563; 95% CI 0.0465 to 0.2661) for predicting recurrent ischaemic stroke hospitalisation. The addition of Category I TTE data to baseline characteristics compared with the model comprised of baseline characteristics alone resulted in 79% of events being correctly reclassified (p<0.001) and 63% of non-events being reclassified (p<0.001).

## Discussion

Our study assesses TTE findings identified during an AIS hospitalisation. About 19% of studies demonstrated an abnormality associated with a high risk of cardioembolic stroke, 33% with an abnormality warranting cardiac management not specifically related to stroke and 72% with findings with no significant immediate implication but which may prompt further monitoring and long-term risk factor management to prevent a future cerebrovascular or cardiovascular event. Some findings were more frequently observed over time. Patient-level risk factors for an abnormal TTE include age, vascular risk factors, having cortical or infratentorial acute infarcts, and patent head and neck vessels. Only 9% of admission TTEs demonstrated a new abnormal finding compared with a prior TTE study. Older and unhealthier patients with no known carotid disease and a prior normal TTE have higher odds of a new TTE abnormality during AIS admission. Having a TTE finding detected at the time of AIS which has been associated with high stroke risk was associated with a significantly lower rate of ischaemic stroke hospitalisation within 1 year. Conversely, detection of a TTE feature associated with high risk of cardiac events was associated with a significantly elevated odds of hospitalisation for MI and heart failure within 1 year. There was no 1 year risk of stroke or cardiac events associated with TTE findings with no significant immediate clinical implication. Finally, there was significant incremental predictive value of Category I data above baseline demographic and clinical characteristics for 1 year recurrent ischaemic stroke hospitalisation risk. These findings confirm the important role of inpatient TTEs at the time of AIS admission particularly in patients with a high-risk profile to prompt interventions to prevent future cerebrovascular and cardiac events.

Two other studies have evaluated TTE findings in the AIS context. Abreu et al observed that 37% of patients with AIS had TTE findings that would warrant anticoagulation3 while Fralick et al noted that only 14% of TTEs in patients with AIS identified clinically actionable findings for secondary stroke prevention.31 These percentages lie within the range of the prevalences of potential cardioembolic sources identified by TTE in our study. Our study, however, also uniquely describes abnormalities associated with both future neurological and cardiac events. Given the high proportions of AIS TTEs with abnormalities in the three prespecified categories in our study, a TTE during the AIS encounter may be a pivotal screening and diagnostic opportunity to promote brain and heart health. For instance, a new diagnosis of low EF merits may prompt not only anticoagulation for secondary stroke prevention but also cardiology consultation and prescription of evidence-based cardioprotective medications which may not be administered as first-line therapy for routine management by stroke care providers. A concomitant finding of LVH or aortic atheroma may also prompt more aggressive risk factor management to promote the health of both vascular beds. As such, the diagnostic implications from a TTE during an AIS admission may have significant immediate and downstream effects.

Our study uniquely explores TTE findings during AIS hospitalisation and their association with future stroke and cardiovascular events within 1 year of the index AIS. The ascertainment by TTE of findings linked with high stroke risk was associated with significantly lower odds of hospitalisation for ischaemic stroke within a year. The addition of Category I TTE biomarker data significantly improved the predictive capacity for recurrent ischaemic stroke beyond traditional vascular risk factors. These echocardiographic features have been designated as high risk in the stroke literature and there are clear evidence-based secondary stroke prevention treatment algorithms. The identification of any of these stroke risk related TTE abnormalities during AIS admission likely prompted targeted stroke guideline-directed intervention to neutralise effectively the risk of future stroke from that specific source such as treatment of endocarditis with antibiotics or initiation of anticoagulation for an LV thrombus.

Among patients with TTE findings associated with high risk for a cardiac event, there was no increased odds of future stroke events, but there was a two times and five times higher risk of MI and heart failure, respectively. There may be two explanations for this observation. First, the risk of a cardiac event among patients with these TTE findings is elevated by definition and may reflect the natural course of cardiovascular disease. While this may be the case, there were multiple guideline-directed medical therapies available to modify the risk of cardiovascular events during this epoch that may not be in the toolkit of stroke providers. It is possible that under-recognition of the clinical significance of Category II findings may result in underutilisation of guideline-directed medical therapies, rendering the course of their sequela of cardiovascular outcomes unmitigated.

While the rates of recurrent hospitalisation events were low at 3.1%, importantly if considered solely from a payer’s standpoint, the estimated cost of a TTE only (estimated at $634 per study) in patients with a Category I or II abnormality detected during AIS admission in our cohort was$1585 000 while the estimated cost of hospitalisation for all three events within 1 year of the AIS was $2923 564.32 33 In contrast, the estimated total cost of ubiquitously obtaining TTEs in all patients with AIS in our cohort would have been$3501 582. These findings suggest that obtaining TTEs in patients with AIS particularly with a high pretest probability of having a Category I or II finding may be of clinical utility without compromising resource stewardship.

The use of a repeat TTE during AIS admission is often questioned when there is an existing recent TTE available. Our study demonstrates that among patients with a prior normal TTE who are admitted for AIS, nearly 9% have an abnormal finding on the TTE during admission. Predictors of a novel TTE finding include vascular comorbidities and no history of carotid disease. One explanation of this paradoxical finding is that among those with known carotid disease, the causative aetiology may be more likely large artery atherosclerosis rather than cardioembolism from a new cardiac lesion that developed in the interim. While the rareness of a new finding suggests a potentially limited role for a repeat TTE at the time of stroke if a prior TTE study is available and carotid disease is present, further study is needed to validate this observation.

We noted several patterns in our longitudinal analyses. Vascular risk factors were independent predictors of new TTE findings. LA dilation was one of the most common Category III TTE abnormalities and the proportion of patients with LA dilation increased with time. A link between LA dilation prevalence and vascular risk factors has been noted in prior studies.34 35 The observed progression of LA dilation in patients who had an ischaemic stroke is hypothesis-generating in terms of the temporal relationship linking atrial cardiopathy, AF and ischaemic stroke. There was a greater proportion of patients with depressed EF and wall motion abnormality over time, suggesting a need to consider screening high-risk patients to prevent further cardiovascular events. Finally, follow-up TTEs were more likely to detect a new diagnosis of moderate or severe mitral regurgitation. The association between severe mitral regurgitation and mortality if untreated can be up to 50% compared with 14% with valve repair or replacement, highlighting the importance of its timely detection and management.20

There are several limitations of our study. One consideration is the unknown generalisability of our results to patients in other geographical regions. Survival and detection biases are inherent in a retrospective study. We attempted to minimise detection bias by only including patients with TTE available at each of the time points of interest, however this approach can be subject to confounding by indication. The indications for the TTE studies were not precisely known and may explain the higher proportion of patients observed with a PFO during the inpatient AIS admission study compared with a prior TTE due to differences in ascertainment techniques used for specific indications. There is likely variability by sonographers and echocardiographers in the threshold for discerning and reporting a TTE abnormality, depending on indication for the TTE at the time it was ordered. Outcomes were ascertained by administrative billing codes which have variable sensitivity and specificity. There are also presumably unmeasured confounders at the patient level including the prevalence of medical comorbidities at the time of a prior and follow-up TTE. The TTE categories in this study are broad; further investigation is necessary to pinpoint specific TTE findings that can be implicated with outcomes.

## Summary

We observe a high prevalence of prespecified cardiac abnormalities detected by echocardiogram at the time of acute stroke hospitalisation associated with ischaemic stroke and cardiovascular event risk. The proportion of patients who had a stroke with certain abnormalities increases with time. We identify predictors of specific TTE abnormalities at the time of admission and having a new specific TTE abnormality if a prior TTE was normal. Finally, the presence of a high stroke risk TTE abnormality at the time of ischaemic stroke hospitalisation was associated with a significantly reduced odds of recurrent ischaemic stroke upto 1 year after the index ischaemic stroke, while a high cardiac risk TTE abnormality was associated with significantly higher odds of MI and heart failure hospitalisations. The addition of Category I TTE biomarker data significantly improved prediction of recurrent ischaemic stroke risk. These findings demonstrate utility of TTE as a diagnostic test performed during the AIS admission, particularly in patients with a high pretest probability of TTE findings associated with high risk of stroke and cardiac events. Further study is necessary to determine criteria for appropriate utilisation of TTE during AIS hospitalisation to inform our current standard of care.

## Data availability statement

Data are available upon reasonable request. The data that support the findings of this study are available from the corresponding author upon reasonable request by investigators.

## Ethics statements

### Ethics approval

This study involves human participants and was approved by the Massachusetts General Hospital Institutional Review Board. The IRB waived the need to obtain informed consent.

## Acknowledgments

The authors thank the staff who have participated in the development and maintenance of their institutional Get-With-The-Guidelines data repository.


text:
MathSciNet bibliographic data MR1290281 20H10 (22E40 30F35) Gilman, Jane Two-generator discrete subgroups of ${\rm PSL}(2,{\bf R})$${\rm PSL}(2,{\bf R})$. Mem. Amer. Math. Soc. 117 (1995), no. 561, x+204 pp. Article

For users without a MathSciNet license , Relay Station allows linking from MR numbers in online mathematical literature directly to electronic journals and original articles. Subscribers receive the added value of full MathSciNet reviews.

format: plain


text:
# Prove that clique cover is NP Complete

I want to use Vertex Cover as a known $$NP$$-complete Problem for the reduction. The claim is that if a have a vertex cover in graph $$G$$ with size $$\le k$$, I will have a clique cover in $$G^\prime$$ with total number of cliques $$\le k$$

I want to reduce vertex cover problem to clique cover problem in the following way:

1. For each edge in $$G$$, I will create a corresponding vertex in $$G^\prime$$. In the picture, each e$$_i$$ in G corresponds to v$$_i$$ in $$G^\prime$$ for $$1\le i\le5$$

2. Two vertices in $$G^\prime$$ will be connected by an edge if their corresponding two edges in G have one vertex in common. For example, there is an edge between v$$_1$$ to v$$_2$$ as their corresponding edges e$$_1$$ and e$$_2$$ have one vertex in common which is a.

3. Each clique in $$G^\prime$$ corresponds to a vertex in G and that vertex belongs to the vertex cover. For example, for the graph in picture I have vertex cover {a,c}. With vertex a, I get a clique {v$$_1$$, v$$_2$$, v$$_5$$} and with vertex c, I get clique {v$$_3$$, v$$_4$$} in $$G\prime$$.

Now I don't know how to prove No instance in opposite direction: If $$G^\prime$$ doesn't have a clique cover with $$\le k$$ cliques (i.e it needs at least $$k+1$$ cliques), $$G$$ doesn't have a vertex cover size which is $$\le k$$.

Can anybody shed some light on this issue?

• Keep trying. Also, try to refute your claim in parallel. – Yuval Filmus Feb 24 '17 at 3:17


text:
# Arrow's impossibility theorem: Wikis

Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.

# Encyclopedia

In social choice theory, Arrow’s impossibility theorem, or Arrow’s paradox, demonstrates that no voting system can convert the ranked preferences of individuals into a community-wide ranking while also meeting a certain set of criteria with three or more discrete options to choose from. These criteria are called unrestricted domain, non-imposition, non-dictatorship, Pareto efficiency, and independence of irrelevant alternatives. The theorem is often cited in discussions of election theory as it is further interpreted by the Gibbard–Satterthwaite theorem.

In short, no "fair" voting system can satisfy these three criteria:

• If every voter prefers X over Y, then the group prefers X over Y.
• If every voter's preferences between X and Y remain unchanged when Z is added to the slate, then the group's preference between X and Y will also remain unchanged.
• There is no dictator.

The theorem is named after economist Kenneth Arrow, who demonstrated the theorem in his Ph.D. thesis and popularized it in his 1951 book Social Choice and Individual Values. The original paper was titled "A Difficulty in the Concept of Social Welfare".[1] Arrow was a co-recipient of the 1972 Nobel Prize in Economics.

## Statement of the theorem

The need to aggregate preferences occurs in many different disciplines: in welfare economics, where one attempts to find an economic outcome which would be acceptable and stable; in decision theory, where a person has to make a rational choice based on several criteria; and most naturally in voting systems, which are mechanisms for extracting a decision from a multitude of voters' preferences.

The framework for Arrow's theorem assumes that we need to extract a preference order on a given set of options (outcomes). Each individual in the society (or equivalently, each decision criterion) gives a particular order of preferences on the set of outcomes. We are searching for a preferential voting system, called a social welfare function, which transforms the set of preferences into a single global societal preference order. The theorem considers the following properties, assumed to be reasonable requirements of a fair voting method:

Non-dictatorship
The social welfare function should account for the wishes of multiple voters. It cannot simply mimic the preferences of a single voter.
Unrestricted domain
(or universality) The social welfare function should account for all preferences among all voters to yield a unique and complete ranking of societal choices. Thus:
• The voting mechanism must account for all individual preferences.
• It must do so in a manner that results in a complete ranking of preferences for society.
• It must deterministically provide the same ranking each time voters' preferences are presented the same way.
Independence of irrelevant alternatives (IIA)
The social welfare function should provide the same ranking of preferences among a subset of options as it would for a complete set of options. Changes in individuals' rankings of irrelevant alternatives (ones outside the subset) should have no impact on the societal ranking of the relevant subset.
Positive association of social and individual values
(or monotonicity) If any individual modifies his or her preference order by promoting a certain option, then the societal preference order should respond only by promoting that same option or not changing, never by placing it lower than before. An individual should not be able to hurt an option by ranking it higher.
Non-imposition
(or citizen sovereignty) Every possible societal preference order should be achievable by some set of individual preference orders. This means that the social welfare function is surjective: It has an unrestricted target space.

Arrow's theorem says that if the decision-making body has at least two members and at least three options to decide among, then it is impossible to design a social welfare function that satisfies all these conditions at once.

A later (1963) version of Arrow's theorem can be obtained by replacing the monotonicity and non-imposition criteria with:

• Pareto efficiency: if every individual prefers a certain option to another, then so must the resulting societal preference order. This, again, is a demand that the social welfare function will be minimally sensitive to the preference profile.

The later version of this theorem is stronger—has weaker conditions—since monotonicity, non-imposition, and independence of irrelevant alternatives together imply Pareto efficiency, whereas Pareto efficiency, non-imposition, and independence of irrelevant alternatives together do not imply monotonicity.

## Formal statement of the theorem

Let A be a set of outcomes, N a number of voters or decision criteria. We shall denote the set of all full linear orderings of A by L(A).

A (strict) social welfare function is a function $F : \mathrm{L(A)}^N \to \mathrm{L(A)}$ which aggregates voters' preferences into a single preference order on A. The N-tuple $(R_1, \ldots, R_N)$ of voter's preferences is called a preference profile. In its strongest and most simple form, Arrow's impossibility theorem states that whenever the set A of possible alternatives has more than 2 elements, then the following three conditions become incompatible:

unanimity, or Pareto efficiency
If alternative a is ranked above b for all orderings $R_1 , \ldots, R_N$ , then a is ranked higher than b by $F(R_1, R_2, \ldots, R_N)$. (Note that unanimity implies non-imposition).
non-dictatorship
There is no individual i whose preferences always prevail. That is, there is no $i \in \{1, \ldots,N\}$ such that $\forall (R_1, \ldots, R_N) \in \mathrm{L(A)}^N, \quad F(R_1,R_2, \ldots, R_N) = R_i$.
independence of irrelevant alternatives
For two preference profiles $(R_1, \ldots, R_N)$ and $(S_1, \ldots, S_N)$ such that for all individuals i, alternatives a and b have the same order in Ri as in Si, alternatives a and b have the same order in $F(R_1,R_2, \ldots, R_N)$ as in $F(S_1,S_2, \ldots, S_N)$.

## Informal proof

Based on the proof by John Geanakoplos of Cowles Foundation, Yale University.[2]

We wish to prove that any social choice system respecting unrestricted domain, unanimity, and independence of irrelevant alternatives (IIA) is a dictatorship.

### Part one: there is a "pivotal" voter for B

Say there are three choices for society, call them A, B, and C. Suppose first that everyone prefers option B the least. That is, everyone prefers every other option to B. By unanimity, society must prefer every option to B. Specifically, society prefers A and C to B. Call this situation Profile 1.

On the other hand, if everyone preferred B to everything else, then society would have to prefer B to everything else by unanimity. So it is clear that, if we take Profile 1 and, running through the members in the society in some arbitrary but specific order, move B from the bottom of each person's preference list to the top, there must be some point at which B moves off the bottom of society's preferences as well, since we know it eventually ends up at the top.

We now want to show that, during this process, at the point when the pivotal voter n moves B off the bottom of his preferences to the top, the society's B moves to the top of its preferences as well, not to an intermediate point.

To prove this, consider what would happen if it were not true. Then, after n has moved B to the top (i.e., when voters $\{1,\dots,n\}$ have B at the top and voters $\{n+1,\dots,\}$ still have B at the bottom) society would have some option it prefers to B, say A, and one less preferable than B, say C. (If otherwise, just swap A's and C's names).

Now if each person moves his preference for C above A, then society would prefer C to A by unanimity. By the fact that A is already preferred to B, C would now be preferred to B as well in the social preference ranking. But moving C above A should not change anything about how B and C compare, by independence of irrelevant alternatives. That is, since B is either at the very top or bottom of each person's preferences, moving C or A around does not change how either compares with B. We have reached an absurd conclusion.

Therefore, when the voters $\{1,\dots,n\}$ have moved B from the bottom of their preferences to the top, society moves B from the bottom all the way to the top, not some intermediate point.

### Part two: voter n is a dictator for A–C

In the second part of the proof, we show how voter n can be a dictator over society's decision between A and C. Call the case with all voters up to (not including) n having B at the top of their preferences and the rest (including n) with B at the bottom Profile 2. Call the case with all voters up through (and including) n having B at the top and the rest having B at the bottom Profile 3.

Now suppose everyone up to n ranks B at the top, n ranks B below A but above C, and everyone else ranks B at the bottom. As far as the A–B decision is concerned, this organization is just as in Profile 2, which we proved puts B below A (in Profile 2, B is actually at the bottom of the social ordering). C's new position is irrelevant to the B–A ordering for society because of IIA. Likewise, n's new ordering has a relationship between B and C that is just as in Profile 3, which we proved has B above C (B is actually at the top). Hence we know society puts A above B above C. And if person n flipped A and C, society would have to flip its preferences by the same argument. Hence person n gets to be a dictator over society's decision between A and C.

Since B is irrelevant (IIA) to the decision between A and C, the fact that we assumed particular profiles that put B in particular places does not matter. This was just a way of finding out, by example, who the dictator over A and C was. But all we need to know is that he exists.

### Part three: there can be at most one dictator

Finally, we want to show that the dictator can also dictate over the A–B pair and over the C–B pair. Consider that we have proven that there are dictators over the A–B, B–C, and A–C pairs, but they are not necessarily the same dictator. However, if you take the two dictators who can dictate over A–B and B–C, for example, they together can determine the A–C outcome, contradicting the idea that there is some third dictator who can dictate over the A–C pair. Hence the existence of these dictators is enough to prove that they are the same person, otherwise they would be able to overrule one another, a contradiction.

## Interpretations of the theorem

Arrow's theorem is a mathematical result, but it is often expressed in a non-mathematical way with a statement such as "No voting method is fair", "Every ranked voting method is flawed", or "The only voting method that isn't flawed is a dictatorship". These statements are simplifications of Arrow's result which are not universally considered to be true. What Arrow's theorem does state is that a voting mechanism cannot comply with all of the conditions given above simultaneously for all possible preference orders.

Arrow did use the term "fair" to refer to his criteria. Indeed, Pareto efficiency, as well as the demand for non-imposition, seems trivial. Various theorists have suggested weakening the IIA criterion as a way out of the paradox. Proponents of ranked voting methods contend that the IIA is an unreasonably strong criterion, which actually does not hold in most real-life situations. Indeed, the IIA criterion is the one breached in most useful voting systems.

Advocates of this position point out that failure of the standard IIA criterion is trivially implied by the possibility of cyclic preferences. If voters cast ballots as follows:

• 7 votes for A > B > C
• 6 votes for B > C > A
• 5 votes for C > A > B

then the net preference of the group is that A wins over B, B wins over C, and C wins over A: these yield rock-paper-scissors preferences for any pairwise comparison. In this circumstance, any system that picks a unique winner, and satisfies the very basic majoritarian rule that a candidate who receives a majority of all first-choice votes must win the election, will fail the IIA criterion. Without loss of generality, consider that if a system currently picks A, and B drops out of the race (as e.g. in a two-round system), the remaining votes will be:

• 7 votes for A > C
• 11 votes for C > A

Thus, C will win, even though the change (B dropping out) concerned an "irrelevant" alternative candidate who did not win in the original circumstance.

So, what Arrow's theorem really shows is that voting is a non-trivial game, and that game theory should be used to predict the outcome of most voting mechanisms. This could be seen as a discouraging result, because a game need not have efficient equilibria, e.g., a ballot could result in an alternative nobody really wanted in the first place, yet everybody voted for.

Note, however, that not all voting systems require (or even allow), as input, a strict ordering of all candidates. These systems may then trivially fail the universality criterion. Some systems may satisfy a version of Arrow's theorem with some reformulation of universality and independence of irrelevant alternatives; Warren Smith claims that range voting is such a system.

## Other possibilities

The preceding discussion assumes that the "correct" way to deal with Arrow's paradox is to eliminate (or weaken) one of the criteria. The IIA criterion is the most natural candidate. Yet there are other "ways out".

Duncan Black has shown that if there is only one agenda by which the preferences are judged, then all of Arrow's axioms are met by the majority rule. Formally, this means that if we properly restrict the domain of the social welfare function, then all is well. Black's restriction, the "single-peaked preference" principle, states that there is some predetermined linear ordering P of the alternative set. Every voter has some special place he likes best along that line, and his dislike for an alternative grows larger as the alternative goes further away from that spot. For example, if voters were voting on where to set the volume for music, it would be reasonable to assume that each voter had their own ideal volume preference and that as the volume got progressively too loud or too quiet they would be increasingly dissatisfied. In such a restricted case, Arrow's theorem does not apply: in particular, it lacks an unrestricted domain.

Indeed, many different social welfare functions can meet Arrow's conditions under such restrictions of the domain. It has been proved, however, that under any such restriction, if there exists any social welfare function that adheres to Arrow's criteria, then the majority rule will adhere to Arrow's criteria.[3] Under single-peaked preferences, then, the majority rule is in some respects the most natural voting mechanism.

Another common way "around" the paradox is limiting the alternative set to two alternatives. Thus, whenever more than two alternatives should be put to the test, it seems very tempting to use a mechanism that pairs them and votes by pairs. As tempting as this mechanism seems at first glance, it is generally far from meeting even the Pareto principle, not to mention IIA. The specific order by which the pairs are decided strongly influences the outcome. This is not necessarily a bad feature of the mechanism. Many sports use the tournament mechanism—essentially a pairing mechanism—to choose a winner. This gives considerable opportunity for weaker teams to win, thus adding interest and tension throughout the tournament. In effect, the mechanism by which the choices are limited to two candidates is best considered as a part of the balloting system, and hence Arrow's theorem applies.

There has developed an entire literature following from Arrow's original work which finds other impossibilities as well as some possibility results. For example, if we weaken the requirement that the social choice rule must create a social preference ordering which satisfies transitivity and instead only require acyclicity (if a is preferred to b, and b is preferred to c, then it is not the case that c is preferred to a) there do exist social choice rules which satisfy Arrow's requirements.

Economist and Nobel prize winner Amartya Sen has suggested at least two other alternatives[4]. He has offered both relaxation of transitivity and removal of the Pareto principle. He has shown the existence of voting mechanisms which comply with all of Arrow's criteria, but supply only semi-transitive results.

Also, he has demonstrated another interesting impossibility result, known as the "impossibility of the Paretian Liberal". (See liberal paradox for details). Sen went on to argue that this demonstrates the futility of demanding Pareto optimality in relation to voting mechanisms.

Advocates of approval voting consider unrestricted domain to be the best criterion to weaken. In approval voting, voters can only vote 'for' or 'against' each candidate, preventing them from making distinctions between their favored candidates and merely acceptable ones.

Advocates of range voting also consider unrestricted domain to be the best criterion to violate—but instead of limiting voter options like approval voting, range voting increases the number of voter options beyond what Arrow's Theorem allows.

## Scalar rankings from a vector of attributes and the IIA property

The IIA property might not be satisfied in human decision-making of realistic complexity because the scalar preference ranking is effectively derived from the weighting—not usually explicit—of a vector of attributes (one book dealing with the Arrow theorem invites the reader to consider the related problem of creating a scalar measure for the track and field decathlon event—e.g. how does one make scoring 600 points in the discus event "commensurable" with scoring 600 points in the 1500 m race) and this scalar ranking can depend sensitively on the weighting of different attributes, with the tacit weighting itself affected by the context and contrast created by apparently "irrelevant" choices. Edward MacNeal discusses this sensitivity problem with respect to the ranking of "most livable city" in the chapter "Surveys" of his book MathSemantics: making numbers talk sense (1994).

## Notes

1. ^ Arrow, K.J., "A Difficulty in the Concept of Social Welfare", Journal of Political Economy 58(4) (August, 1950), pp. 328–346.
2. ^ Three Brief Proofs of Arrow’s Impossibility Theorem
3. ^ Campbell, D.E., Kelly, J.S., "A simple characterization of majority rule", Economic Theory 15 (2000), pp. 689–700.
4. ^ Sen, Amartya. 1979. Personal Utilities and Public Judgements: Or What's Wrong With Welfare Economics. The Economic Journal, 89, 537-588.

## References

• The Mathematics of Behavior by Earl Hunt, Cambridge University Press, 2007. The chapter "Defining Rationality: Personal and Group Decision Making" has a detailed discussion of the Arrow Theorem, with proof. URL to CUP information on this book
• Why flip a coin? : the art and science of good decisions by Harold W. Lewis, John Wiley, 1997. Gives explicit examples of preference rankings and apparently anomalous results under different voting systems. States but does not prove Arrow's theorem. ISBN 0-471-29645-7
• Sen, A. K. (1979) “Personal utilities and public judgements: or what's wrong with welfare economics?” The Economic Journal, 89, 537-558, arguing that Arrow's theorem was wrong because it did not incorporate non-utility information and the utility information it did allow was impoverished


text:
Submodules of direct sums of simple modules

I'm reading these online notes on representation theory, and I don't fully understand this:

Isn't $V\oplus(\bigoplus_{i\in I}S_i)$ a direct sum by definition, so we'd get $I=\{1,\cdots,n\}$? Can we assume the $S_i$ are pairwise disjoint submodules of $U$ based on how the lemma is phrased (or does that follow necessarily from them each being simple)? Intuitively, I feel the condition should be that $W$ as an external direct sum maps into the internal direct sum situated within $U$ in an obvious way, and we choose $I$ maximal so that this map has no kernel. Is this understanding correct?

-
I don't understand your first question in the last parraph above: I is maximal wrt that sum being direct, but somehow you seem to think that the sum of the n submodules $\,S_i\,$ is direct, which is wrong. And no, why could we assume the $\,S_i\,$ have trivial intersection (of course, they can't be disjoint). What they do is to take sum of $\,S_i'\,$s that (1) is direct, but also (2) the sum with $\,V\,T is direct. – DonAntonio Aug 5 '12 at 17:15 Take for example,$S_i$be the subspace spanned by the vector$(1,i)$, for each$i\in\{1,\dots,1000\}$, which are simple$\mathbb R$-submodules of$U=\mathbb R^2$whose sum is$U$. In particular, notice that in this example the subset$I$you can take depends on$V$. – Mariano Suárez-Alvarez Aug 5 '12 at 17:17 @DonAntonio Doesn't the$\oplus$symbol by definition mean "direct sum"? (And yes I meant trivial intersection.) Should I understand$W=V+S_{i_1}+\cdots+S_{i_k}$, and we take$I$maximal so that each of$V,S_{i_1},\cdots,S_{i_k}$has pairwise trivial intersection (which I am guessing is the definition of "direct")? – blue Aug 5 '12 at 17:24 Do not guess the definition of direct sum (you guessed it wrong!): look it up. – Mariano Suárez-Alvarez Aug 5 '12 at 22:27 @seaturtles, Mariano already told you should do, in particular when we deal with such a standard and basic definition. just one note more: no, that the sum$\,V+S_{i_1}+...+S_{i_k}\,$is direct does not mean "each of these has pairwise trivial intersection". The condition is way more interesting and involved when there are three or more summands. – DonAntonio Aug 6 '12 at 2:05 1 Answer Your notes have a typo: the proof should begin "Choose a subset$I$maximal subject to the condition that$V + \sum S_i$is a direct sum." Of course, as you've noted,$V\oplus \bigoplus S_I$is a direct sum by definition-but it might be considerably bigger than$U$, as Mariano's example shows. We can assume that the$S_i$'s pairwise intersections are either$0$or an$S_i.$If the latter case happens,$S_i \cap S_j=S_i,$we know$S_i=S_j$, since otherwise$S_i$would be a proper submodule of$S_j.$Regarding your comments, the definition of direct is not that the summands have pairwise trivial intersections, but that each element of the sum can be written uniquely in terms of the summands. So$(e_1) + (e_2)=(e_1) \oplus (e_2)=V$in some 2-dimensional vector space$V$, but$(e_1)+(e_2)+(e_1+e_2)=V$while$(e_1)\oplus (e_2)\oplus (e_1+e_2)$is three-dimensional and not in$V\$ at all. Note, though, that these three modules have trivial intersection. On the other hand, if a sum is direct, this does imply the summands have trivial intersection: otherwise anything in any intersection can be written in at least two ways. It's just that these properties aren't equivalent.

-
Thanks. I believe I understand what's going on after thinking about DonAntonio's comment and reading your answer. Just to clarify though, a sum of submodules is direct precisely when the summands have pairwise trivial intersection, right? –  blue Aug 5 '12 at 17:37
Not quite-see my new paragraph. –  Kevin Carlson Aug 5 '12 at 17:40
I see. Uniquely writeable does imply pairwise trivial intersection (seen via contraposition), but the converse is not true. –  blue Aug 5 '12 at 17:45


text:
# Generalization bound (single hypothesis) in "Foundations of Machine Learning"

I have a question about Corollary $$2.2$$: Generalization bound--single hypothesis in the book "Foundations of Machine Learning" Mohri et al. $$2012$$.

Equation $$2.17$$ seems to only hold when $$\hat{R}_S(h) in equation $$2.16$$ because of the absolute operator. Why is this not written in the corollary? Am I missing something important?

Thank you very much for reading this question.

You are right. The relaxed inequality $$R(h) \le \hat{R}_S(h)+ \epsilon.$$ can be replaced with the complete inequality $$\left |\hat{R}_S(h) - R(h) \right| \le \epsilon.$$ Actually, authors use this complete inequality for the follow up examples in the book. Again in Theorem $$2.13$$, they write the relaxed inequality, but prove for the complete inequality.
Let us denote: $$A:=\hat{R}_S(h) - R(h) \le \epsilon$$ $$B:=\hat{R}_S(h) - R(h) \ge -\epsilon$$ thus, $$\left| \hat{R}_S(h) - R(h) \right| \le \epsilon = A \text{ and } B$$ Equation $$(2.16)$$ states: \begin{align*} & {\Bbb P}(\left| \hat{R}_S(h) - R(h) \right| \ge \epsilon) \le \delta \\ & \Rightarrow {\Bbb P}(\left| \hat{R}_S(h) - R(h) \right| \le \epsilon) \ge 1 - \delta \\ & \Rightarrow {\Bbb P}(A \text{ and } B) \ge 1 - \delta \\ \end{align*} knowing that $${\Bbb P}(B) \ge {\Bbb P}(A \text{ and } B)$$, \begin{align*} & {\Bbb P}(B) \ge {\Bbb P}(A \text{ and } B) \ge 1 - \delta \\ & \Rightarrow {\Bbb P}(\hat{R}_S(h) - R(h) \ge -\epsilon) \ge 1 - \delta \end{align*} which is equivalent to $$R(h) \le \hat{R}_S(h) + \epsilon$$ with probability at least $$1-\delta$$, i.e. equation $$(2.17)$$.


text:
Asking for hints to Goldstein chapter 7, problem 9

1. Jan 31, 2012

qinglong.1397

1. The problem statement, all variables and given/known data

A generalized potential suitable for use in a covariant Lagrangian for a single particle

$U=-A_{\lambda\nu}(x_\mu)u^\lambda u^\nu$

where $A_{\lambda\nu}$ stands for a symmetric world tensor of the second rank and $u^\nu$ are the components of the world velocity. If the Lagrangian is made up of $\frac{1}{2}mu_\nu u^\nu$ minus U, obtain the Lagrange equations of motion. What is the Minkowski force? Give the components of the force as observed in some Lorentz frame.

2. Relevant equations

I've got the Lagrange equations:

$m\frac{d u_\nu}{d \tau}+2A_{\lambda\nu}\frac{d u^\lambda}{d \tau}+2\frac{\partial A_{\lambda\nu}}{\partial x^\rho}u^\lambda u^\rho-\frac{\partial A_{\lambda\rho}}{\partial x^\nu}u^\lambda u^\rho =0$

3. The attempt at a solution

Now, the problem is following. The 4-acceleration appears twice in the Lagrange equations. So which one represents the Minkowski force?

I think the first term definitely represents one component of the Minkowski force. If you rewrite the second term in the following form,

$2A_{\lambda\nu}\frac{d u^\lambda}{d \tau}=2\frac{A_{\lambda\nu}}{m}(m\frac{d u^\lambda}{d \tau})$

then you find the Minkowski force. Then what we have to do is to solve a set of linear equations, which is hopeless at least at the first sight.

So which should be the force? Just the first term? Or, try to solve the set of linear equations? And how to solve it? I need your help. Thank you!

2. Nov 13, 2016

QFT25

I'm also in the same situation and would like some points on where to proceed once I have Lagrange's equation's of motion. Can Minkowski force be just the mass times the four velocity? Also to find the force in a Lorenz frame, that refers to just the spacial component of the Minkowski force right?

3. Nov 13, 2016

QFT25

Can this be moved to the homework help section?


text:
## Rise of the Machines?: From the Inaugural "Uncharted"

Berkeley Uncharted

Lance Knobel: So, Brad, one of your areas is economic history. I am curious: as we face this increasing automation, robotization, is this something that’s likely to be something we have seen before in economic history or is this time going to be different?

Brad DeLong: Well, it is always going to be different, because history does not repeat itself--although it does rhyme. The question is: how is it going to be different?

Looking back at all the major transformations in history before--as we have seen entire categories of things we do to add value to our society vanish--we always found new valued things for people to do. Technological unemployment has been a yearly thing, a decade thing, a generational thing perhaps--but never before more than a generational thing.

At times, the consequences of change have been horrible for the standard of living of the average guy. Jared Diamond has a nice line about how the invention of agriculture was the greatest mistake in the history of the human race. Iit allowed us to support 100 times more people on the planet than we could by hunting and gathering, yes. But the average life of an agriculturalist, staring at the hind end of an ox for eight hours a day--if they are lucky, and pulling the plough themselves if they are not--is not a very rewarding use of the incredibly flexible cognitive instrument that is the human brain.Yet that’s what most people wound up doing for most of the time between 5000 BC and 1700 or so.

Moreover, there is the fact that your average hunter-gatherer back in the Neolithic was 5’8" or so for adult males, and your average agricultural peasant in China or in Europe or even in America was 5’2". I don’t know about you, but if I fed my children a diet that would make them 5’2 at adulthood, Alameda County Child Protective Services would come and take my children away and I would never see them again.

The fear that this time may be very different arises because in the past the human brain has been a uniquely effective control and guidance mechanism for all kinds of things. The ear, eye, brain, hand, voice loop is something hitherto unmatched. Plus: the human smile and touch and glance is an extraordinarily effective social mobilization device for getting people to pull more or less in the same direction.

We are looking forward into the future in which people are going to find ways to make machines do huge amounts of tasks that have been reserved for the human ear-eye-brain-hand-voice loop in the past. I don’t know about your children, but I look at mine watching anime with the big googly eyes, and I wonder how long the human smile and glance is going to have its favored place as well...

Brad DeLong: When I listen to Josh Bloom I think: how rarified is the air we breathe here! What we regard as a task that ought to be too boring to force graduate students to do--that is, looking at pictures of pieces of the sky looking for something weird--is itself much more interesting and much more a fair and effective and proper use of the human cognitive super computer than 90% of what actual white collar workers do out there in the world today. 9-to-5.

It’s a much more interesting task than, say, deciding whether applicant X qualifies for Medicaid, or whether applicant Y has properly managed to fill in the names of the family's dependents in the right spaces. And then thee are the tasks that we have already seen vanish--40 years ago we had half a million women at telephone switchboards plugging cables into receptacles in order to make switches and connections. That was a huge part of what people did. We are going to manage to eliminate all of that, and most of that will be extremely good to be gone--as long as we can find ways of getting the people who would have done that their incomes, and finding other things to do so that they feel useful and wanted and productive, and not like parasitic members of the moocher class...

Brad DeLong: And there is the question of how much of this gets into our national accounts. One example: back in the 1980s I was incredibly pleased to have the opportunity to purchase an Encyclopedia Britannica for only $1000. We gave it away the last time we moved, because no one had looked at it in years. Wikipedia was simply so much easier and so much better. To think that I was willing to pay$1000 for an Encyclopedia Britannica, and now we have universal scale by every household to Wikipedia--scale that up and you’ve got $100 billion of extra wealth for the United States alone. That’s not quite the right calculation to do. But it is the same order of magnitude. And none of that$100 billion of wealth shows up in the National Income and Product Accounts anywhere...

Lance Knobel: But at the same time we have had this wealth [inaudible] the internet has created enormous wealth, created industries, seized all sorts of opportunities, the transition from Encyclopedia Britannica to Wikipedia. We have had increasing incoming quality and we have had a [inaudible] out of the middle class. So is this technologically driven, Brad, or are there other factors in this policy issue? Where do we stand on that [crosstalk] to continue that trend?

Brad DeLong: Well, at the moment I am going to take refuge with Emmanuel Saez six doors down the hall on the sixth floor of Evans Hall. I will say that as of now rising inequality has been a policy choice. Over the past generation we have seen rising inequality in English-speaking countries--in Anglo-Saxon countries. We have not seen it in non-English speaking North Atlantic economies. It is not even a Germanic language thing: it is the Anglo-Saxons who have seen greatly rising inequality over the past generations, while the Saxon-Saxons have not, and the Nordics have actually seen increasing equality over the past generation.

Male Speaker: And the Gauls?

Brad DeLong: And the Gauls are still doing fine with their 1000 kinds of cheese. It is remarkable.

But at some point at least the pressures making for rising inequality will become technological. Rather, technology will pose us problems of income distribution and social worth to solve. It’s just they haven’t shown up yet on a scale large enough to see in Emmanuel Saez's cross-era cross-country graphs...

Brad DeLong: Let me endorse that. Our current patent system was state-of-the-art, forward-looking social engineering back in 1787 when we put in the constitution. It was then a sign of how progressive we are. But by now our intellectual-property system is well past its sell-by date.

I think just made a decision. Let me make an announcement: Everyone taking Econ 2, Principles of Economics, next semester, listen up: if you take the class from me you are going to have to learn to do your problem sets in Python, so get ready...

Lance Knobel: I think there are so many different things that are potentially areas of questioning. But I want to ask one thing, Brad if you acquire Python for your economic students and you told Josh about to teach Python and it’s important for scientists and all that, do both of you have any [inaudible] or the rising generation of students, if they don’t code they are going to be excluded from a productive economic life? Is that going to be essential, or is this just for a technocratic slither of the economy?

Brad DeLong: Well, it would certainly give them some extra options that might not have otherwise. It’s actually unclear to me what people will be programming come 20 years from now. I tried to map what my daughter is learning in her introductory programming classes onto my brain--which I hate to confess is basically still a Fortran brain, that whenever I write something I say "how I can do this in Fortran?" And then when I show my code to the trained professionals, they cry. But we try. And certainly one thing a university exists to do is to give as many people as possible as many mental tools as possible. There are enormous amounts of mental tools, and they are useful in all kinds of places.

I know one person on Wall Street who says that the best thing for him in his entire education--after he learned enough math to be able to fake it while talking to his quant--was his history classes, with their focus on source criticism: why is X writing this in year Y to say Z? What purpose are they trying to achieve? And what does that tell us about how far we should trust them? He said that, for life in Manhattan these days, that’s the most important skill you can possibly learn...

Lance Knobel: We have a roaming mic. Why don’t we start right here.

Greg: Thank you. My name is Greg, I am 45 so I am old enough to be wired, but also able to disconnect myself--I think. Something that Brad touched on at the opening comments grabbed me. Certain things I am hearing now that they are finding that children as old as 10 or in that area, they are seeing that they are less able to interpret facial expressions and communicate in that way because of this world we live in where we are facing down looking at our smart phone, or whatever.

As that relates to not only human contact and emotional well being et cetera. There is even things about how when we make eye contact with people--even with our dog, that we are actually generating vitamin B [inaudible]. So as we move forward, this robotization of our world and interaction and the lack of need to exchange information and that’s both subconscious and conscious and all that, I wonder what your thoughts are about evolving. It’s a physical phenomenon, it’s an emotional phenomenon and it’s a cultural phenomenon.

Brad DeLong: Though I suppose one way to approach that question is to ask: Is the singularity in our future or in our past? And: Is it scary? Our lives are already so different from those of our hunter-gatherer environment of evolutionary adaptation. I am reminded of Isaac Asimiov's novels--The Caves of Steel and the Naked Sun--about his robot detective and his human partner, trying to deal with societies that had become so wired and so isolated that individual members could barely stand to be in the same room with each other, and found it completely gross and disturbing to actually have another human body within 10 feet of them.

These are books by a New Yorker of the 1950s, who feels that he is a bit too focused on technology and chemistry and atoms and so forth, and trying to write about this as metaphor. He is worried that that’s a place where we are heading. And he worries that he is already somewhat less human. On the other hand, I try to think back to what the lives of my ancestors 20,000 years ago were like--let alone the lives of my ancestors 80,000 years ago before the leap that was modern speech as we know it.

I think they probably spent a huge amount of time being hungry. I think they turned all of their processing power to trying to figure out the exact emotional state of everyone else of the 50 people they knew at any point in time. I think they were also trying to watch out for dangers, and for possible food sources. That is the natural life. And in some ways, we are still pretty close to it. Look at daytime TV. Look at the magazines in the checkout line at the supermarket. It’s pretty clear that at some fairly deep level we are still wired to focus on three and only three things:

• Possible dangers of violent death. especially as it affects children.
• Sources of food or perhaps of other valuable and especially rare. resources.
• Who is sleeping with whom--so you don’t get a black eye by making a bad mistake...

Brad DeLong: Well, why doesn’t it already know that when I am dictating I am like 10 billion times more likely to say the name of the Swedish economist "Knut Wicksell", than to say the phrase "nut whistle"? You’d think this would be easy...

Lance Knobel: Okay. We have time--I’m sorry--for just one more quick question. Let’s go in the middle there.

Male Speaker: Brad, you flirted with this question a couple of times during the panel. So if robots are going to take over a bunch of [0:31:04] [inaudible] work, there is a question how do we figure out how to pay the people who no longer have work. Would you be willing to hypothesis, do you have an answer that question?

Brad DeLong: Well, as I say so far, we have been very lucky that so far we have been granting people their social worth and also granting people their control over material resources depending on what they have been able to concretely add to our collective store of value--what they are able to make. And of course, we also have been assigning people their social worth and their control over resources by what they are able to convince us they out to be able to grab from the common store. Because by now an overwhelming proportion of all of our wealth is our common joint product rather than our individual product.

After all, put any of us naked out in the Sierra Nevada--even during the rainy season--and our chances of even surviving to make it out of the Sierra Nevada are pretty small. Practically all of what we do is a joint product. So far our system of resource and statu allocation worked extremely roughly. But it has been semi-tolerable. At least around here most people get enough to eat. You scratch your head on how it is that Mr. Fitzwilliam Darcy is able to consume £10,000/year of stuff, given that he appears to have no social utility at all--except to be occasionally witty but mostly cruel. And yet somehow he has convinced people that this amount of the common store out to be his.

We are moving forward into a world in which we are going to have to figure out a better way to share out of the common store. We won’t be able to rely on people’s ability to do something actually concretely physically useful in order to get control over the material resources and also to get the validation of self-worth we seem to need to make the system tolerable.

My friend and coauthor Larry Summers touched on this a year and a bit ago when he was here giving the Wildavski lecture. He was talking about the extraordinary decline in American labor force participation even among prime-aged males--that a surprisingly large chunk of our male population is now in the position where there is nothing that people can think of for them to do that is useful enough to cover the costs of making sure that they actually do it correctly, and don’t break the stuff and subtract value when they are supposed to be adding to it.

That is a problem that human societies have never faced before. Larry thinks it may be that we are starting to see the thin edge of the technological wedge in male labor force participation trends over the last 30 years--which I point out is not matched at all by female labor force participation trends. Women were even very briefly at a premium on the job market in the last recession--even given the extraordinary extra share of childcare and household production labor that they do.

It’s plain that the next time there is a recession, there will be more females than males working outside the home again. It's a worry. It’s a scary worry for our grandsons and great-grandsons, and perhaps for our great-great-great-granddaughers as well...


text:
Tag Info

0

So we want to show that if $A-\lambda I$ is not invertible, then $\lambda\geq0$. There are three ways in which $A_\lambda I$ may fail to be invertible: $\ker(A-\lambda I)\ne\{0\}$. In this case $\lambda$ is an eigenvalue. So there exists a unit vetor $v\in H$ with $Av=\lambda v$. Then $$\lambda=\langle\lambda v,v\rangle=\langle Av,v\rangle\geq0.$$ ...

0

It's an easy thing to show that $\sigma(T) \subseteq \{ \lambda : |\lambda| \le \|T\| \}$ because the following inverse series converges in operator norm for $\|T\| < |\lambda|$ \begin{align} (T-\lambda I)^{-1} &= \frac{1}{\lambda}(\frac{1}{\lambda}T-I)^{-1} \\ & = -\frac{1}{\lambda}(I-\frac{1}{\lambda}T)^{-1} \\ ...

3

Suppose $T$ is a bounded operator on a Banach space $X$. $\lambda\in\rho(T)$ iff $T-\lambda I$ is a linear bijection. In that case, the inverse $(T-\lambda I)^{-1}$ is automatically continuous by the closed graph theorem. There are three basic things that can stand in the way of $T-\lambda I$ being invertible. $T-\lambda I$ is not injective. Equivalently, ...

1

For $T$ to have $\lambda$ as an eigenvalue, $T-\lambda I$ must be non-injective. For $\lambda$ to be in the spectrum of $T$, it must only be non-invertible. These are equivalent when $T$ is an operator on a finite-dimensional space, but not in general! For example, let $T$ be the shift operator $(x_0,x_1,\dots) \mapsto (0,x_0,x_1,\dots)$ on your favorite ...

2

Some important tricks/theorems: The spectrum is non-empty for Banach algebras (over $\mathbb{C}$) The spectral radius formula $$r(a) = \lim \|a^n\|^{1/n}$$ tells you that if $a$ is nilpotent, then $\sigma(a) = \{0\}$ If $A$ is commutative, then $$\sigma(a) = \{\tau(a) : \tau \in \Omega(A)\}$$ where $\Omega(A)$ denotes the set of non-zero multiplicative ...

2

Actually convolution with $k$ defines a bounded operator on $L^2(G)$ if and only if $\hat k$ is bounded. In this case the spectrum is exactly the essential range of $\hat k$. In fact if $m$ is any bounded measurable function on $\hat G$ then $m$ defines a bounded operator on $L^2(G)$ by $$\widehat{Tf}=m\hat f,$$whether or not there exists $k$ with $m=\hat ... 0 Here is an alternative proof of the fact that$r(T)=0$( I add it because it does not seem to appear in the related posts and I find it quite nice). First show by induction that$|A^n x(t)|\leq \frac{t^n}{n!}\|x\|_\infty$for all$t\in[0,1]$: Basis$n=0$:$|x(t)|\leq \|x\|_\infty$for all$t\in[0,1]$by definition of the supremum norm. Inductive step: For ... 2 We will show that$\sigma(A) = \{0\}$, and that$0$belongs to the residual spectrum. As you have shown,$0$is not an eigenvalue, and as$\operatorname{im} A \subseteq \{x \in C[0,1]: x(0) = 0\}$,$A$does not have dense image. Hence$0 \in \sigma_r(A)$. To see that$A - \lambda$is invertible for$\lambda \ne 0$, let$y \in C[0,1]$be given. We have to ... 0 The operator$T$satisfies $$\|Tx\| \le \frac{1}{2}\|x\|, \\ \|T^2x\| \le \frac{1}{2\cdot 3}\|x\|, \\ \|T^3x\| \le \frac{1}{2\cdot 3\cdot 4}\|x\|.$$ In general$\|T^{n}\| \le 1/(n+1)!$. If$Tx=\lambda x$and$x \ne 0$, then $$|\lambda|^n\|x\|=\|T^nx\| \le \frac{1}{(n+1)!}\|x\|$$ If ... 1 The operator$L$maps$\{ a_n \}_{n=-\infty}^{\infty}$to$\{ a_{n+1} \}_{n=-\infty}^{\infty}$. If$e_n$is the standard basis element defined as a sequence of all$0$'s except for a$1$in the$n$-th place, then$Le_n = e_{n-1}$, which is why$L$would be considered to be a left shift. And this follows from the definition$L\{ a_n \} = \{ a_{n+1} \}$: the ... 2 More elementary way: a. If$\lvert\,\lambda\rvert>1$, then$\lambda\not\in\sigma(\mathcal L)$. This is clear as the series$(\lambda-\mathcal L)^{-1}=\lambda^{-1}\sum_{n=0}^\infty (\lambda^{-1}\mathcal L)^n$converges. b. If$\lvert\,\lambda\rvert<1$, then$\lambda\not\in\sigma(\mathcal L)$. This is clear as the series$(\lambda-\mathcal ...

3

Answer. $S=\{z\in\mathbb C: \lvert\,z\rvert=1\}$. Explanation. The space $\ell^2(\mathbb Z)$ is isometric to $L^2(\mathbb T)$, where $\mathbb T$ is the unit circle (equivalently, the domain of $2\pi-$periodic functions), and this is done by the transfomation $$\varPhi\big((a_k)_{k\in\mathbb Z}\big)=\sum_{k\in\mathbb Z}a_k\mathrm{e}^{ikx},$$ as ...

1

HINT.If $a_{n+1}-z a_n=b_n$ then $a_2=z a_1+b_1$, $a_3=z a_2+b_2=z^2 a_1+z b_1+b_2$ ,$a_4=z a_3+b_3=z^3a_1+z^2b_1+z b_2+b_3$, etc. If $|z|=1$ and $b_n= z^{n}/(1+|n|)$, what happens to $|a_n-z^{n-1}a_1|$ for large positive $n$?

1

If the characteristic polynomial of $f$ has no multiple roots, then there exist distinct complex numbers $\lambda_1, \dots, \lambda_n$ and a basis $v_1, \dots, v_n$ of $\mathbb{C}^n$ such that $$fv_k = \lambda_k v_k$$ for $k = 1, \dots, n$. Now \begin{align*} f(gv_k) &= g(fv_k) \\ &= \lambda_k (gv_k), \end{align*} which means that $gv_k$ is in the ...

0

I presume this is on a Hilbert space, so that your "scalar function" $\chi$ is a self-adjoint projection (which by the spectral theorem is unitarily equivalent to multiplication by a scalar function with values $\{0,1\}$ on $L^2$ of some measure). No, we can't say much about $\rho(\chi A)$ compared to $\rho(A)$. Consider the $2 \times 2$ case $$A = ... 1 First, all functions in the span of u and v are critical points. Second, consider u_0 = \sin(\pi x)\sin(\pi y)\ge 0, u=t\cdot u_0, i.e., eigenfunctions to the smallest eigenvalue of the Laplacian. Then$$ I[u] = \int_\Omega \frac12|Du|^2 - \frac{5\pi^2}2|u|^2 = \frac12\int_\Omega u(-\Delta u - 5\pi^2u) = \frac12t^2 \int_\Omega u_0(2\pi^2 - ...

1

Suppose $\lambda$ is an isolated point of the spectrum of $T$. Let $F$ be a continuous function that is identically $1$ near $\lambda$, and is $0$ on the remaining part of the spectrum $\sigma(T)\setminus\{\lambda\}$. Then $F$ is either $1$ or $0$ on the spectrum, which makes $P=F(T)$ an orthogonal projection. Clearly $(T-\lambda I)P=0$ because ...

0

You are looking at the following eigenvalue problem on $[0,\infty)$: $$Lf= - \frac{d}{dx}\frac{1}{1+x}\frac{df}{dx}+(x+1)f=\lambda\frac{1}{x+1}f$$ If you can explicitly solve for any particular $\lambda$, then you can determine if the equation is in the limit point or limit circle case at $\infty$. If you are in the limit circle case, then all ...

0

If you add the condition that the eigenspaces of $A_1$ and $A_2$ are orthogonal, you will have better luck proving these sorts of bounds for the Schatten norms. If you just want to prove it for the spectral norm, you should only need the eigenspaces of the extreme eigenvalues to be orthogonal.

3

Theorem: Suppose $A : \mathcal{D}(A)\subseteq X\rightarrow X$ is a surjective linear operator on a complex Hilbert space $X$ for which $(Ax,x) \ge \|x\|^{2}$ holds for all $x\in\mathcal{D}(A)$. Then $A$ is densely-defined and selfadjoint. Proof: To show that $A$ is densely-defined suppose otherwise. Then there exists $y \perp \mathcal{D}(A)$. However, ...

Top 50 recent answers are included


text:
# Loos Pty Ltd sells three units of AA to one unit of BB; the two products have contribution margins..

Loos Pty Ltd sells three units of AA to one unit of BB; the two products have contribution margins of $100 and$200, respectively. Fixed costs are \$300 000. Calculate the unit sales at the break-even point. How many units of each product must be sold?


text:
# Automatically creating table with borders

Is there a way (something like a package) that if I write the code:

\begin{table}[]
\begin{tabular}{lr}
Country   & Counted \\
Australia & 690     \\
Germany   & 1000    \\
Poland    & 240     \\
India     & 5397
\end{tabular}
\end{table}

I get automatically the output like:

\begin{table}[]
\begin{tabular}{|l|r|}
\hline
Country   & Counted \\ \hline
Australia & 690     \\ \hline
Germany   & 1000    \\ \hline
Poland    & 240     \\ \hline
India     & 5397    \\ \hline
\end{tabular}
\end{table}

Without writing the | and \hline

• Welcome to TeX.SE. – Mico Oct 13 at 7:52

I assume the purpose of this is to reduce the typing you have to do? If so, one option is to use a macro. (If this is not the purpose, I will delete this answer)

\documentclass[12pt]{article}%

#1   & #2 \\ \hline
}

\begin{document}

\begin{table}[]
\begin{tabular}{|l|r|}
\hline
\end{tabular}
\end{table}

\end{document}

• This is indeed the purpose awesome! – jennifer ruurs Oct 13 at 8:16

Encasing a table in lots and lots of vertical and horizontal lines pretty much guarantees that the result will look like something that is viewed through a barred prison cell window. Not exactly inviting! It's certainly true that the "prison cell window look" is encountered rather frequently in scientific publications. However, that not a truly good reason for continuing this visually and aesthetically dubious practice.

My idea of making the table even better looking would be to (a) use no vertical bars at all, (b) use few, but well-spaced, horizontal bars, and (c) align the numbers in the data column on their (implicit) decimal marker.

\documentclass{article}
\usepackage{siunitx} % for 'S' column type
\usepackage{booktabs}% for \toprule, \midrule, and \bottomrule macros
\begin{document}

\noindent
\begin{tabular}{@{} lr @{}}
Country   & Counted \\
Australia & 690     \\
Germany   & 1000    \\
Poland    & 240     \\
India     & 5397
\end{tabular}
\begin{tabular}{|l|r|}
\hline
Country   & Counted \\ \hline
Australia & 690     \\ \hline
Germany   & 1000    \\ \hline
Poland    & 240     \\ \hline
India     & 5397    \\ \hline
\end{tabular}
%% do consider the following approach:
\begin{tabular}{@{} lS[table-format=4.0] @{}}
\toprule
Country   & {Counted} \\ % 'Counted' is placed in curly braces
\midrule
Australia & 690     \\
Germany   & 1000    \\
Poland    & 240     \\
India     & 5397    \\
\bottomrule
\end{tabular}

\end{document}

Macros are not too much help here, i. e., type \whatever{a}{b} seems not too much advantage over type directly a & b \\\hline.

One more helper manual approach is use web application to write te table code (e.g: https://www.tablesgenerator.com/) Or use a LaTeX editor with a table wizard (e.g.: Gummi or LyX)

But for a significant help with automatic generation of tables, there are other approaches. One pure LaTeX solution is Formatting complex table from CSV using datatool.

The csv and excel files file could be also read in R as a data frame or matrix and exported in several ways to beautiful LaTeX tables and automatically include in a LaTeX file. I use this a lot. To show only some of the options, this is a example done in Rmarkdown produce a LaTeX and PDF version with different R packages to make four styles of tables from the same data (but yes, the better is indeed that with only the 3 booktabs rules):

---
title: A \LaTeX\ document with tables made with R in Rmarkdown.
classoption: twocolumn, a5paper
output:
pdf_document:
keep_tex: yes
geometry: columnsep=3em
---

{r rawdata,echo=F}

# for this small table I will make directly the data frame
# instead of load a csv file.

df <- data.frame(
Contry=c("Australia","Germany","Poland","India"),
Counted=c(690,1000,240,5397))

Formal table made with xtable:

{r test0,echo=F,results='asis'}
library(xtable)
print(xtable(df),comment=F,include.rownames=F,booktabs=T)

With some elegant row colors, now with knitr y kableExtra:

{r test1,echo=F}
library(knitr)
library(kableExtra)
kable(df, booktabs=T) %>%
kable_styling(latex_options = c("striped", "hold_position"))

\newpage

Criminal data jailed. Made with a huxtable:

{r test3,message=F,echo=F}
library(huxtable)
ht <- as_hux(df, add_colnames = TRUE)
number_format(ht) <- 0 # decimal places
set_all_borders(ht, 1:5, 1:2, 1.5)

Criminal data too, now crucified:

{r test4,message=F,echo=F}
theme_basic(ht)

• +1 for "criminal data too, now crucified". – Mico Oct 14 at 4:29


text:
w.

# Julia Learning Circle: Generated Functions

A normal function outputs the result of the computation by the function. In contrast, a generated function outputs the code that implements the function. While generating this code, the generated function can only make use of the types of the arguments, not their values. In a sense, generated functions offer “on-demand code generation”. This mechanism is quite powerful and can be used when normal functions in combination with multiple dispatch cannot give you what you need.

To illustrate generated functions, we will build on the example of stack-allocated vectors from the previous post. We will extend our stack-allocated vector to a stack-allocated matrix, and we will use a generated function to implement matrix multiplication. Let’s start out by defining a stack-allocated vector and matrix.

struct StackMatrix{T, M, N, L}
data::NTuple{L, T}
end

function StackVector(data::Vector{T}) where T
return StackMatrix{T, length(data), 1, length(data)}(Tuple(data))
end
function StackMatrix(data::Matrix{T}) where T
M, N = size(data)
return StackMatrix{T, M, N, length(data)}(Tuple(data[:]))
end

The type signature is StackMatrix{T, M, N, L} where T is the type of the elements of the matrix, M is the number of rows of the matrix, N is the number of columns of the matrix, and L = M * N is the total number of elements in the matrix; even though L can always be computed from M and N, we need L in the type signature, because it specifies the length of the NTuple.

Before we implement multiplication of general StackMatrix{T, M, N, L}s, we first consider the case of StackMatrix{T, 2, 2, 4}s.

import Base: *

function *(x::StackMatrix{T, 2, 2, 4}, y::StackMatrix{T, 2, 2, 4}) where T
x11, x21, x12, x22 = x.data
y11, y21, y12, y22 = y.data
z11 = x11 * y11 + x12 * y21
z21 = x21 * y11 + x22 * y21
z12 = x11 * y12 + x12 * y22
z22 = x21 * y12 + x22 * y22
return StackMatrix{T, 2, 2, 4}((z11, z21, z12, z22))
end

Let’s check that the implementation is correct.

julia> x = randn(2, 2);

julia> y = randn(2, 2);

julia> x_stack = StackMatrix(x);

julia> y_stack = StackMatrix(y);

julia> x * y
2×2 Matrix{Float64}:
-1.16361    0.848159
0.355827  -0.441428

julia> reshape(collect((x_stack * y_stack).data), 2, 2)
2×2 Matrix{Float64}:
-1.16361    0.848159
0.355827  -0.441428

Nice! And it is quite a bit faster, too.

julia> @benchmark $x *$y
BenchmarkTools.Trial:
memory estimate:  112 bytes
allocs estimate:  1
--------------
minimum time:     54.112 ns (0.00% GC)
median time:      59.993 ns (0.00% GC)
mean time:        62.529 ns (1.27% GC)
maximum time:     486.884 ns (83.35% GC)
--------------
samples:          10000
evals/sample:     973

julia> @benchmark $(Ref(x_stack))[] *$(Ref(y_stack))[]
BenchmarkTools.Trial:
memory estimate:  0 bytes
allocs estimate:  0
--------------
minimum time:     3.015 ns (0.00% GC)
median time:      3.033 ns (0.00% GC)
mean time:        3.077 ns (0.00% GC)
maximum time:     16.869 ns (0.00% GC)
--------------
samples:          10000
evals/sample:     1000

The problem with multiplication of general StackMatrix{T, M, N, L}s is that the implementation depends on the particular values of M and N — for example, the variables z11, z21, et cetera. We will use a generated function to automatically generate the implementation of the corresponding matrix multiplication. This code-generation procedure depends on the values of M and N and will adapt the implementation accordingly. Generated functions are defined with the macro @generated. The implementation of multiplication of general StackMatrix{T, M, N, L}s as follows:

import Base: *

@generated function *(
x::StackMatrix{T, K, M, L₁},
y::StackMatrix{T, M, N, L₂}
) where {T, K, M, N, L₁, L₂}
# Unpack x.
tuple_x = Expr(:tuple,  [Symbol("x_$(k)_$(m)") for m = 1:M for k = 1:K]...)
unpack_x = :($tuple_x = x.data) # Unpack y. tuple_y = Expr(:tuple, [Symbol("y_$(m)_$(n)") for n = 1:N for m = 1:M]...) unpack_y = :($tuple_y = y.data)

# Perform multiplication.
mults = Vector{Expr}()
for k = 1:K, n = 1:N
expr = Expr(
:call,
:+,
[:($(Symbol("x_$(k)_$(m)")) *$(Symbol("y_$(m)_$(n)"))) for m = 1:M]...
)
push!(mults, :($(Symbol("z_$(k)_$(n)")) =$expr))
end

# Pack z.
tuple_z = Expr(:tuple,  [Symbol("z_$(k)_$(n)") for n = 1:N for k = 1:K]...)
pack_z = :(StackMatrix{T, K, N, L₃}($tuple_z)) return Expr( :block, unpack_x, unpack_y, mults..., :(L₃ = K * N), :(return$pack_z)
)
end

If we omit the macro @generated, we can call the implementation to inspect the generated code:

julia> x_stack * y_stack
quote
(x_1_1, x_2_1, x_1_2, x_2_2) = x.data
(y_1_1, y_2_1, y_1_2, y_2_2) = y.data
z_1_1 = x_1_1 * y_1_1 + x_1_2 * y_2_1
z_1_2 = x_1_1 * y_1_2 + x_1_2 * y_2_2
z_2_1 = x_2_1 * y_1_1 + x_2_2 * y_2_1
z_2_2 = x_2_1 * y_1_2 + x_2_2 * y_2_2
L₃ = K * N
return StackMatrix{T, K, N, L₃}((z_1_1, z_2_1, z_1_2, z_2_2))
end

Sweet! This looks very much like our earlier implementation of the two-by-two case. Let’s again check that the implementation is correct.

julia> x = randn(4, 2);

julia> y = randn(2, 3);

julia> x_stack = StackMatrix(x);

julia> y_stack = StackMatrix(y);

julia> x * y
4×3 Matrix{Float64}:
0.125514  -0.0135978  -0.0283178
-1.93756    0.450559    1.17303
2.56769   -0.365378   -0.845966
3.22549   -0.602203   -1.50065

julia> reshape(collect((x_stack * y_stack).data), 4, 3)
4×3 Matrix{Float64}:
0.125514  -0.0135978  -0.0283178
-1.93756    0.450559    1.17303
2.56769   -0.365378   -0.845966
3.22549   -0.602203   -1.50065

Like the two-by-two case, this implementation is quite a bit faster, too.

julia> @benchmark $x *$y
BenchmarkTools.Trial:
memory estimate:  176 bytes
allocs estimate:  1
--------------
minimum time:     205.100 ns (0.00% GC)
median time:      219.162 ns (0.00% GC)
mean time:        229.711 ns (0.74% GC)
maximum time:     1.679 μs (75.82% GC)
--------------
samples:          10000
evals/sample:     530

julia> @benchmark $(Ref(x_stack))[] *$(Ref(y_stack))[]
BenchmarkTools.Trial:
memory estimate:  0 bytes
allocs estimate:  0
--------------
minimum time:     15.097 ns (0.00% GC)
median time:      15.665 ns (0.00% GC)
mean time:        16.987 ns (0.00% GC)
maximum time:     103.605 ns (0.00% GC)
--------------
samples:          10000
evals/sample:     997

Published on 13 December 2020.


text:
# Hamiltonian Monte Carlo (HMC)

An auxiliary variable Markov Chain Monte Carlo (MCMC) algorithm that takes inspiration from Hamiltonian Dynamics, and uses gradient information to get better mixing rates.

Sidestepping from conventional notation, denote $$\Theta, \mathbf{v} \in \mathbb{R}^D$$ to be the position and momentum of some particle respectively. The set of values $$(\Theta,\mathbf{v})$$ can take is called the phase space. Assuming that the potential energy $$\mathcal{E}$$ of the particle depends only on its position, and its kinetic energy $$\mathcal{K}$$ depends only on its momentum, we have that the Hamiltonian $$\mathcal{H}$$ is then $\mathcal{H}(\Theta,\mathbf{v}) = \mathcal{E}(\Theta)+\mathcal{K}(\mathbf{v})$

To relate the Hamiltonian to statistical models, we often take the potential energy to be related to some Boltzmann Distribution, i.e. $$\mathcal{E}(\Theta) = -\log \tilde{\pi}(\Theta)$$ where $$\tilde{\pi}(\Theta)$$ is some unnormalized distribution. The kinetic energy can taken to be for e.g. to be a quadratic form i.e. $$\mathcal{K}(\mathbf{v}) = \frac{1}{2}\mathbf{v}^T\Sigma^{-1}\mathbf{v}$$ where $$\Sigma$$ is some covariance matrix, in this context also called the inverse mass matrix.

To generate samples, we need to simulate $$\Theta,\mathbf{v}$$ based on Hamilton’s equations, which describe the motion of the particle. $\frac{d\Theta}{dt} = \frac{\partial \mathcal{H}(\Theta,\mathbf{v})}{\partial \mathbf{v}}$ $\frac{d\mathbf{v}}{dt} = -\frac{\partial \mathcal{H}(\Theta,\mathbf{v})}{\partial \Theta}$

This requires us to numerically compute the solution to the Ordinary Differential Equations (ODEs) above. For any $$t_k$$, the mapping from $$(\Theta(t),\mathbf{v}(t)) \mapsto (\Theta(t+t_k),\mathbf{v}(t+t_k))$$ is both invertible and volume preserving. To make sure the volume preserving property is maintained, we need to use Symplectic Integrators when making the numerical approximation. The Leapfrog Integrator is one common example.

The target distribution is taken to be $$\pi(\Theta,\mathbf{v}) = \frac{1}{Z}e^{-\mathcal{H}(\Theta,\mathbf{v})$$, which when marginalizing over the auxiliary variable $$\mathbf{v}$$ recovers the distribution $$\pi(\Theta)$$ since $$\pi(\Theta) = \int \pi(\Theta,\mathbf{v}) \: d\mathbf{v} = \frac{1}{Z_\Theta}e^{-\mathcal{E}(\Theta)} \int \frac{1}{Z_\mathbf{v}}e^{-\frac{1}{2}\mathbf{v}^T\Sigma\mathbf{v}}\:d\mathbf{v} \propto e^{-\mathcal{E}(\Theta)}$$.

Suppose we now have the sample $$(\Theta_t,\mathbf{v}_t)$$. To generate the next sample, we generate a new momentum vector $$\mathbf{v}^*_t \sim \mathcal{N}(\mathbf{0},\Sigma)$$. Then, run the symplectic integrator for $$L$$ steps starting from $$(\Theta_t, \mathbf{v}^*_t)$$ to get the proposal state $$(\Theta^*, \mathbf{v}^*)$$. This new sample is accepted according to the Metropolis-Hastings acceptance probability, which is $$\alpha = \min\Big(1,\frac{\pi(\Theta^*,\mathbf{v}^*)}{\pi(\Theta_t,\mathbf{v}_t)}\Big) = \min(1, e^{-\mathcal{H}(\Theta^*,\mathbf{v}^*)+\mathcal{H}(\Theta_t,\mathbf{v}_t)})$$ where in this case the correction term cancels out since the proposal is reversible.* Since the Hamiltonian is a conserved quantity, we would an acceptance probability of 1, not taking into account the numerical errors introduced by whichever symplectic integrator is used.

## Thoughts

• * In Murphy’s PML book V2 this is mentioned casually. I assume by proposal being reversible he means Hamiltonian dynamics being reversible, but what about the numerical errors that arise from that?
• Write about the parameters involved - $$\Sigma$$, $$L$$, and step size used in the symplectic integrator.
• Using the leapfrog integrator with $$L=1$$ step is called Langevin Monte Carlo - maybe another node on that?

Created: 2022-04-04 Mon 23:39

Validate