text:
Full length article| Volume 17, ISSUE 7, e479-e484, July 01, 2013

# Modeling the initial transmission dynamics of influenza A H1N1 in Guangdong Province, China

Open Access

## Summary

### Background

The novel influenza A H1N1 (2009) virus, identified in mid-2009, spread rapidly in Guangdong Province. The accurate estimation of epidemiological parameters is of vital significance in decision-making for coping with pandemic influenza.

### Methods

We used influenza A H1N1 epidemic data from local cases in Guangdong Province, China, in conjunction with a complex SEIR model (susceptible, exposed, infectious, recovered) to estimate the basic reproduction number. The transmission rate was obtained by fitting the model to the cumulative number of local daily infected cases using the nonlinear ordinary least squares method. The latent period and duration of infectiousness were obtained from the published literature, and the proportion of symptomatic infected cases was obtained from the serological survey conducted by the Center for Disease Control and Prevention of Guangdong Province. We determined the variance of model parameters via a simulation study.

### Results

The model was in keeping with the observed epidemic data (coefficient of determination = 0.982). The basic reproduction number was estimated preliminarily to be R0 = 1.525 (95% confidence interval 1.448–1.602), with the possible range of true R0 being 1.30–1.85. We estimated the transmission rate β to be between 0.390 and 0.432.

### Conclusions

With the help of the serological survey, useful estimates of key epidemiological parameters for the influenza A H1N1 outbreak in Guangdong Province were obtained. The sensitivity analysis suggests that different latent periods and infectious periods, which specify different mean durations of generation time, have a significant impact on R0. Our proposed model and findings provide a relevant contribution towards understanding the characteristics of influenza A H1N1 in Guangdong Province.

## 1. Introduction

The influenza A H1N1 virus, a new influenza virus, was first identified in April 2009 in Mexico and the USA, and a pandemic was declared by the World Health Organization (WHO) on June 11, 2009. The first confirmed case of pandemic influenza A H1N1 in Guangdong Province was recorded on May 18, 2009 in Guangzhou, in a traveler who had returned from the USA and Canada. The first local case in Guangdong was notified on May 30, almost 2 weeks after the first case was confirmed. Following preliminary tests carried out by the Center for Disease Control and Prevention of Guangdong Province (CDC), it was revealed that effective contact with an infectious individual was the only path for the transmission of the influenza A H1N1 virus. As this virus is highly infectious, it was essential that the government put in place strategies to mitigate and control the disease in the face of uncertainty.
For a new infectious disease, working out the epidemiological parameters can help in decision-making. A key parameter for any novel infectious disease is the basic reproduction number (R0), defined as the average number of secondary cases generated by a single primary case during its entire period of infectiousness in a completely susceptible population.
• Diekmann O.
• Heesterbeek J.A.
Mathematical epidemiology of infectious diseases: model building, analysis and interpretation.
R0 directly determines the growth rate of an epidemic and the final number of infected people, and is a predominant factor to be considered in optimal strategy-making. The estimation of the basic reproduction number is problematic and has gained much attention, and a few methods have been proposed to estimate R0. One method relies on the distribution of the generation interval and the observed epidemic growth rate to estimate R0.
• Wallinga J.
• Lipsitch M.
How generation intervals shape the relationship between growth rates and reproductive numbers.
Specifically, the shape of the generation interval distribution determines the formula for estimating R0. Another method uses the sequential Bayesian procedure of the stochastic SIR (susceptible, infectious, recovered) model, which assumes homogeneous mixing of the population, to estimate the posterior probability distribution of the effective reproduction number. This method has recently been applied to the real-time monitoring of emerging infectious diseases,
• Bettencourt L.M.
• Ribeiro R.M.
Real time Bayesian estimation of the epidemic potential of emerging infectious diseases.
via a Bayesian inference scheme. The third method proposes a structured epidemic model (e.g., SIR and SEIR (susceptible, exposed, infectious, recovered) model), which demands homogeneous mixing between individuals, to calculate R0. The strength of this type of method is that they originally assume a detailed structure which complies with the realistic representation of transmission dynamics of pandemic influenza A H1N1 (e.g., asymptomatic infection) and qualify the effects of intervention strategies (e.g., vaccination) in the future. In addition, a previous study based on a SEIR model concluded that estimates of the reproductive number were not affected by age-specific transmission rates and case-fatality proportions in the pandemic influenza of 1918 in Geneva, Switzerland.
• Mills C.E.
• Robins J.M.
• Lipsitch M.
Transmissibility of 1918 pandemic influenza.
In Guangdong Province the available epidemiological information (e.g., the mixing matrix among age groups, the vector of susceptibility by age) is not sufficient to validate a detailed age-structured deterministic compartmental model for the transmission of pandemic influenza. Furthermore, we have a limited knowledge of the precise shape of the generation interval distribution in Guangdong Province and so cannot estimate R0 using the intrinsic growth rate. Thus, in the estimation procedures, we must rely on a complex SEIR model within broader model assumptions. Under the condition of understanding epidemiological mechanisms that characterize the influenza dynamics, the complex SEIR model is a more effective and reliable approach to estimating R0 preliminarily, especially in the initial phase of an epidemic.
• Chowell G.
• Nishiura H.
• Bettencourt L.M.
Comparative estimation of the reproduction number for pandemic influenza from daily case notification data.
Besides, during the early epidemic period, the proportion of asymptomatic and partially infectious cases may be difficult to estimate because of difficulties in identification. Therefore, it is crucial to take into account the accurate serological estimation of the proportion of asymptomatic cases in estimating R0 via the complex SEIR model.
In this study, a compartmental model was constructed to approximately predict or reproduce the dynamics of the influenza A H1N1 virus in the population of Guangdong Province. It is important to mention that few previous researchers have constructed the dynamic model for notifications of individuals with influenza A H1N1 virus in Guangdong Province for parameter estimation. In this study, the transmission dynamics in the initial phase of influenza were modeled using a compartmental model accounting for the known possibility of limited transmission from the exposed class. Furthermore, an estimation of the basic reproduction number (R0) for pandemic influenza A H1N1 was made with the data from initial reports of laboratory confirmed pandemic influenza A H1N1. Some of the model parameters were estimated via nonlinear ordinary least squares (NOLS) fitting.

## 2. Materials and methods

### 2.1 Data collection

We collected individual-level data of laboratory confirmed cases of pandemic influenza A H1N1 in Guangdong, with the reported date of diagnosis between May 18 and June 30, 2009. This cutoff was chosen because the first wave occurred in June 2009 and the strategy of individual-level reporting of cases in Guangdong Province underwent major modifications after this date (Figure 1). The data were obtained from the Integrated Public Health Information System of the Province, a system that incorporates data provided by medical units engaged in the investigation of pandemic influenza A H1N1. Through the Public Health Information System it was found that effective isolation and tracking strategies were adopted for imported cases after the first case was confirmed. In order to analyze transmission dynamics in the local cases, the number of imported cases was eliminated from the total number.

### 2.2 Epidemic model

In this study, pandemic influenza A H1N1 in Guangdong Province, China was modeled using a compartmental model based on a more complex SEIR model.
• Chowell G.
• Nishiura H.
Quantifying the transmission potential of pandemic influenza.
• Anderson R.M.
• May R.M.
Infectious diseases of humans: dynamics and control.
• Chowell G.
• Ammon C.E.
• Hengartner N.W.
• Hyman J.M.
Transmission dynamics of the great influenza pandemic of 1918 in Geneva, Switzerland: assessing the effects of hypothetical interventions.
In this model for the transmission dynamics of pandemic influenza (Figure 2), individuals are classified as susceptible (S(t)), exposed (E(t)), symptomatic infectious (I(t)), asymptomatic and partially infectious (A(t)), and recovered (R(t)). It is assumed that individuals who have been infected first go into a latent (exposed) stage, during which they may have a low level of infectivity. In addition, our model includes two additional properties. Firstly, some proportion of the latent individuals never develop symptoms but go directly from the latent class to the asymptomatic and partially infectious class and then to the recovered class. Secondly, the time-scale of the epidemic is much faster than characteristic times for demographic processes. In our model, the rate at which susceptible individuals in contact with the virus progress to the latent stage is given by β(qE(t+ I(t+ A(t))/N(t), β being the transmission rate and q a reduction factor in the transmissibility of the exposed class. Moreover, the total population size at time t is given by N(t) =S(t+ E(t) +I(t) +A(t) +R(t). A proportion 0 < p < 1 of exposed individuals progress to infectious class I(t) at the rate δ and the rest (1 − p) go to the asymptomatic and partially infectious class A(t) at the same rate. Symptomatic and asymptomatic cases progress to the recovered class at the rates γ1 and γ2, respectively. Finally it is considered that an individual acquires permanent immunity after recovery.
In modeling the transmission process (for the initial influenza wave), the following system of nonlinear differential equations was employed:
$dS(t)dt=−βS(t)qE(t)+I(t)+A(t)N(t)dE(t)dt=βS(t)qE(t)+I(t)+A(t)N(t)−δE(t)dI(t)dt=pδE(t)−γ1I(t)dA(t)dt=(1−p)δE(t)−γ2A(t)dR(t)dt=γ1I(t)+γ2A(t)dC(t)dt=pδE(t)$
(1)

The cumulative number of symptomatic infectious notifications, our observed data, is given by C(t). All parameters used in the differential equations are listed in Table 1.
Table 1Parameter definitions in the differential equations
ParameterDefinition
βTransmission rate
qRelative measure of infectiousness for the class E
δInfected rate
γ1, γ2Recovery rate for infectious and asymptomatic classes, respectively
pProportion of symptomatic infection

### 2.3 The basic reproduction number

The basic reproduction number (R0), the expected number of secondary infections produced by an index case in a completely susceptible population, is a key factor used in estimating the transmissibility of infectious diseases. If R0 > 1, it suggests that an epidemic can occur. It can be demonstrated by applying the next-generation method
• Van den Driessche P.
• Watmough J.
Reproduction numbers and sub-threshold endemic equilibria for compartmental models of disease transmission.
• Diekmann O.
• Heesterbeek J.A.
• Metz J.A.
On the definition and the computation of the basic reproductive ratio R0 in models for infectious diseases.
• Hyman J.M.
• Li J.
An intuitive formulation for the reproductive number for the spread of diseases in heterogeneous populations.
to our model equations that the basic reproduction number is:
$R0=βq/δ+p/γ1+(1−p)/γ2$
(2)

Given the reduction factor q in the exposed class and δ, γ1, γ2, we can conclude that R0 is a function of β. An estimation of R0 is made from the data by substituting the parameters into equation 2.

### 2.4 Parameter estimation

In order to adjust the model to time-series data of confirmed cases of pandemic influenza A H1N1, it is necessary to set some parameter values. In our model the birth and natural death rates were ignored and the age distribution profile (shown in Figure 3) in Guangdong Province was similar to that in the province of Ontario, so the mean latent period in the exposed classes E(t) was assumed to be 2.62 (95% confidence interval (CI) 2.28–3.12) days.
• Tuite A.R.
• Greer A.L.
• Whelan M.
• Winter A.L.
• Lee B.
• Yan P.
• et al.
Estimated epidemiologic parameters and morbidity associated with pandemic H1N1 influenza.
Therefore, the infected rate δ was considered to be δ = 1/2.62. On the other hand, of all the cases in Guangdong Province, most symptomatic ones were characterized by mild infections and symptoms. Moreover, in a previous similar study on pandemic influenza,
• Chowell G.
• Ammon C.E.
• Hengartner N.W.
• Hyman J.M.
Transmission dynamics of the great influenza pandemic of 1918 in Geneva, Switzerland: assessing the effects of hypothetical interventions.
the same rates were used to reflect recovery rates of symptomatic and asymptomatic cases. Thus, it was considered that symptomatic cases recovered at the same rate as asymptomatic cases, and the mean duration of infectiousness was fixed to 1/γ1 = 1/γ2 = 3.38 days (95% CI 2.06–4.69),
• Tuite A.R.
• Greer A.L.
• Whelan M.
• Winter A.L.
• Lee B.
• Yan P.
• et al.
Estimated epidemiologic parameters and morbidity associated with pandemic H1N1 influenza.
which indicates that the duration of infectiousness might be curtailed by hospitalization or self-isolation prior to recovery. Owing to influenza virus shedding (the time during which a person might be infectious to another person) at the end of the latent period, the possibility of limited transmission from exposed class q was fixed to 1/8 in a rather crude way.
• Chowell G.
• Fenimore P.W.
• Castillo-Garsow M.A.
• Castillo-Chavez C.
SARS outbreaks in Ontario, Hong Kong and Singapore: the role of diagnosis and isolation as a control mechanism.
According to the serological survey conducted by the Guangdong CDC, the proportion of symptomatic infectious cases p was fixed to 60.2%. The serological survey was conducted during the period January 11–24, 2010. In this cross-sectional serological survey, the serum samples, distributed across 144 residential areas, 85 streets or townships, 25 counties, and 21 cities, were collected by multistage stratified random sampling. Antibodies against the pandemic influenza A H1N1 virus were detected by hemagglutination inhibition (HI) assay, in accordance with the standards of the WHO National Influenza Center. During this period, a total of 4725 serum samples were collected from subjects who had not been vaccinated with the influenza A H1N1 vaccine. One thousand one hundred eighty-five cases were seropositive for pandemic influenza A H1N1 antibodies, including 472 asymptomatic patients (1 − p = 39.8%).
The transmission rate β was estimated through NOLS fitting of C(t,β,E(0)) in model 1 to the cumulative cases of pandemic influenza A H1N1 (Figure 4). To guarantee that the global minimum of this model could be achieved, we repeated the optimization 10 times starting at randomly drawn parameter values from appropriate parameter ranges. For the NOLS fitting procedure, we used the Marquardt–Levenberg method with the line-search implemented in MODEL procedure of SAS 9.2 (SAS Institute Inc.), which analyzes models in which the relationships among the variables comprise a system of one or more nonlinear equations.
The method to generate uncertainty bounds on parameters was the calculation of bootstrap confidence intervals by generating sets of realizations of the best-fit curve C(t).
• Efron B.
• Tibshirani R.J.
Bootstrap methods for standard errors, confidence intervals, and other measures of statistical accuracy.
Each realization of the Ci(t) (i = 1, 2, …, m) was generated using the increment in the real C(t) from day i to day i+ 1 as the Poisson mean for the number of new case notifications observed in the i to i+ 1 interval.
• Chowell G.
• Ammon C.E.
• Hengartner N.W.
• Hyman J.M.
Transmission dynamics of the great influenza pandemic of 1918 in Geneva, Switzerland: assessing the effects of hypothetical interventions.
The parameter estimation procedure (described above) was then applied to each of the 1000 simulated realizations.
The estimation of the model requires information about epidemiological parameters of disease progression (γ1, γ2, δ, q). Moreover, the mean duration of the generation time reported by Tuite et al.
• Tuite A.R.
• Greer A.L.
• Whelan M.
• Winter A.L.
• Lee B.
• Yan P.
• et al.
Estimated epidemiologic parameters and morbidity associated with pandemic H1N1 influenza.
was much longer than that in other studies, so δ = 1/2.62 and 1/γ1 = 1/γ2 = 3.38 may not be the best choice. Thus, given that the estimates of the serial interval and R0 are often correlated, we considered different possible combinations of epidemiological parameter values (γ1, γ2, δ) estimated for other strains of influenza (Table 2), which indicated different possible estimates of the serial interval of influenza A H1N1 virus infection. In other words, we changed the latent period and infectious period so as to adjust the mean generation time.
Table 2Sensitivity analysis with different baseline values of epidemiological parameters
Ref.Combination of parametersEstimated β, 95% CIEstimated E(0), 95% CIEstimated R0, 95% CI
12δ = 1/2.62

γ1 = γ2 = 1/3.38

q = 1/4
0.371 (0.353–0.389)8.733 (5.842–11.624)1.495 (1.422–1.568)
12δ = 1/2.62

γ1 = γ2 = 1/3.38

q = 1/8
0.411 (0.390–0.432)9.191 (6.399–11.983)1.525 (1.448–1.602)
12δ = 1/2.62

γ1 = γ2 = 1/3.38

q = 0
0.462 (0.438–0.486)9.707 (6.932–12.482)1.563 (1.483–1.643)
12δ = 1/2.62

γ1 = γ2 = 1/4.69

q = 1/4
0.304 (0.287–0.321)10.044 (6.933–13.155)1.626 (1.535–1.717)
16δ = 1/3

γ1 = 1/7, γ2 = 1

q = 1/4
0.334 (0.315–0.353)11.070 (7.535–14.605)1.792 (1.688–1.896)
16δ = 1/3

γ1 = 1/7, γ2 = 1

q = 1/8
0.371 (0.347–0.395)11.686 (8.049–15.323)1.851 (1.732–1.970)
16δ = 1

γ1 = γ2 = 1/2.5

q = 1/8
0.494 (0.477–0.511)4.827 (3.217–6.437)1.297 (1.254–1.340)
16δ = 1

γ1 = 1/4, γ2 = 1

q = 1/8
0.473 (0.453–0.493)5.417 (3.323–7.511)1.386 (1.327–1.445)
16δ = 1

γ1 = 1/4, γ2 = 1

q = 1/4
0.448 (0.432–0.464)5.233 (3.380–7.086)1.370 (1.323–1.417)
95% CI, 95% confidence interval.

## 3. Results

A total of 157 laboratory-confirmed cases were included in this study. The mean age of the patients was 14.6 (standard deviation 8.9) years. The age distribution is presented in Figure 3 and the detailed demographic characteristics of the patients are presented in Table 3. Figure 3 shows that the age distribution profile of confirmed cases from Guangdong Province is similar to that in the province of Ontario.
Table 3Characteristics of cases of pandemic influenza A H1N1 in Guangdong Province
Demographic characteristicsnPercentage
Gender
Male9258.6
Female6541.4
Region(city)
Guangzhou5635.7
Dongguan5635.7
Jiangmen2717.2
Foshan117.0
Shenzhen31.9
Zhuhai31.9
Shantou10.6
The model employed in this study for the local influenza notifications between May 30 and June 30, 2009 in Guangdong Province, China was in conformity with the observed cumulative epidemic data (coefficient of determination = 0.982; Figure 5). The histogram of the residuals as shown in Figure 6 indicates that the normality assumption could be true.
During the early transmission of pandemic influenza A H1N1, we estimated epidemiological parameters through NOLS fitting of the model to the cumulative number of daily laboratory confirmed notifications. The resulting parameter estimates are listed in Table 4, and the best model fit to the data is shown in Figure 5. Using our expression of the basic reproduction number, it was revealed that R0 for the initial wave in Guangdong Province = 1.525 (95% CI 1.448–1.602), consistent with most analyses of data from Mexico (R0: 1.2–1.6)
• Fraser C.
• Donnelly C.A.
• Cauchemez S.
• Hanage W.P.
• Van Kerkhove M.D.
• Hollingsworth T.D.
• et al.
Pandemic potential of a strain of influenza A (H1N1): early findings.
• Pourbohloul B.
• Ahued A.
• Davoudi B.
• Meza R.
• Meyers L.A.
• Skowronski D.M.
• et al.
Initial human transmission dynamics of the pandemic (H1N1) 2009 virus in North America.
and Vietnam (R0: 1.5–1.6).
• Hien T.T.
• Boni M.F.
• Bryant J.E.
• Ngan T.T.
• Wolbers M.
• Nguyen T.D.
• et al.
Early pandemic influenza (2009 H1N1) in Ho Chi Minh City, Vietnam: a clinical, virological and epidemiological analysis.
Table 4Parameter definitions and NOLS estimates for the influenza A H1N1 pandemic of 2009 in Guangdong Province, China
ParameterDefinitionMethodEstimate95% CI
βTransmission rateNOLS0.4110.390–0.432
E(0)Initial number of exposed individualsNOLS9.1916.399–11.983
R0Basic reproduction number-1.5251.448–1.602
95% CI, 95% confidence interval; NOLS, nonlinear ordinary least squares.
To test the sensitivity of the assumed estimates (γ1, γ2, δ, q), we re-estimated R0 several times using different combinations of parameter values from two studies reported in the literature (given in Table 2). Table 2 shows the variation of R0 for nine different combinations. It was found that the parameters with the greatest impact on the estimated basic reproduction number were the latent period and the duration of infectiousness. When the latent period and infectious period were shortened (shown in the last three rows, Table 2), which implied the mean generation time was reduced to around 3 days, R0 gradually decreased to around 1.3. The effect of the parameter q on the basic reproduction number of the initial phase was assessed by modifying the relative infectiousness of the exposed class. It was found that if the possibility of limited transmission from the exposed class was increased by 100%, the basic reproduction number would be reduced to 1.495.

## 4. Discussion

The major objective of this study was to determine whether our proposed compartmental epidemic model with homogeneous mixing could ﬁt to the series data of pandemic influenza A H1N1 virus in Guangdong Province, China. Clearly, in view of the data currently available, the complex SEIR model provides a more practical tool for the approximate estimation of key epidemiological parameters and it seems likely that in future outbreaks, local decision-makers would be informed by the same kind of data. Thus, based on our proposed compartmental epidemic model, the history of daily case reports in Guangdong Province is informative to estimate the basic reproduction number and is also helpful in explaining the characteristics of influenza A H1N1 in Guangdong Province. In addition, with the help of the basic reproduction number estimated from our proposed model, we can give the Guangdong CDC valuable information about the progression and likely size of a disease outbreak. Furthermore, by utilizing the information concerning the ranges of the calculated transmission rate and basic reproduction number, we suggest that the Guangdong CDC should classify the common infectious diseases and establish corresponding emergency response plans and utilize them to assist in prioritizing prevention services. This means that the intensity of interventions will correspond to changes in R0 and β. However, our model has some limitations in the following aspects. First, our model described above is homogeneous with respect to the age structure, which may have some impact on accurately estimating R0. Second, our estimation of the epidemiological parameter values from the published literature may be a little biased. Finally, owing to limitations of the surveillance system, we do not have enough information and other datasets to check our estimates, hence we have just discussed the possible range of R0.
On the basis of the data from the initial confirmed symptomatic cases of pandemic influenza A H1N1, our estimates demonstrate that the differences between the characteristics of this novel influenza virus in Guangdong Province and those of other regions are not significant. Our preliminary estimate of R0 for the initial stage is similar to that reported in the USA
• Yang Y.
• Sugimoto J.D.
• Halloran M.E.
• Basta N.E.
• Chao D.L.
• Matrajt L.
• et al.
The transmissibility and control of pandemic influenza A (H1N1) virus.
and in Shaanxi Province, China,
• Tang S.
• Xiao Y.
• Yang Y.
• Zhou Y.
• Wu J.
• Ma Z.
Community-based measures for mitigating the 2009 H1N1 pandemic in China.
but lower than the values of R0 reported in Japan
• Nishiura H.
• Castillo-Chavez C.
• Safan M.
• Chowell G.
Transmission potential of the new influenza A(H1N1) virus and its age-specificity in Japan.
and New Zealand.
• Nishiura H.
• Wilson N.
• Baker M.G.
Estimating the reproduction number of the novel influenza A virus (H1N1) in a Southern Hemisphere setting: preliminary estimate in New Zealand.
Our analyses show that potentially biased estimation of the epidemiological parameter values (γ1, γ2, δ) can overestimate or underestimate the true basic reproduction number to some degree. Therefore, it is essential that the public health agencies of Guangdong Province continue to collect high-quality epidemiological data to guarantee the accurate estimation of epidemiological parameter values. On account of calculating R0 with different combinations of epidemiological parameter values, we have full reason to believe that the possible range of R0 in Guangdong is from 1.30 to 1.85 (shown in Table 2). In the meantime, Table 2 also implies that different combinations (γ1, γ2, δ) specify different mean durations of the generation time; thus we should be careful in using the range of latent period and the mean duration of infectiousness when calculating R0. On the other hand, a reduction in the value of the relative infectiousness of the exposed class (q) could not result in the undue fluctuation of R0. This can be explained by the fact that R0 is robust to variation in the parameter q.
As with normal seasonal influenza, pandemic influenza A H1N1 in Guangdong Province showed a large proportion of mild or asymptomatic infections, similar to other regions affected by the influenza A H1N1 epidemic. Our model enables us to evaluate the impact of the proportion of asymptomatic infections on epidemiological parameter R0. However, as the epidemic progressed, necessary interventions or mitigation strategies (e.g., social distancing) could have been implemented to control the epidemic and considerably reduce the final size of the epidemic.
• Germann T.C.
• Longini Jr., I.M.
• Macken C.A.
Mitigation strategies for pandemic influenza in the United States.
• Gojovic M.Z.
• Sander B.
• Fisman D.
• Krahn M.D.
• Bauch C.T.
Modelling mitigation strategies for pandemic (H1N1).
Moreover, public concern over the pandemic might have influenced population behavior or medical practices, resulting in a significant reduction in the observed reproduction number. Therefore, our R0 could be lower than the true value for pandemic influenza A H1N1 in Guangdong Province, China. In addition, imported cases were removed from the calculations, which could have led to an overestimate of the true R0, as too much transmission was assigned to local cases.
• Kelly H.A.
• Mercer G.N.
• Fielding J.E.
• Dowse G.K.
• Glass K.
• Carcione D.
• et al.
Pandemic (H1N1) 2009 influenza community transmission was established in one Australian state when the virus was first identified in North America.

## Acknowledgements

We would like to thank the Guangdong CDC, for generous support in providing epidemiological data and insight. This work was supported by the Medical Scientific Research Foundation of Guangdong Province, China (Grant No. A2010067).
Conflict of interest: Fen Yang has received research funds from the Medical Scientific Research Foundation of Guangdong Province, China (Grant No. A2010067). The other authors declare that they have no conflicts of interest.

## References

• Diekmann O.
• Heesterbeek J.A.
Mathematical epidemiology of infectious diseases: model building, analysis and interpretation.
John Wiley and Sons, New York2000
• Wallinga J.
• Lipsitch M.
How generation intervals shape the relationship between growth rates and reproductive numbers.
Proc Biol Sci. 2007; 274: 599-604
• Bettencourt L.M.
• Ribeiro R.M.
Real time Bayesian estimation of the epidemic potential of emerging infectious diseases.
PLoS One. 2008; 3: e2185
• Mills C.E.
• Robins J.M.
• Lipsitch M.
Transmissibility of 1918 pandemic influenza.
Nature. 2004; 432: 904-906
• Chowell G.
• Nishiura H.
• Bettencourt L.M.
Comparative estimation of the reproduction number for pandemic influenza from daily case notification data.
J R Soc Interface. 2007; 4: 155-166
• Chowell G.
• Nishiura H.
Quantifying the transmission potential of pandemic influenza.
Phys Life Rev. 2008; 5: 50-77
• Anderson R.M.
• May R.M.
Infectious diseases of humans: dynamics and control.
Oxford University Press, Oxford1991
• Chowell G.
• Ammon C.E.
• Hengartner N.W.
• Hyman J.M.
Transmission dynamics of the great influenza pandemic of 1918 in Geneva, Switzerland: assessing the effects of hypothetical interventions.
J Theor Biol. 2006; 241: 193-204
• Van den Driessche P.
• Watmough J.
Reproduction numbers and sub-threshold endemic equilibria for compartmental models of disease transmission.
Math Biosci. 2002; 180: 29-48
• Diekmann O.
• Heesterbeek J.A.
• Metz J.A.
On the definition and the computation of the basic reproductive ratio R0 in models for infectious diseases.
J Math Biol. 1990; 35: 503-522
• Hyman J.M.
• Li J.
An intuitive formulation for the reproductive number for the spread of diseases in heterogeneous populations.
Math Biosci. 2000; 167: 65-86
• Tuite A.R.
• Greer A.L.
• Whelan M.
• Winter A.L.
• Lee B.
• Yan P.
• et al.
Estimated epidemiologic parameters and morbidity associated with pandemic H1N1 influenza.
CMAJ. 2010; 182: 131-136
• Chowell G.
• Fenimore P.W.
• Castillo-Garsow M.A.
• Castillo-Chavez C.
SARS outbreaks in Ontario, Hong Kong and Singapore: the role of diagnosis and isolation as a control mechanism.
J Theor Biol. 2003; 224: 1-8
• Efron B.
• Tibshirani R.J.
Bootstrap methods for standard errors, confidence intervals, and other measures of statistical accuracy.
Stat Sci. 1986; 1: 54-75
• Fraser C.
• Donnelly C.A.
• Cauchemez S.
• Hanage W.P.
• Van Kerkhove M.D.
• Hollingsworth T.D.
• et al.
Pandemic potential of a strain of influenza A (H1N1): early findings.
Science. 2009; 324: 1557-1561
• Pourbohloul B.
• Ahued A.
• Davoudi B.
• Meza R.
• Meyers L.A.
• Skowronski D.M.
• et al.
Initial human transmission dynamics of the pandemic (H1N1) 2009 virus in North America.
Influenza Other Respi Viruses. 2009; 3: 215-222
• Hien T.T.
• Boni M.F.
• Bryant J.E.
• Ngan T.T.
• Wolbers M.
• Nguyen T.D.
• et al.
Early pandemic influenza (2009 H1N1) in Ho Chi Minh City, Vietnam: a clinical, virological and epidemiological analysis.
PLoS Med. 2010; 7: e1000277
• Yang Y.
• Sugimoto J.D.
• Halloran M.E.
• Basta N.E.
• Chao D.L.
• Matrajt L.
• et al.
The transmissibility and control of pandemic influenza A (H1N1) virus.
Science. 2009; 326: 729-733
• Tang S.
• Xiao Y.
• Yang Y.
• Zhou Y.
• Wu J.
• Ma Z.
Community-based measures for mitigating the 2009 H1N1 pandemic in China.
PLoS One. 2010; 5: e10911
• Nishiura H.
• Castillo-Chavez C.
• Safan M.
• Chowell G.
Transmission potential of the new influenza A(H1N1) virus and its age-specificity in Japan.
Euro Surveill. 2009; (pii: 19227): 14
• Nishiura H.
• Wilson N.
• Baker M.G.
Estimating the reproduction number of the novel influenza A virus (H1N1) in a Southern Hemisphere setting: preliminary estimate in New Zealand.
N Z Med J. 2009; 122: 73-77
• Germann T.C.
• Longini Jr., I.M.
• Macken C.A.
Mitigation strategies for pandemic influenza in the United States.
Proc Natl Acad Sci U S A. 2006; 103: 5935-5940
• Gojovic M.Z.
• Sander B.
• Fisman D.
• Krahn M.D.
• Bauch C.T.
Modelling mitigation strategies for pandemic (H1N1).
CMAJ. 2009; 181: 673-680
• Kelly H.A.
• Mercer G.N.
• Fielding J.E.
• Dowse G.K.
• Glass K.
• Carcione D.
• et al.
Pandemic (H1N1) 2009 influenza community transmission was established in one Australian state when the virus was first identified in North America.
PLoS ONE. 2010; 5: e11341


text:
# How to write the formula of a mixed metal salt?

I suppose the formula of the Sulphate salt of Sodium & Potassium is $$\ce{KNaSO4}$$ as the Pubchem site says so.

So, is there any rule that in the formulae such mixed metal salts we need to write the metals in the order of electropositivity?

• No, AFAIR metals in mixed salts must be placed in alphabetical order. – andselisk Jun 24 at 17:03

"$$\ce{KNaSO4}$$" is correct, but not because of electronegativity order, but rather the alphabetical one. From IUPAC "Red Book", section IR-2.15 ORDERING PRINCIPLES [1, p. 40]:

IR-2.15.2 Alphabetical order
Alphabetical order is used in formulae as follows.

(a) Within the group of cations and within the group of anions, respectively, in formulae of salts and double salts. Deviations from this rule may be acceptable if it is desired to convey specific structural information, as in Example 5 below.

Examples:

1. $$\ce{BiClO}$$ (anions $$\ce{Cl-}$$ and $$\ce{O^2-})$$
2. $$\ce{NaOCl}$$ (the anion is $$\ce{OCl-},$$ cf. Section IR-4.4.3.1)
3. $$\ce{KNa4Cl(SO4)2}$$
4. $$\ce{CaTiO3}$$ (perovskite type)
5. $$\ce{SrFeO3}$$ (perovskite type)

### Reference

1. IUPAC “Red Book” Nomenclature of Inorganic Chemistry, 1st ed.; Connelly, N. G., Damhus, T., Hartshorn, R. M., Hutton, A. T., Eds.; IUPAC Recommendations; Royal Society of Chemistry: Cambridge, UK, 2005. (PDF)

format: plain


text:
Eigenvectors of half-derivative operator

The eigenvectors of the derivative operator $$D$$ are $$\exp(kx)$$, as talked about in this post and computed with Wolfram Alpha here.

The eigenvectors of $$D^2 = D \circ D$$ with eigenvalue -1 are linear multiples of sine and cosine (with the argument in radians), computed with Wolfram Alpha here.

What are the eigenvectors of the half-derivative operator $$D^{(1/2)}$$ and is to possible to even phrase the question as a differential equation?

To address a potentially relevant concern raised in the comments of this question, I don't know exactly which definition of fractional derivative I want, I'm hoping that the collection of eigenvectors of the operator itself is a property where all or most reasonable definitions of the fractional derivative agree.


text:
Ask Your Question

Revision history [back]

How to get started with Qt programming in C++ with Code::Blocks?

I have installed Code::Blocks. I also tried running qt-opensource-linux-x64-5.11.1.run file from the official site, but the installer hangs after reaching a certain amount of percentage.

How do I install Qt header files so I can develop from Code::Blocks? It's okay if I also get QtCreator. I'll also try that IDE.

Are those in Fedora repositories? What dnf packages I need to install?


text:
# Bring out the inner llama of a sentence

Your objective is to take input like

Pie is good.  I just ate a bunch of pies early this morning.  Actually, it was closer to the afternoon.  Mornings are good.

and create an array of the indexes of the string where the letters that make up the word "Llama" appear (one of each in order). For example, let me show the letters pointed at with carets to show the indexes:

Pie is good.  I just ate a bunch of pies early this morning.  Actually, it was closer to the afternoon.  Mornings are good.
^                      ^        ^                            ^        ^

So the array would look like:

[44, 67, 76, 105, 114]

(If your application uses a indexing that's not 0-based, the numbers will look different. That's fine.)

If the text has no llama, then the array should be empty, nil, null, or undefined.

Any code language is accepted. This is a contest, so the least characters win!

• @TheWobbuffet You keep changing your username and picture. There was a time when you were "Doorknob" and had his picture. Now, your pic is a sheep. You should change it to a llama. – Justin May 4 '14 at 23:11
• What about 0-based vs 1-based indexing? Can we just use the indexing used by our language or do all submissions have to conform to one convention (which one)? – Martin Ender May 4 '14 at 23:37
• @Quincunx The sheep says '42' on it! – Cilan May 5 '14 at 0:34
• @TheWobbuffet way too many maths oriented ones :-/ (Matlab, Mathematica, Julia, I don't know about R)... also Lua and Smalltalk. The only one of those relevant to code golfing would be Mathematica though, but probably not for string manipulation tasks. – Martin Ender May 5 '14 at 0:44
• Do you just want the function that does it or the whole program? Do you want the input/output code as well? – mnsr May 5 '14 at 2:17

# CJam - 33

lel"llama"{1$#)_T+:T\@>}/;]___|=*  It gets the 1-based indexes (2 more bytes for 0-based) Explanation: l reads a line from the input (replace with q for whole input) el converts to lowercase "llama"{...}/ executes the block for each "llama" letter 1$ copies the current string
# finds the index of the letter
)_ increments and duplicates
T+:T adds T (initially 0), updates T and leaves it on the stack
\@ swaps items around, now we have current-T, index, string
> slices the string starting at the index
; pops the remaining string
] gathers the indexes in an array
At this point we have all the 1-based indexes; iff any letter was not found, the array will have duplicates.
___ makes 3 more copies of the array
| (with 2 array copies) removes duplicates
= compares, resulting in 0 if there were duplicates or 1 if not
* multiplies the array 0 or 1 times accordingly

# Perl, 52 bytes

The solution is provided as function that takes the string as argument and returns a list of positions.

• One-based positions, case-sensitive search, without newlines: 52 bytes

sub l{pop=~/(l).*?(l).*?(a).*?(m).*?(a)/;@+[1..$#+]}  The case-sensitive search returns an empty array in the example of the question, because after matching the first three letters the lowercase letter m is missing in the input text. • Support of newlines: + 1 byte = 53 bytes sub l{pop=~/(l).*?(l).*?(a).*?(m).*?(a)/s;@+[1..$#+]}

The text can now span several lines.

• Case-insensitive search: + 1 byte = 54 bytes

sub l{pop=~/(l).*?(l).*?(a).*?(m).*?(a)/si;@+[1..$#+]}  Now the example in the question reports a list of index positions, they are one-based numbers: [45 68 77 106 115]  • Zero-based positions: + 9 bytes = 63 bytes sub l{pop=~/(l).*?(l).*?(a).*?(m).*?(a)/si;map{$_-1}@+[1..$#+]}  Result for the example in the question: [44 67 76 105 114]  Ungolfed: The latter variant includes more or less the other variants. sub l { # pop() gets the last argument pop() =~ /(l).*?(l).*?(a).*?(m).*?(a)/si; # the letters inbetween are matched against ".*?", # the non-greedy variant of ".*". Thus ".*?" # matches only as few as possible characters. # The modifier /i controls the case-sensitivity # and means ignore case. Without the case matters. # Modifier /s treats the string as single line, # even if it contains newlines. map {$_-1 }   # subtract 1 for zero-based positions
@+[1..$#+] # Array @+ contains the end-positions of the last # submatches, and of the whole match in the first position. # Therefore the first value is sliced away. # @+ is available since Perl 5.6. } # test my @result = l(<<"END_STR"); Pie is good. I just ate a bunch of pies early this morning. Actually, it was closer to the afternoon. Mornings are good. END_STR print "[@result]\n";  • This also assumes that the input is ASCII, or at least not full Unicode. Unless Perl's regexes correctly respect grapheme boundaries these days (they certainly did not back when I had the misfortune of using it.) – Trejkaz May 5 '14 at 13:06 • @Trejkaz: Unicode does not matter at all here: (a) "llama" is ASCII and its letters does not collide with any non-ASCII Unicode character or its byte representation in UTF-8. (b) With multi-byte encodings in mind, the term "index" in the question would be underspecified. Index can relate to the character position or the byte (storage) position. (c) Supporting any encoding with characters positions would mean, that the encoding should be known and needs to be provided as additional argument. – Heiko Oberdiek May 5 '14 at 15:38 • Your first two solutions print [] and the third prints [ ] for me (the longer ones work correctly). I'm running "perl, v5.8.8 built for msys-64int". Do you have a bug, or does it work on a different version of perl? – Tim S. May 5 '14 at 17:48 • @TimS.: [] is correct for the first solution, M is not matched in a case-sensitive search. The question is quite unclear regarding case-sensitivity. – Heiko Oberdiek May 5 '14 at 17:52 • Ok, so [] is acceptable for the first two. But the first three solutions are still not working right for me: if you give it input that should return indexes, it returns [ ] – Tim S. May 5 '14 at 17:55 # sed, 299+1 Yes, sed can find a llama. No, sed can't do math. This is the longest answer so far, at 299+1 characters, because I had to teach sed to count. This answer requires a sed with extended regular expressions (sed -E or sed -r). I used OpenBSD sed(1). Input is one string per line. (Therefore, the string may not contain a newline.) Output is a line of numbers, or nothing. Usage (+1 character for -r): $ echo 'All arms on all shoulders may ache.' | sed -rf llama.sed
1 2 12 26 30

Source code (299 characters):

s/%/z/g
s/(.*)[Aa]/\1%/
s/(.*)[Mm](.*%)/\1%\2/
s/(.*)[Aa]((.*%){2})/\1%\2/
s/(.*)[Ll]((.*%){3})/\1%\2/
s/(.*)[Ll]((.*%){4})/\1%\2/
/(.*%){5}/!d
s/[^%]/z/g
:w
s/(z*)%/\10 z\1/
s/z*$// s/z0/1/ s/z1/2/ s/z2/3/ s/z3/4/ s/z4/5/ s/z5/6/ s/z6/7/ s/z7/8/ s/z8/9/ s/([0-9]z*)z9/z\10/g s/(z*)z9/1\10/ /[%z]/bw  The program first replaces the llama with five %. (All % in this program are literal.) The first command s/%/z/g changes any % to z in the input line. The next five commands find the llama, so All arms on all shoulders may ache. becomes A%% arms on %ll shoulders %ay %che. Because each .* is greedy, I always finds the llama on the right: llama llama would become llama %%%%%. If I can't get five %, then /(.*%){5}/!d deletes the input line and skips the next commands. s/[^%]/z/g changes every character but % to z. Then I enter a loop. s/(z*)%/\10 z\1/ changes the first % to 0, copies zero or more z from left to right, and adds one more z to right. This is so the number of z will equal the index. For example, zz%zzz%... becomes zz0 zzzzzzzz%... because the first % was at index 2, and the next % is at index 8. s/z*$// removes extra z from the end of the string.

The next eleven commands count z by removing each z and counting up from 0. It counts like zzz0, zz1, z2, 3. Also, 1zzzz9 becomes z1zzz0 (later 23), or zzzz9 becomes 1zzz0 (later 13). This loop continues until there are no more % or z.

• +1 for teaching sed to count. It is easier to teach a llama to count than sed. – Andreï Kostyrka Aug 31 '16 at 15:48

## Fortran - 154 148

Fortran sucks at golfing, but just to prove that parsing strings can be done in a math-based language, I did it:

function f result(r);integer::r(5),j=1;do i=1,len(s);if(s(i:i)==a(j:j).or.s(i:i)==b(j:j)) then;r(j)=i;j=j+1;endif;enddo;if(any(r==0))r=0;endfunction

I saved a few characters by eliminating the not-required f at the end of endfunction and used if(any(r==0)) instead of if(.not.all(r>0)).

This requires:

1. s to be the string with text
2. a to be the lower-case test (i.e., llama)
3. b to be the upper-case test (i.e., LLAMA)

The full, un-golfed program is

program find_llama
character(len=123) :: s = "Pie is good.  I just ate a bunch of pies early this morning.  Actually, it was closer to the afternoon.  Mornings are good."
character(len=5) :: a="llama",b="LLAMA"

print *,f()
contains
function f result(r)
integer::r(5),j=1
do i=1,len(s)
if(s(i:i)==a(j:j).or.s(i:i)==b(j:j)) then
r(j)=i
j=j+1
endif
enddo
if(any(r==0)) r=0
end function
end program find_llama

• Modern Fortran is at least allowed on the pitch & putt areas. FORTRAN IV would still be playing crazy golf. – ClickRick May 5 '14 at 6:30
• @ClickRick: Fortran IV is something I have not learned. Not sure that I want to. Something about forced indentation and capitalization disturbs me. – Kyle Kanos May 5 '14 at 10:52

## C# - 119

Takes string, outputs array. Null if no llama in string.

int[]a(string s){var i=0;var o="llama".Select((x,y)=>i=s.IndexOf(x,y>0?i+1:0));return o.All(x=>x>=0)?o.ToArray():null;}

• +1 for x=>x>=0 – ClickRick May 5 '14 at 6:25
• I am impressed. Way smaller than any of my ideas for this one. I did find you could make it smaller by initializing i to -1 and putting the .ToArray() on the .Select statement, like so int[]a(string s){var i=-1;var o="llama".Select(x=>i=s.IndexOf(x,i+1)).ToArray();return o.All(x=>x>=0)?o:null;} – Grax32 Jul 31 '14 at 15:24

# Ruby, 5665 63

Edit: +9 characters so that it is case-insensitive.

Defines a function (lambda, technically) f.

f=->s{i=0;'LLAMA'.chars.map{|c|i=s.upcase.index(c,i+1)||break}}

Returns nil if there is no llama. If it has to be [] (empty array), then just add ||[] before the last } for a total of 4 extra characters.

innerLlama = -> str{
index = 0;
str.downcase!
arr = 'llama'.each_char.map{|char|
index = str.index(char, index + 1)
break unless index
}
# uncomment this line for empty array on failure
#arr || []
}

• I apologize for editing my question after some time, but I just added that the array, if no llama, can be nil,null,empty, or undefined. – Cilan May 5 '14 at 0:41
• So you did it with a llambda? – Mason Wheeler May 5 '14 at 3:31
• @Doorknob would be two bytes shorter by using upcase instead of downcase no? – dstarh May 5 '14 at 14:24
• @dstarh Yep, thanks – Doorknob May 5 '14 at 17:10
• Think you can get case-insensitivity a byte cheaper by doing index(/#{c}/i instead of upcase. – histocrat May 7 '14 at 15:10

# C - 53

Compile with:

gcc -D L=\"llama\" -D W=\"Lie\ is\ good.\ \ I\ just\ ate\ a\ bunch\ of\ pies\ early\ this\ morning.\ \ Actually,\ it\ was\ closer\ to\ the\ afternoon.\ \ Mornings\ are\ good.\"

I tested this compile command with cygwin's gcc. Other environments might handle spaces, and other special characters differently.

The 0-based result is stored into array r. Its contents are undefined if there is no llama in the string.

• Case-sensitive (53)

i,m,r[5];main(){for(;W[i];i++)W[i]==L[m]?r[m++]=i:i;}

• Case-insensitive (58)

i,m,r[5];main(){for(;W[i];i++)(W[i]|96)==L[m]?r[m++]=i:i;}

# JavaScript (ECMAScript 6) - 68 Characters

(/((((.*l).*l).*a).*m).*a/.exec(s)||[]).map(x=>x.length-1).reverse()

Assumes that the string to test is in the variable s. If you want to turn it into a function then prepend f=s=> (for an additional 5 characters).

Outputs:

[]

Case Insensitive - 69 Characters

(/((((.*l).*l).*a).*m).*a/i.exec(s)||[]).map(x=>x.length-1).reverse()

Outputs:

[68, 80, 93, 105, 114]

Case Insensitive & First Match - 74 Characters

(/((((.*?l).*?l).*?a).*?m).*?a/i.exec(s)||[]).map(x=>x.length-1).reverse()

Outputs:

[44, 67, 76, 105, 114]

# Python, 100

I am the worst golfer ever. :P

Thanks to @xnor for shaving off 6 bytes.

g,n,o='llama',0,[]
for i in s:
if g:exec("o+=[n];g=g[1:];"*(i.lower()==g[0])+"n+=1")
o*=len(o)>4

o contains the array after.

EDIT: Fixed.

EDIT 2: len(g) to g, o==5 to o>4 as per @xnor's suggestions.

EDIT 3: @WolframH fixed it.

• o*=(len(o)==5) is excellent. It's horrible, but I love it! – kevinsa5 May 5 '14 at 5:30
• I don't think the outer parentheses on that line are necessary. You could save two characters by removing them. – user2357112 supports Monica May 5 '14 at 6:46
• @user2357112 On that second last line? I'll remove 'em. – cjfaure May 5 '14 at 8:59
• I assume s is the input string, right? Shouldn't then s.lower be i.lower? However, that doe – Reinstate Monica May 5 '14 at 19:56
• @WolframH ah, yes, will fix tomorrow. – cjfaure May 5 '14 at 19:59

## Python 71

Assumes input in s. Output in o.

F=s.lower().find
o=F('l'),
for c in'lama':o+=F(c,o[-1]+1),
o*=min(o)>=0

Edit: Changed from lists to tuples to save 2 bytes.

• Multiplying lists by booleans is fun, isn't it? ;D – cjfaure May 6 '14 at 6:10
• I like how you dodge the problem of o needing to start nonempty to take o[-1]. Maybe it's shorter though to just start o as [-1] and later do o=o[1:]? Annoyingly, the initial -1 trips up checking if o contains -1. – xnor May 8 '14 at 7:24
• @xnor: I don't think the -1-Idea can be made to work. At least, I didn't succeed :-( However, I changed lists to tuples to save 2 bytes. :-) – Reinstate Monica May 12 '14 at 18:11

# Python 100

import re
x=input()
print[re.search(r"l.*?(l).*?(a).*?(m).*?(a)",x,re.I).start(i) for i in range(5)]

Sample:

in  = Pie is good.  I just ate a bunch of pies early this morning.  Actually, it was closer to the afternoon.  Mornings are good.
out = [44, 67, 76, 105, 114]
in[out] = ['l', 'l', 'a', 'M', 'a']

import Data.Char
l i(a:as)t@(b:bs)|a==b=i:l(i+1)as bs|True=l(i+1)as t
l _ _ _=[]
r s=l 0(map toUpper s)"LLAMA"

Ungolfed:

import Data.Char

llama :: Int -> String -> String -> [Int]
llama i (a:as) t@(b:bs)
| a==b      = i : llama (i+1) as bs
| otherwise = llama (i+1) as t
llama _ _ _ = []

runme :: String -> [Int]
runme s = llama 0 (map toUpper s) "LLAMA"

Example:

*Main> r "Pie is good.  I just ate a bunch of pies early this morning.  Actually, it was closer to the afternoon.  Mornings are good."
[44,67,76,105,114]

## Matlab, 61 96

Searches the string and replaces everything up to each match with gibberish before searching for next character. Will leave s undefined if an the word does not occur.

t='llama';for q=1:5;s(q)=min(regexpi(z,t(q))),z(1:s(q))=0;end

Note that the charcount could be reduced if case sensitivity is allowed.

Previous versions

 try;t='llama';for q=1:length(t);s(q)=find(lower(z)==t(q),1);z(1:s(q))=ones(1,s(q));end;catch;end

Searches the string and replaces everything up to each match with gibberish before searching for next character. Error handling (try-catch-end) could maybe be dropped, then the program would crash (but s would be undefined as required) if llama not found.

Implementation:

>> z='Pie is good.  I just ate a bunch of pies early this morning.  Actually, it was closer to the afternoon.  Mornings are good.';
>> try;t='llama';for q=1:length(t);s(q)=find(lower(z)==t(q),1);z(1:s(q))=ones(1,s(q));end;catch;end
>> s
s =

45    68    77   106   115

Without error handling:

t='llama';for q=1:length(t);s(q)=find(lower(z)==t(q),1);z(1:s(q))=ones(1,s(q));end

• Like the idea, have reduced charcount a bit. – Dennis Jaheruddin May 6 '14 at 12:15

Language Java

 final int[] wordIndexInSentence(String sentence, String word)
{
final int[] returnArr = new int[word.length()];
int fromIndex = 0;
word = word.toUpperCase();
sentence = sentence.toUpperCase();
for (int i = 0; i < word.length(); i++)
{
final char c = word.charAt(i);
returnArr[i] = sentence.indexOf(c, fromIndex);
fromIndex = returnArr[i] > 0 ? returnArr[i] + 1 : fromIndex;
}
return returnArr;
}

# Python (70)

r=[];c=-1
for x in'llama':c=s.lower().find(x,c+1);r+=[c]
r*=1-(-1in r)

We search of each character in 'llama' in turn, starting after the location of the previously-found character. If no character is found, c becomes the default value of -1, in which case the last line turns r into the empty list.

Edit: Found out that str.find(s,...) can be invoked as s.find(...), saving 4 characters.

# OpenEuphoria, 147128

I have two examples. First, the shortest:

object t=and_bits(gets(0),#DF),L="LLAMA",i=0,X={}for j=1 to 5 do
i=find(L[j],t,i+1)X&=i
end for
if find(0,X) then X={} end if?X

I can get it down to 126 characters if I use "or" instead of "and" like the C version does up above. However, this also matches the string ''!-! as llama. Uncommon, but still a possible error.

object t=or_bits(gets(0),96),L="llama",i=0,X={}for j=1 to 5 do
i=find(L[j],t,i+1)X&=i
end for
if find(0,X) then X={} end if?X

And then the version using regular expressions:

include std/regex.e
include std/sequence.e
include std/utils.e
object X=regex:find(new("(?i)(l).*?(l).*?(a).*?(m).*?(a)"),gets(0))
? iff(atom(X),{},vslice(X[2..6],2))

Both take input from STDIN and post to STDOUT.

EDIT: Shorter regex example:

include std/regex.e
include std/sequence.e
object X=regex:find(new("(?i)(l).*?(l).*?(a).*?(m).*?(a)"),gets(0))
if atom(X)then?{}else?vslice(X[2..6],2)end if

• Is it possible to save a few by building the regex with split/join or explode/implode, or does OpenEuphoria not have short versions of those? – Peter Taylor May 8 '14 at 9:09
• OpenEuphoria can do split/join with strings of characters, but I don't see a way to do it in a shorter manner. I'm not very good with regular expressions; the regex used here was "inspired" (shamelessly stolen) from one of the other examples on this page. – TinSoldier May 8 '14 at 13:44

# Powershell - 121 85

I'm still practicing with Powershell, expect this could be improved

$s contains the string, result is in array$a

Original version

$a=@();$w="llama";$n=$c=0;foreach ($i in$s.tochararray()) {if ($i -eq$w[$n]) {$a+=$c;$n+=1} $c+=1};$a*=$a.length -gt 4  Ungolfed $a=@()
$w="llama"$n=$c=0 foreach ($i in $s.tochararray()) { if ($i -eq $w[$n]) {
$a+=$c
$n+=1 }$c+=1
}
$a*=$a.length -gt 4

New version, with massive thanks to @goric

$a=@();$n=$c=0;[char[]]$s|%{if($_-eq"llama"[$n]){$a+=$c;$n++}$c++};$a*=$a.length-gt4

• You can remove a lot of spaces in there to shorten things up to 112: $a=@();$w="llama";$n=$c=0;foreach($i in$s.tochararray()){if($i-eq$w[$n]){$a+=$c;$n+=1}$c+=1};$a*=$a.length-gt4 – goric May 9 '14 at 19:05 • Also, you can replace foreach($i in $s.tochararray()) with [char[]]$s|%, as long as you change the subsequent $i to a $_. That shaves it down to 93: $a=@();$w="llama";$n=$c=0;[char[]]$s|%{if($_-eq$w[$n]){$a+=$c;$n+=1}$c+=1};$a*=$a.length-gt4 – goric May 9 '14 at 19:08
• Save 5 more chars by removing the $w variable altogether, since its only used once. Just inline it into the if: if($i-eq"llama"[$n]) – goric May 9 '14 at 19:14 • ..and, of course, replace your +=1s with ++s – goric May 9 '14 at 19:25 # PHP no PHP answer yet? I think a language heavily string-oriented can beat at least a math-based one function x($s){$i=$j=0;$r=str_split('llama');$s=strtolower($s);while($i<strlen($s)){if($s[$i]==$r[$j]){$r[$j]=$i;$j++;if($j>4)return$r;}$i++;}return[];}

152 against fortran 154, job done :P

ungolfed

function x($s){$i=$j=0;$r=str_split('llama');
$s=strtolower($s);
while($i<strlen($s)){
if ($s[$i]==$r[$j]){
$r[$j]=$i;$j++;
if($j>4) return$r;
}
\$i++;
}
return[];
}

if the caller always passes a lowercase string, it lowers to 137

• You need to add <? at the beginning of your code to make it valid. Sorry... – avall May 8 '14 at 7:40

# JavaScript, 122 115

function(s,b){z=[];for(i=0;i<5;i++){z.push(b=s.toLowerCase().indexOf("llama"[i],++b))};return z.indexOf(-1)<0?z:[]}

Defines a function that takes a string as its only argument (second arg is a cheap var) and returns either an empty array or a 5-element array.

Drops to 108 if I take the input on a single char variable (s) and leave the output in another (b):

var b=((z="llama".split('').map(function(a){return (b=s.toLowerCase().indexOf(a,++b))})).indexOf(-1)<0?z:[])

Edit: Swapped out map for for loop.

• ECMAScript 6 version (81 characters) - b=(z=[].map.call("llama",a=>b=s.toLowerCase().indexOf(a,++b))).indexOf(-1)<0?z:[] – MT0 May 5 '14 at 22:31

# Rebol, 97

f: func[s][a: copy[]foreach n"llama"[if none? s: find s n[return[]]append a index? s s: next s]a]

Usage example in Rebol console:

>> f "Pie is good.  I just ate a bunch of pies early this morning.  Actually, it was closer to the afternoon.  Mornings are good."
== [45 68 77 106 115]

>> f "nearly llami"
== []

>> f "Llama"
== [1 2 3 4 5]

>> f reverse "llama"
== []

Rebol uses 1-based indexing. Returns empty list [] if no llama sequence found (case insensitive).

Ungolfed:

f: func [s] [
a: copy []
foreach n "llama" [
if none? s: find s n [return []]
append a index? s
s: next s
]
a
]

# APL, 47

+\↑⊃{a s←⍵⋄~⍺∊s:⍬⍬⋄a,←n←s⍳⍺⋄a(n↓s)}/'amall',⊂⍬⍞

Not the shortest code, but quite warped, in an APL way.

Explanation

'amall',⊂⍬⍞ Make an array of 6 elements: the letters 'amall' and a subarray of 2 elements, themselves subarrays: the empty array and a line of characters read from input.

{...}/... Reduce (right-fold) the 6-element array using the provided function.

a s←⍵ Decompose the right argument into the array of indices and the remaining substring (initially the empty array and the full string.)

~⍺∊s:⍬⍬ If the substring does not contain the next letter ⍺ stop the computation and return the empty array.

a,←n←s⍳⍺ Otherwise, find its position, call it n, and append it to the array of indices.

a(n↓s) Make and return an array of 2 elements: the extended array of indices and the remaining substring.

+\↑⊃... Unpack the output of the folding, take the first element (the array of indices) and scan it with addition, to turn relative offsets into absolute ones.

Examples

      +\↑⊃{a s←⍵⋄~⍺∊s:⍬⍬⋄a,←n←s⍳⍺⋄a(n↓s)}/'amall',⊂⍬⍞
All cats meow aloud.
2 3 6 10 15

      +\↑⊃{a s←⍵⋄~⍺∊s:⍬⍬⋄a,←n←s⍳⍺⋄a(n↓s)}/'amall',⊂⍬⍞

f(s)=(m=match(r"(?i)(l).*?(l).*?(a).*?(m).*?(a)",s);m==nothing?m:m.offsets)


text:
# Rhat < 1 (as low as 9.94e-01). Why?

I keep getting Rhat below 1 (for usually about half of my parameters of interest at the level of 9.99e-01). A recent run (see below) reported Rhat < 1 for even smaller values (eg, 9.94e-01, 9.96e-01, 9.97e-01).

Anyone knows why Rhat < 1 is reported? (@bbbales2 kindly told me that Rhat in theory should be at least 1.)

4 chains: each with iter=(150,150,150,150); warmup=(0,0,0,0); thin=(1,1,1,1); 600 iterations saved.
Warmup took (10096, 10544, 10196, 9615) seconds, 11.2 hours total
Sampling took (2052, 1257, 1786, 1156) seconds, 1.74 hours total
Mean      MCSE    StdDev         5%        50%        95%     N_Eff   N_Eff/s     R_hat
lp__                1.85e+04  8.37e-01  1.28e+01   1.85e+04   1.85e+04   1.86e+04  2.35e+02  3.75e-02  1.00e+00
accept_stat__       9.85e-01  1.26e-03  2.98e-02   9.36e-01   9.95e-01   1.00e+00  5.56e+02  8.90e-02  1.01e+00
stepsize__          1.25e-02  1.04e-03  1.48e-03   1.03e-02   1.38e-02   1.39e-02  2.01e+00  3.21e-04  7.39e+14
treedepth__         9.35e+00  2.61e-01  4.78e-01   9.00e+00   9.00e+00   1.00e+01  3.35e+00  5.37e-04  1.58e+00
n_leapfrog__        7.44e+02  1.33e+02  2.55e+02   5.11e+02   5.11e+02   1.02e+03  3.67e+00  5.87e-04  1.49e+00
divergent__         0.00e+00      -nan  0.00e+00   0.00e+00   0.00e+00   0.00e+00      -nan      -nan      -nan
energy__           -1.84e+04  1.30e+00  1.87e+01  -1.84e+04  -1.84e+04  -1.83e+04  2.06e+02  3.30e-02  1.00e+00
sd_y                8.09e-02  1.97e-05  5.76e-04   8.00e-02   8.09e-02   8.19e-02  8.51e+02  1.36e-01  9.96e-01
mu_u1               1.09e-01  3.28e-04  9.21e-03   9.30e-02   1.08e-01   1.24e-01  7.88e+02  1.26e-01  9.97e-01
mu_alpha            4.07e-02  9.24e-05  2.03e-03   3.74e-02   4.09e-02   4.41e-02  4.85e+02  7.76e-02  1.00e+00
beta                5.98e-01  2.77e-04  7.70e-03   5.85e-01   5.98e-01   6.12e-01  7.73e+02  1.24e-01  9.94e-01
theta               1.52e-01  1.25e-04  3.33e-03   1.46e-01   1.52e-01   1.57e-01  7.13e+02  1.14e-01  9.96e-01
sd_season           1.03e-01  1.46e-04  4.46e-03   9.55e-02   1.02e-01   1.10e-01  9.34e+02  1.49e-01  9.99e-01
mu_season[1]       -1.29e-01  3.78e-04  1.08e-02  -1.46e-01  -1.29e-01  -1.11e-01  8.13e+02  1.30e-01  9.98e-01
mu_season[2]       -7.07e-02  4.16e-04  1.17e-02  -9.08e-02  -7.10e-02  -5.17e-02  7.85e+02  1.26e-01  9.96e-01
mu_season[3]        1.57e-01  4.38e-04  1.14e-02   1.38e-01   1.57e-01   1.76e-01  6.73e+02  1.08e-01  1.00e+00
p[1]                7.33e-01  2.27e-03  5.98e-02   6.53e-01   7.21e-01   8.45e-01  6.95e+02  1.11e-01  9.99e-01
p[2]                6.15e-01  2.14e-04  5.22e-03   6.07e-01   6.15e-01   6.23e-01  5.94e+02  9.51e-02  1.00e+00
p[3]                7.27e-01  3.25e-03  8.55e-02   6.14e-01   7.10e-01   8.87e-01  6.93e+02  1.11e-01  9.99e-01
g[1]                7.63e-01  1.53e-03  4.67e-02   6.89e-01   7.61e-01   8.40e-01  9.26e+02  1.48e-01  1.00e+00
g[2]                3.46e-01  8.71e-04  2.18e-02   3.13e-01   3.46e-01   3.82e-01  6.26e+02  1.00e-01  1.00e+00
w[1]                6.19e-01  2.94e-03  6.99e-02   5.01e-01   6.16e-01   7.37e-01  5.63e+02  9.00e-02  9.99e-01
w[2]                1.77e-01  5.86e-04  1.37e-02   1.53e-01   1.77e-01   1.99e-01  5.47e+02  8.75e-02  1.00e+00
w[3]                6.63e-01  7.81e-04  2.27e-02   6.25e-01   6.63e-01   7.03e-01  8.45e+02  1.35e-01  9.96e-01
d[1]                5.88e-02  4.62e-04  1.19e-02   4.04e-02   5.86e-02   7.82e-02  6.58e+02  1.05e-01  9.96e-01
d[2]                6.91e-01  3.78e-04  9.55e-03   6.75e-01   6.92e-01   7.07e-01  6.39e+02  1.02e-01  1.00e+00
d[3]                2.50e-01  4.23e-04  1.14e-02   2.31e-01   2.50e-01   2.67e-01  7.20e+02  1.15e-01  1.00e+00

I think that you must have misunderstood him. Rhat should be close to 1, but it doesn’t matter if it’s slightly more or slightly less than 1.

Theoretically, it should be bigger than 1, According to https://arxiv.org/pdf/1903.08008.pdf the formula is \hat{R}^2 = \frac{N-1}{N} + \frac{1}{N}\frac{B}{W}, where B and W are both non-negative. So if you get something less than one it indicates some numerical instability in the computation. But in this case I wouldn’t be hugely worried: it’s giviving values of around 0.99, so I suspect it’s just boring old rounding error. The effective sample sizes all look fine. If you didn’t get any divergences, I’d say everything is ok.

(@avehtari: should we threshold it from below at 1?)

1 Like

It’s not a problem, it’s not a rounding error, it’s just that as the B and W are estimated from finite number of draws this can be slightly less than 1 just by chance. It is more likely to observe this if you run very short chains as you are now doing with just 150 iterations. It is more likely to observe this also if you start the chains underdispersed and don’t have warmup or very short warmup.
We could threshold it so that values below 1 are reported as 1, but then we would miss warning examples like this where very shirt chains are used :)

It seems you have problems in warmup as it takes 5 times longer than the actual sampling, but that is another issue.

4 Likes

Thanks for your clear explanation. I think better to leave it as it is. I hope this post would be useful to others who also have this confusion. Perhaps, if an explanation has been documented in the manual in detail, would be great to leave a pointer here.

Yes, I’ve been struggling with this for some time now. Though not showing in the cmdstan report is that I ran warmup=800, which is about 5 times of the sampling (150). My problem is that if I don’t run so many or if I set delta below 0.99, I easily get divergences.

I use 90,000 simulated data points. If I don’t use so much, it is hard to get estimates reasonably close to the true parameter values given the model complexity. The run time here is kind of the lowest achievable by me as a novice model builder. I have already used metric=dense_e, thanks to @bbbales2’s suggestion. Otherwise, the run time is over twice longer and also the N_Eff is less than one-tenth here given the short chain of the sampling stage.

May I ask: Given the data size, is the run time still unreasonable long compared to complex models you have seen? Is there anything a novice user can still try to see if there’s a quick fix in the slow run time?

It’d be worth doing a save_warmup=1 run and plotting traceplots.

Plot a few parameters and see what’s happening. If it doesn’t look like (from a far off view) that the chains are getting to the same region of parameter space by 150-200 samples, then it might either be worth increasing the initial adaptation window (the init_buffer argument to cmdstan). Pay attention to the treedepths as well and see if there are differences in different sections of warmup. There’s a graphic of how things work in the Cmdstan manual (Figure 9.3 in the 2.18.1 manual).

1 Like

Thanks for your suggestions. I am giving a reply in my another post.


text:
MyST Quickstart Tutorial

Working with MyST Documents

Export to PDF, Word and LaTeX

🛠 Throughout the tutorial, whenever you're supposed to do something you will see a 🛠

#Start MyST 🚀

From the previous tutorial, you should already have created a myst.yml configuration file that is required to render your project. If you have not done that tutorial, type myst and follow the directions to start the server, otherwise:

🛠 Run myst start

If this is the first time you have run myst start, the theme will be installed (takes 15-30 seconds), and then bring up a local web-server that shows you a live preview of your documents as you are writing them! every time you save a few milliseconds later the server will update.

📖 Built README.md in 33 ms.
📖 Built 01-paper.md in 30 ms.
📖 Built 02-notebook.ipynb in 6.94 ms.
📚 Built 3 pages for myst in 76 ms.

✨✨✨  Starting Book Theme  ✨✨✨

⚡ Compiled in 510ms.

🔌 Server started on port 3000!  🥳 🎉

👉  http://localhost:3000  👈

🛠 Open your web browser to http://localhost:3000

To fully explore myst start see the first quickstart tutorial on . In this quickstart tutorial we will focus on creating printed documents! 📑

#Use MyST Markdown! 🎉

Next we will improve the contents of the 01-paper.md, including the frontmatter, creating a "part" for the abstract, adding citations, figures, and cross-references.

#Improve the frontmatter

🛠 Open 01-paper.md in a text editor

The start of the file includes information about the title, subtitle, author, affiliations and license. Unfortunately, this way of including this information is not easily machine-readable, and focuses more on style/typography than on metadata.

# How to MyST, without being mystified 🧙

A tutorial to evolve markdown documents and notebooks into structured data

**Authors:** Rowan Cockett1,2 \
**Affiliations:** 1Executable Books, 2 Curvenote \
**License:** CC-BY

This will produce a document that looks like:

🛠 In 01-paper.md: Change the page frontmatter into a yaml block of data:

---
title: How to MyST, without being mystified 🧙
subject: Tutorial
subtitle: Evolve your markdown documents into structured data
short_title: How to MyST
authors:
- name: Rowan Cockett
affiliations:
- Executable Books
- Curvenote
orcid: 0000-0002-7859-8394
email: rowan@curvenote.com
keywords: myst, markdown, open-science
---

In this case, we are also adding additional metadata like an ORCID, as well as ensuring the license is an SPDX compatible code. Once these are added, the myst theme (in this case the book-theme template) can make it look pretty, this can also be customized by other themes, including $\LaTeX$ and Microsoft Word templates!

We will also add data about the "parts" of our document, for example, the abstract. This will be important when we export to PDF and also visually changes the book-theme.

🛠 In 01-paper.md: surround the abstract in a block +++ {"part": "abstract"}

1
2
3
4
5
+++ {"part": "abstract"}

We introduce, a set of open-source, community-driven ...

+++

You can make other blocks, like data-availability or acknowledgements or key-points, templates will treat these differently and may require specific parts to fully render.

🛠 In 01-paper.md: find the text citation for Bourne et al., 2012 (shown in red below), and change it to a doi based citation, as shown in green below:

- ... follow the FORCE11 recommendations (Bourne _et al._, 2012). Specifically:
+ ... follow the FORCE11 recommendations [](doi:10.4230/DAGMAN.1.1.41). Specifically:

1. rethink the unit and form of scholarly publication;
2. develop tools and technologies to better support the scholarly lifecycle; and
3. add data, software, and workflows as first-class research objects.

This will result in correct rendering of the citation (such as ), and automatic insertion into the references section.

🛠 In 01-paper.md: find the text citation for Head et al. (2021), and change it to:

[](doi:10.1145/3411764.3445648)

If you have replaced both of these citations, you can now safely remove the text-only, poorly formatted references section, as that is now auto generated for you!

🛠 In 01-paper.md: Remove the ## References section with the two references (leave the links!)

This will have created a References section at the bottom of the page automatically!

🛠 In 01-paper.md: replace the image and paragraph with a figure directive.

Replace:

![](./images/citations.png)
**Figure 1**: Citations are rendered with a popup directly inline.

with:

:::{figure} ./images/citations.png
:name: citations
Citations are rendered with a popup directly inline.
:::

🛠 If you are up for it, in 01-paper.md replace the rest of the images with figure directives!

🛠 In 01-paper.md: replace the text "Figure 1" with a local link to the figure

- ... (see Figure 1).
+ ... (see [](#citations)).

The "Figure 1" text will be automatically filled in, for example, .

#Export Documents 📜

Next we will start to add information to be able to export to both PDF and Word documents!

#Microsoft Word Documents

🛠 In the 01-paper.md add export: docx to the existing frontmatter section:

---
export: docx
---

🛠 Run myst build --docx

myst build --docx

The export process will run for any known files with docx specified in the export frontmatter. An equivalent command to export only this specific file is:
myst build 01-paper.md

📬 Performing exports:
01-paper.md -> _build/exports/paper.docx
📖 Built 01-paper.md in 247 ms.
🔍 Querying template metadata from https://api.myst.tools/templates/docx/myst/default
💾 Saved template to path _build/templates/docx/myst/default
📄 Exported DOCX in 166 ms, copying to _build/exports/paper.docx

In this case, the default word template was used, resulting in a document formatted like this:

Next we will see how to change the template as well as how to add additional exports when working with $\LaTeX$ and PDF!

#Exporting to PDF

To export to PDF, MyST currently requires $\LaTeX$ to be installed. See for more information about how to install $\LaTeX$.

First, we need to decide which template to export to, for this, we will use the myst templates command, and for example list all the two-column, PDF templates available.

🛠 List all two column PDF templates with: myst templates list --pdf --tag two-column

arXiv (Two Column)       arxiv_two_column
Description: A two column arXiv compatible template
Tags: paper, two-column, preprint, arxiv, bioarxiv, eartharxiv

Volcanica                volcanica
Description: A template for submissions to the Volcanica journal
Tags: paper, journal, two-column, geoscience, earthscience

🛠 Then, list the specific information needed for a template: myst templates list volcanica --pdf

Volcanica                volcanica
ID: tex/myst/volcanica
Version: 1.0.0
Authors: Volcanica
Description: A template for submissions to the Volcanica journal
Tags: paper, journal, two-column, geoscience, earthscience

Parts:
abstract (required) - No description
acknowledgments - No description
author_contributions - No description
data_availability - Links to data repositories, and/or a statement...

Options:
article_type (choice) - Details about different article types...

In addition basic information on the template, the template's specific "parts" and "options" are shown. Some of these may be marked as (required) and be essential for the building the document correctly with the template.

🛠 In 01-paper.md: replace export: docx with a list:

---
exports:
- format: docx
- format: pdf
template: volcanica
article_type: Report
---

We have added a second export target for pdf and included additional information to specify the template, as well as set the article_type option, which is information we discovered when listing the template above! We also saw this template supports a number of "parts" including a required abstract part, but as we already added a abstract part earlier in this tutorial, we are good to go.

You can now build the exports with the following command:

🛠 Run myst build 01-paper.md

📬 Performing exports:
01-paper.md -> _build/exports/paper.docx
01-paper.md -> _build/exports/paper.pdf
🌠 Converting 3 GIF images to PNG using imagemagick
📖 Built 01-paper.md in 257 ms.
📄 Exported DOCX in 205 ms, copying to _build/exports/paper.docx
📑 Exported TeX in 5.11 ms, copying to _build/temp/myst8BVu1k/paper.tex
🖨 Rendering PDF to _build/temp/mystvUibhD/paper.pdf
📄 Exported PDF in 9.3 s, copying to _build/exports/paper.pdf

You can now see your two-column PDF in a submission ready format for the journal (check the _build/exports folder). It is very easy to change the template to a different format -- just change the template: field in the frontmatter! Notice also that the PDF has converted dynamic images to a static alternative (e.g. GIFs are now PNGs).

#Exporting to $\LaTeX$

If you would like to see the $\LaTeX$ source, you can look in the _build/temp directory, or you can update the

🛠 In 01-paper.md: replace format: pdf with format: tex. Specify the output location as a zip file.

1
2
3
4
5
6
7
8
---
exports:
- format: docx
- format: tex
template: volcanica
article_type: Report
output: arxiv.zip
---

🛠 Run myst build 01-paper.md

You should see these two additional lines:

📑 Exported TeX in 4.87 ms, copying to _build/exports/paper_tex/paper.tex
🤐 Zipping tex outputs to arxiv.zip

Without specifying the output: location, this will copy the unzipped contents into the _build/exports folder along with all other exports. Creating a zip file can be helpful when directly submitted to the arXiv or a journal!

#Conclusion 🥳

That's it for this quickstart tutorial!!

As next steps for specifically working with documents, we recommend looking at:

MyST Markdown Overview

A high-level of all of the syntax available to your for working with the MyST Markdown language.


text:
# 세미나 및 콜로퀴엄

2019-03
Sun Mon Tue Wed Thu Fri Sat
1 2
3 4 5 6 7 1 8 9
10 11 1 12 2 13 14 1 15 16
17 18 1 19 20 21 22 23
24 25 26 1 27 28 29 30
31
2019-04
Sun Mon Tue Wed Thu Fri Sat
1 1 2 3 1 4 1 5 6
7 8 1 9 10 11 1 12 13
14 15 16 17 18 1 19 20
21 22 2 23 24 2 25 1 26 1 27
28 29 1 30

구글 Calendar나 iPhone 등에서 구독하면 세미나 시작 전에 알림을 받을 수 있습니다.

The geometry and cohomology of modular curves play an important role in constructing the Langlands correspondence for GL(2,mathbb{Q}). Similarly, the tower of algebraic varieties called Shimura varieties plays an important role in the Langlands programme for reductive groups over number fields. It is then a natural question to ask if there is a ‘p-adic local analogue’ of modular curves and Shimura varieties, which is now commonly referred to as 'local Shimura varieties' or ‘Rapoport—Zink spaces'.

In this survey talk, I will try to motivate the concept of local Shimura varieties starting from the review of modular curves and introducing classical examples of local Shimura varieties (that have been known even before the general concept of local Shimura varieties emerged). If time permits, I will introduce my contribution and work in progress on constructing more general classes of local Shimura varieties.

Host: Bo-Hae Im     미정     2019-04-22 14:39:46

Circle graphs are the intersection graphs of chords on a circle; vertices correspond to chords, and two vertices are adjacent if their chords intersect. We prove that every circle graph with clique number k has chromatic number at most 4k2. Joint with James Davies.

Host: 엄상일     미정     2019-04-19 09:33:00

Recently, the classification of isoparametric hypersurfaces in spheres has been completed. Therefrom, various new research projects in geometry have been initiated. The study of minimal lagrangian submanifolds via isoparametric hypersurfaces is one of the most active projects a la mode. In this talk, we have an introduction to the study of Isoparametric hypersurfaces and minimal Lagrangian submanfolds, and discuss the relationship between them.

Host: 백상훈     미정     2019-02-25 15:44:17

The current focus of our research is to reveal fundamental design principles of the biological clock mechanism and pathogenesis of circadian disorders. We develop unique mouse models to simulate human diseases that can cause circadian disorders directly and indirectly, and unravel how the diseases compromise circadian rhythms including wake-sleep cycles, the most salient feature of circadian rhythms in animals, at the molecular level. In the first half of my talk, I will discuss how cytoplasmic congestion, normally associated with metabolic diseases and aging, can disrupt the clock mechanism and how sleep disorders in patients with these diseases can be treated at the core clock level. In the second half of my talk, I will discuss arguably the most upstream event in rhythm generation. We recently found that phosphorylation of the circadian pacemaker protein, PER is regulated by a strong Hill-type reaction, the basis of robustness in many signaling pathways. Phosphorylation kinetics of PER increases proportionally to concentration of PER: the more PER is generated, the faster PER phosphorylates, similar to O2 binding to hemoglobin. Since PER phosphorylation is considered the time-generating step, we believe this is the most upstream event and simple mutations in Per genes (SNPs) may cause sleep disorders in many humans.

Host: 김재경 교수     영어     2019-03-25 10:24:10

The circadian clock is an autonomous molecular mechanism that controls biochemical, physiological, and behavioral processes with a periodicity of 24 h in living organisms and can be entrained by environmental cues. The clock is sustained by a coordinated interplay of positive and negative transcriptional-translational feedback loops driven by circadian factors, a core group of proteins that either possess intrinsic transcriptional activity or modulate gene expression. We previously reported that the circadian factor PERIOD 2 (PER2) forms a stable complex with the tumor suppressor and checkpoint protein p53. The PER2:p53 complex undergoes time-of-day–dependent nuclear-cytoplasmic shuttling, thus generating an asymmetric distribution of each protein in different cellular compartments. In unstressed cells, PER2 mediates p53’s stability by binding to its C-terminal domain and preventing p53 from being ubiquitylated at sites targeted by the RING finger–containing E3 ligase and oncoprotein mouse double minute 2 homolog (MDM2). We found that PER2, p53, and MDM2 co-exist as a trimeric and stable complex in the nuclear compartment, although p53 is released from the complex to become transcriptionally active after cells experience genotoxic stimuli. More recently, we found that PER2 could also act as a bona fide substrate for MDM2 in the absence of p53. Indeed, PER2 was efficiently ubiquitylated in vitro and in cells at numerous sites by MDM2 in a process that was independent of PER2 phosphorylation. Accordingly, PER2’s half-life is critically influenced by the abundance and enzymatic activity of MDM2, as shown in cells in which MDM2 expression was either enhanced or silenced and its catalytic activity was pharmacologically inhibited. As a consequence, direct manipulation of MDM2 expression influenced period length by reducing PER2 stability. Our results uncover previously unknown regulatory players that likely impact our view of how other mechanisms crosstalk and modulate the clock itself. Furthermore, it exposes an uncharacterized druggable node that is often found to be deregulated during tumorigenesis.

Host: 김재경 교수     영어     2019-03-25 10:53:23

Grothendieck's $K_0$-group has an exact sequence $K_0(Z)to K_0(X)to K_0(X-Z)to 0$ for a closed immersion $Zto X$ of regular noetherian schemes, whose kernel of the leftmost map is usually nontrivial. To prolong this sequence functorially, Quillen defined higher algebraic $K$-groups as the higher homotopy groups of some mysterious category associated to an exact category. For this, we introduce simplicial sets, $Q$-construction of an exact category, higher $K$-groups of schemes, and their remarkable theorems, part of which extends the previously mentioned exact sequence for $K_0$ and relates higher K-theory with Chow groups. This is the second half of Quillen's algebraic $K$-theory.

Host: 박진현     Contact: 박진현 (2734)     한국어     2019-03-20 13:42:08

In X-ray computed tomography (CT), deep learning techniques have shown great potential for reduction of various artifacts (e.g., noise arising from low-dose, streaking artifacts due to sparse view). Most of these approaches learn the relationship between artifact images and artifact-free (ground-truth) images. However, paired training data are not generally available in clinical practice. In this talk, I will introduce simulation-based and unpaired learning methods, which can be used to circumvent such issue.

Host: 이창옥     미정     2019-04-09 09:58:14

A Boolean function is a function from the set Q of binary vectors of length n (i.e., the binary n-dimensional hypercube) to F2={0,1}. It has several applications to complexity theory, digital circuits, coding theory, and cryptography.
In this talk we give a connection between Boolean functions and Artificial Neural Network. We describe how to represent Boolean functions by Artificial Neural Network including linear and polynomial threshold units and sigmoid units. For example, even though a linear threshold function cannot realize XOR, a polynomial threshold function can do it. We also give currently open problems related to the number of (Boolean) linear threshold functions and polynomial threshold functions.

Host: 엄상일     미정     2019-04-11 09:24:29

Many modern applications such as machine learning require solving large-dimensional optimization problems. First-order methods are widely used to solve such problems, since their computational cost per iteration mildly depends on the problem dimension. However, they suffer from relatively slow convergence rates, and this talk will discuss recent progress on the acceleration of first-order methods, particularly using the close relationship between convex optimization methods and maximally monotone operators.

Host: 백상훈     영어     2019-02-25 15:43:09

Let $X$ be an abelian variety of dimension $g$ over a field $k$. In general, the group $textrm{Aut}_k(X)$ of automorphisms of $X$ over $k$ is not finite. But if we fix a polarization $mathcal{L}$ on $X$, then the group $textrm{Aut}_k(X,mathcal{L})$ of automorphisms of the polarized abelian variety $(X,mathcal{L})$ over $k$ is known to be finite. Then it is natural to ask which finite groups can be realized as the full automorphism group of a polarized abelian variety over $k.$

In this talk, we give a classification of such finite groups for the case when $k$ is a finite field and $g$ is a prime number. If $g=2,$ then we need a notion of maximality in a certain sense, and for $g geq 3,$ we achieve a rather complete list without conveying maximality.

Host: Bo-Hae Im     한국어 (필요한 경우 영어 가능) ( )     2019-02-18 12:43:14

Finite element discretization of solutions with respect to simplicial/cubical meshes has been studied for decades, resulting in a clear understanding of both  the relevant mathematics and computational engineering challenges. Recently, there has been both a desire and need for an equivalent body of research regarding discretization with respect to generic polygonal/polytopal meshes. General meshes offer a very convenient framework for mesh generation, mesh deformations, fracture problems, composite materials, topology optimizations, mesh refinements and coarsening; for instance, to handle hanging nodes, different cell shapes within the same mesh and  non-matching interfaces. Such a flexibility represents a powerful tool towards the efficient solution of problems with complex inclusions as in geophysical applications or posed on very complicated or possibly deformable geometries as encountered in basin and reservoir simulations, in fluid-structure interaction, crack propagation or contact problems.

In this talk,  a new computational paradigm for discretizing PDEs is presented via staggered Galerkin approach on general meshes. First, a class of locally conservative, lowest order staggered discontinuous Galerkin method on general quadrilateral/polygonal meshes for elliptic problems are proposed.  The method can be flexibly applied to rough grids such as highly distorted  meshes. Next, adaptive mesh refinement is an attractive tool for general meshes due to their flexibility and simplicity in handling hanging nodes.

We derive a simple residual-type error estimator.  Numerical results indicate that optimal convergence can be achieved for both the potential  and vector variables, and the singularity
can be well-captured by the proposed error estimator.  Then, some applications to diffusion equations, Stokes equations, and linear elasticity equations are considered.
Finally, we comment on the possibility of extending this approach to high-order polynomial approximations on general meshes.
Host: 김재경     영어     2019-02-25 15:42:05

Goldman parametrizes the $mathrm{PSL}_3(mathbb{R})$-Hitchin component of a closed oriented hyperbolic surface of genus $g$ by $16g-16$ parameters. Among them, $10g- 10$ coordinates are canonical. We prove that the $mathrm{PSL}_3(mathbb{R})$-Hitchin component equipped with the Atiyah-Bott-Goldman symplectic form admits a global Darboux coordinate system such that the half of its coordinates are canonical Goldman coordinates. To this end, we establish a version of the action-angle principle and show that the Hitchin component can be decomposed into a product of smaller Hitchin components.

Host: 백형렬     영어     2019-03-29 09:06:35

Grothendieck's $K_0$-group has an exact sequence $K_0(Z)to K_0(X)to K_0(X-Z)to 0$ for a closed immersion $Zto X$ of regular noetherian schemes, whose kernel of the leftmost map is usually nontrivial. To prolong this sequence functorially, Quillen defined higher algebraic $K$-groups as the higher homotopy groups of some mysterious category associated to an exact category. For this, we introduce simplicial sets, $Q$-construction of an exact category, higher $K$-groups of schemes, and their remarkable theorems, part of which extends the previously mentioned exact sequence for $K_0$ and relates higher K-theory with Chow groups. This is the first half of Quillen's algebraic $K$-theory.

Host: 박진현     Contact: 박진현 (2734)     한국어     2019-03-20 13:40:54

Millions of Korean workers follow night or nonstandard shifts. A similar number of Koreans travel overseas each year. This leads to misalignment of the daily (circadian) clock in individuals: a clock that controls sleep, performance, and nearly every physiological process in our body. A mathematical model of this clock can be used to optimize schedules to maximize productivity and minimize jetlag. We simulate this model in a smartphone app, ENTRAIN (www.entrain.org), which has been installed in phones over 200,000 times in over 100 countries. I will discuss techniques we have been developing and clinically testing to determine sleep stage and circadian time from wearable data, for example, as collected by our app or used in many commercially available sleep trackers. This project has led us to develop new techniques to: 1) estimate phase from noisy data with gaps, 2) rapidly simulate of population densities from high dimensional models and 3) determine how mathematical models of sleep and circadian physiology can be used with machine learning techniques to improve predictions.

Host: 김재경 교수     영어     2019-03-19 10:06:51

Algebraic K-theory originated with the Grothendieck-Riemann-Roch theorem, a generalization of Riemann-Roch theorem to higher dimensional varieties. For this, we shall discuss the definitions of $K_0$-theory of a variety, its connection with intersection theory, $lambda$-operation, $gamma$-filtration, Chern classes and Adams operations.

Host: 박진현     Contact: 박진현 (2734)     한국어     2019-03-12 21:51:19

I report on work with M. Gubinelli and T. Oh on the
renormalized nonlinear wave equation
in 2d with monomial nonlinearity and in 3d with quadratic nonlinearity.
Martin Hairer has developed an efficient machinery to handle elliptic
and parabolic problems with additive white noise, and many local
existence questions are by now well understood. In contrast not much is
known for hyperbolic equations. We study the simplest nontrivial
examples and prove local existence and weak universality, i.e. the
nonlinear wave equations with additive white noise occur as scaling
limits of wave equations with more regular noise.

Host: 권순식     영어     2019-02-25 15:40:28

It remains  to bound the terms on the expansion of the logarithm of the
transmission coefficient.

I report on joint work with Mihaela Ifrim, Xian Liao and Daniel Tataru.

Host: 권순식     미정     2019-03-04 09:47:21

A result due to Gyárfás, Hubenko, and Solymosi, answering a question of Erdős, asserts that if a graph G does not contain K2,2 as an induced subgraph yet has at least c(n2) edges, then G has a complete subgraph on at least c210n vertices. In this paper we suggest a “higher-dimensional” analogue of the notion of an induced K2,2, which allows us to extend their result to k-uniform hypergraphs. Our result also has interesting consequences in topological combinatorics and abstract convexity, where it can be used to answer questions by Bukh, Kalai, and several others.

Host: Sang-il Oum     영어     2019-03-04 13:50:46

The Gross-Pitaevskii equation is essentially the defocusing nonlinear
Schrödinger equation with a nonzero boundary condition at infinity. This
makes the phase space very nonlinear and we will need a good metric and
smooth structure on it.

Host: 권순식     미정     2019-03-04 09:45:39
Host: 정연승     한국어     2019-02-25 15:37:33