David N Margolis

Lucas Navarro

David A Robalino

Unemployment Insurance, Job Search and Informal Employment

Keywords: Unemployment insurance, Informal sector, Self employment, Job search JEL Codes: J64, J65, O17, J23, J31, J21, J62

This paper analyses the potential impacts of introducing unemployment insurance (UI) in middle income countries using the case of Malaysia, which today does not have such a system. The analysis is based on a job search model with unemployment and three employment sectors: formal and informal wage employment, and self employment. The parameters of the model are estimated to replicate the structure of the labor market in Malaysia in 2009 and the distribution of earnings for informal, formal and self employed workers. The results suggest that unemployment insurance would have only a modest negative effect on unemployment if benefits are not overly generous. The main effect would be a reallocation of labor from wage into self employment while increasing average wages in the formal and informal sectors.

Introduction

In developing countries, income protection in the case of unemployment is mainly provided through severance pay, which is regulated by the labor code. These systems cover only a minority of the labor force, are difficult to enforce, and carry considerable risk of default, particularly during times of crisis, given that employers seldom provision for the benefits (Holzmann et al., 2011). Meanwhile, only a few countries have introduced contributory unemployment benefit programs. Part of the reason is the concern that traditional unemployment insurance systems (or providing basic unemployment assistance) can lead to abuse, promote unemployment, and generate large fiscal outlays, particularly in the presence of informal employment and weak institutional capacity to monitor job-search and employment status.

The empirical evidence, mainly coming from high income countries, is mixed. 1 In general, studies find that there is a positive correlation between the level and duration of benefits and the length of the unemployment spell, which can lead to higher unemployment rates. At the same time, evidence from Denmark, France, Germany, Italy, Ireland and Spain shows that longer unemployment spells can also be associated with "better matches"; workers are able to find better and more stable jobs. (Tatsiramos, 2009) Less is known about the effects of unemployment insurance in developing countries. The few studies available would suggest that effects on the duration of unemployment spells and employment levels are modest. Two studies for Brazil find no quantitatively meaningful effect of the UB system on the duration of unemployment spells. The first exploited changes in eligibility conditions and showed that, if anything, unemployment benefits allowed faster transitions into self employment (Cunningham, 2000). A second compared the exit rates from unemployment among formal sector workers (eligible for unemployment benefits) and informal sector workers (not eligible for unemployment benefits). It showed that the former had higher exit rates even after controlling for unobserved characteristics that are correlated with work in the formal sector (Margolis, 2008). At the other extreme, van Ours and Vodopivec (2008) show that in the case of Slovenia, the shortening of the potential duration of UI benefits substantially reduced the length of the unemployment spell. A more recent paper based on a structural model for Brazil finds the unemployment insurance system mainly reduces transitions into informal jobs (Robalino et al., 2011).

This paper analyses the potential impacts of introducing an unemployment insurance (UI) system in Malaysia, which currently has no such system. The analysis is based on a structural job search model with unemployment and three employment sectors: formal and informal wage employment, and self employment. The parameters of the model are estimated to replicate the structure of the labor market in Malaysia in 2009 and the distribution of earnings for informal, formal and self employed workers. The model is used to simulate the effects of alternative unemployment benefit system designs that depend on the replacement rate, the vesting period for benefits, the duration of benefits, and the contribution rate. We look at changes in the shares of individuals across employment states, the unemployment rate, and average earnings by sector.

The results suggest that an unemployment insurance system in Malaysia would have only a modest negative effect on unemployment if benefits are not overly generous. The system would induce a reallocation of labor from wage into self employment while increasing average wages in the formal and informal sectors. The effects on the average earnings of the self employed would depend on the generosity of the system. With a 50% replacement rate, most workers entering self employment would be low skilled workers, driving average earnings down. High skilled workers would change behavior significantly with more generous systems. As they remain unemployed for longer, wage employment offers fall, and a larger share enters self employment, driving up average earnings among the self employed. Although the analysis focuses on Malaysia, the results are likely to be relevant for other middle income countries, particularly in Latin America, which share similar demographic, levels of education and labor market structures.

The remainder of this paper is structured as follows. Section 2 provides a brief description of the Malaysian labor market, while 3 lays out a 4-state (unemployment, self employment, formal wage and salary employment, informal wage and salary employment) job search model . Section 4 describes the data used for the estimations, section 5 covers the reduced form and simulated pseudo method of moments estimation results, while section 6 presents the microsimulation results. Section 7 concludes.

Overview of Current Malaysian Labor Markets

Over the last decade both employment and labor productivity have been growing in Malaysia. (see figure 1). Between 2000 and 2008 the adult population grew by an average of 2.6 percent annually over this period, while employment grew by an average of 2.8 percent per year and labor productivity grew on average by 3.7 percent.

Similar to middle income countries in Latin America, Malaysia has a young and relatively well educated working age population. Over 60 percent of the working age population is under 40 years old, and over 35 percent was under 25 years old.2 About 57 percent of the workforce has some form of secondary education certification and 14.4 percent of the population has a post-secondary certification, with over 5 percent having a tertiary education degree. However, there are clear regional disparities; for example, the working age population in East Malaysia, especially the states of Sabah and Labuan, is much less educated than that of Peninsular Malaysia. 3 The differences in compensation, hours worked and formality levels 4 among population groups (sex, region, age, level of education, and sector of activity) are also important (Table 2). Men are more likely to be in formal jobs (55 percent) than women (48) and also earn more -men's base monthly compensation is on average 17 percent higher than women's. Not surprisingly, education is an important determinant of labor market outcomes. Only 25 percent of those with primary education or less are in formal employment against 44 percent for those with secondary education and 68 percent for those with higher education. One explanation consistent with the model developed below is that formal contracts are not for low productivity workers, who end-up working in low productivity activities often in small firms in the informal sector or as self employed. Thus 3 Forty percent of the working age population of Sarawak has at most a primary education, while the number rises to 47 percent for Sabah/Labuan. Conversely, nearly 60 percent of the working age population in Peninsular Malaysia has a secondary degree (compared with 52 percent in Sarawak and 43.3 percent in Sabah/Labuan) and 15.6 percent have a post-secondary certification (compared with 8.1 percent in Sarawak and nearly 10 percent in Sabah/Labuan).

4 For the purposes of the data work in this report, employment in the "formal sector" is defined as holding a job for which the employer makes Employer's Provident Fund (EPF) or Social Security (SOCSO) contributions. By this definition, self employed individuals who are not required to contribute are considered to be"informal", and this definition will also classify some teachers or health workers employed by the public sector as informal, since their employer is not required to contribute to EPF and SOCSO on their behalf. there are large difference in earnings: the average worker with higher education earns five times more than the average worker with primary education or less.

The Model Framework

Search and matching models have been extensively used for the analysis of the quantitative effect of labor market policy. In this paper we adapt the Diamond-Mortensen-Pissarides style of dynamic job search model (Pissarides, 2000) to fit the situation of labor markets with large informal sectors.

In this type of model, unemployed individuals engage in job search activity and the decision to accept a job depends on the value of the job, which is itself a function of the job's stability and the opportunity cost of not being able to search for a better job while employed. This sort of model has been extensively analyzed and some recent extensions of this framework have introduced informal labor markets and self employment (Albrecht et al., 2009). This paper continues in this literature by integrating both an informal sector and self employment, although it does not solve analytically for the equilibrium labor market tightness and the shares of offers from the formal and informal sector wage employers. Appendix A describes the basic structure of the model. 5 The model defines a set of value functions for different labor market states and a wage determination mechanism. The model is solved numerically in section 5.

Unemployment Value Function

Let U (y, w) be the value of unemployment for a worker of type y, which can be written as

rU (y, w) = b ( w) + α max [N 0 (y) -U (y, w) , 0] + m (θ) ψE max [N I (x, y) -U (y) , 0] + m (θ) (1 -ψ) E max [N F (x, y) -U (y, w) , 0] . (1)
This worker receives a flow utility of b ( w), where w is the wage on the previous job, while unemployed. 6,7 At a rate α, the worker meets an opportunity for self employment and, if it is taken, 5 See Margolis et al. (2011) for the full structural model with expressions for equilibrium employment rates in each sector and wage distributions.

6 For simplicity of exposition, it is assumed that all ex-workers, including self employed and informal sector workers, can draw unemployment benefits, as a function of their earnings prior to unemployment. This assumption is relaxed in the numerical simulations, where the replacement rate for unemployment spells following self employment or informal wage employment is set to zero. 7 It is assumed that individuals can only receive unemployment benefits when unemployed, i.e. not when self employed or in informal employment. This implies significant enforcement capacity on behalf of he government, which may not be appropriate. We discuss the implications that relaxing this assumption might have in section 6. realizes a capital gain of N 0 (y) -U (y, w). The matching function m (θ) = aθ β determines the probability of an individual meeting a vacancy for a wage and salary job, with θ being the ratio of vacancies to unemployment (i.e. a measure of labor market tightness). Conditional on meeting a vacancy, a worker meets a formal sector vacancy with probability 1 -ψ and an informal sector vacancy with probability ψ. If the job is taken, the worker realizes a capital gain of N j (x, y)-U (y, w).

The employment value functions consider that the initial flow value of the match is given by the sector-specific productivity x, which varies across individuals and sectors (formal and informal).

Self Employment Value Function

Let N 0 (y) be the value of self employment for a worker of type y, which can be written as

rN 0 (y) = y + λ 0 (U (y, y) -N 0 (y)) . (2)
This expression shows that the self employed receives a flow value equivalent to her type y, but at rate λ 0 the opportunity ends in which case there is a (negative) capital gain of U (y, y) -N 0 (y).8

Wage and Salary Sector Value Functions

Let N F (x, y) and N I (x, y) be the values of employment in the formal sector and informal salaried sector, respectively, for a worker of type y with a draw x from the sector-specific productivity distribution. The flow values of these jobs can be written as

rN F (x, y) = w F (x, y) + λ F (U (y, w F (x, y)) -N F (x, y)) (3) rN I (x, y) = w I (x, y) + λ I (U (y, w I (x, y)) -N I (x, y)) , (4)
respectively. A worker of type y who has a formal sector job receives a wage w F (x, y) determined by Nash bargaining. Idiosyncratic shocks that destroy the match and send the individual back to unemployment arrive at rate λ j . A similar idea applies to the value of employment in the informal wage sector.

Employer-Side Value Functions

Let V j and J j (x, y) be the value of the expected profit of posting a vacancy and the value of a filled job in sector i ∈ {F, I}. The filled job values can be written as

rJ F (x, y) = x -w F (x, y) (1 + τ ) + λ F (V F -J F (x, y) -s) rJ I (x, y) = x -w I (x, y) + λ I (V I -J I (x, y)) .
Regulations affecting the formal sector filled job value are payroll taxes τ and severance payments s. Note that regulations do not affect J I (x, y) but the flow value of productivity therein is x, where < 1.

The values of formal and informal sector vacancies, V F and V I , are defined respectively by

rV I = -c + m(θ) θ E max[J I (x, y) -V I , 0] (5) rV F = -c + m(θ) θ E max[J F (x, y) -V F , 0].
The expectation term in ( 5) reflects the assumption that the firm does not know in advance which type of worker it will meet.

Wages

As standard in this literature, a surplus is realized when a match is formed. This surplus is given by the net gain from matching for both the firm and the worker, that is, N s (x, y)-U (y)+J s (x, y)-V s .

Wages are determined by rent sharing over the surplus of the match. A wage is a solution to a generalized Nash Bargaining problem with threat points equal to the worker's and the firm's respective continuation values. Given an exogenous share parameter β and the free entry condition (V j = 0), the formal contract wage w F (x, y) for a worker of type y producing at x solves max

w F (x,y) [N F (x, y) -U (y)] β [J F (x, y) + s] 1-β which implies, w F (x, y) = β (x + rs) 1 + τ + (1 -β)rU (y). (6)
Similarly, the informal wage w I (x, y) solves max

w I (x,y) [N I (x, y) -U (y)] β J I (x, y) 1-β ,
and the wage function can be written as

w I (x, y) = β x + (1 -β)rU (y). ( 7
)
The wage in sector i is the weighted average of the worker's productivity and the worker's outside options. Of course, regulations affect the formal wage bargaining process.

The Data

The model is estimated on two separate data sources from Malaysia, the Household Income Survey,9 or HIS, and the Labor Force Survey with the Wages and Salaries Supplement,10 or LFS. These data sources are complementary in that neither source is perfectly suited for estimation of the model presented in section 3, but the limits of each source can be compensated by the advantages of the other. Both data sources are thus used to estimate different components of the model, and as both surveys are designed to be representative of the same population (and sample weights are always used), no further correction for sampling is necessary11 .

The Household Income Survey (2009)

The HIS is a household survey that is representative of the population of Malaysia that does not live in collective housing.12 It is comprised of 4 components: basic identification, sociodemographic characteristics of the household members, basic information on activity status and sources of income.

The HIS is particularly useful for the purposes of this paper because it allows for separate measurement of income from paid employment and self employment income. In terms of income from paid employment, the survey distinguishes between the various components and separately measures employer contributions to social security, pensions, etc. on the worker's behalf. 13 It does not, however, directly measure the amount received in severance payments. 14 In terms of self employment income, it allows for the separation of total self employment earnings into own consumption use and income, with the latter being broken into agricultural and non-agricultural self employment earnings.

There are two main difficulties with using exclusively the HIS for this paper. First, the information on labor market status does not specifically designate unemployment as a labor market state. The available categories are: It is therefore impossible to calculate the share of the work force in each state as defined by out model, unless one assumes that all codes other than 1-4 are unemployed.

Second, the survey collects data referring to the previous year's values, so the questions on activity status are phrased as What did ......... (usual member) ......... do MOST OF THE TIME during the last twelve (12) months? and the income questions refer to all income received during the previous year. There is no calendar, so it is impossible to know whether a low amount of earnings is due an individual working part of the year or being poorly paid for a full year of work. Moreover, and more importantly for the estimation of the model in section 3, it is impossible to measure the length of employment and unemployment spells.

The Labor Force Survey with the Wages and Salaries Supplement (2009)

The LFS is a standard labor force survey, focusing on the working age population that does not live in collective housing. The LFS has 3 components: identification, household member characteristics and labor force particulars. The wages and salaries supplement provides additional information on income for government and private employees only.

The main advantage of the LFS over the HIS is that its "labor force particulars" component is more thorough than that of the HIS. Questions are asked relative to the reference week, ILOstandard unemployment definitions are used, and there is enough information to calculate the distribution of unemployment durations within the stock of unemployed. 15 Unfortunately, the income component of the LFS is not as rich as the HIS. In particular, there is no information on earnings from any source other than wages, salaries and overtime payments. This implies that the data cannot be used for estimating y directly, as self employment earnings cannot be seen. Moreover, the wages and salaries supplement measures gross earnings but provides no means of quantifying the value of employer or employee contributions to social insurance, implying that one cannot distinguish formal from informal wage and salary work from this data source.

Estimation

The structural parameters of the model were estimated by a simulated pseudo-method of moments procedure as follows. A reduced form model was estimated to recover values of y for each individual in the population, as well as the distributions G F (x |y ) and G I (x |y ). With this information, careers were simulated as follows. Starting from unemployment, the individual receives self employment offers, formal job offers and informal job offers, and accepts or refuses them according the behavior dictated by the value functions in section 3. When self employed, formally employed or informally employed, job destruction shocks arrive with probabilities λ 0 , λ F and λ I respectively. Each individual's transitions and wages were repeatedly simulated until the simulations converged to a stable share of the population in each labor market state and stable wage distributions within the formal and informal employment states. The structural parameters of the model were adjusted until the steady state shares in each labor market state and the steady state wage distributions matched those found in the data, at which point the model was considered to have converged.

It is important to stress that the full structural model was not estimated, meaning that the parameters and the distribution of y variables recovered is robust to certain functional form assumptions. 16 The simulations do exploit the functional forms of expressions 1, 2, 3 and 4, and the productivity draws are assumed to come from logistic distributions. However, the steady state version of the model is not solved analytically nor is it structurally estimated.17 It is also worth noting that the income variables used in the estimation are those drawn from a data source that reflects annual incomes rather than monthly, weekly or hourly earnings. The absence of data on earnings in self employment prevented us from using the Malaysian LFS for all individuals, and mixing data sources for measurement of a single variable is not good practice.

The remainder of this section describes how each of the steps was performed.

Direct recovery of parameters and population moments

There are several key parameters of the model that can be directly recovered from the data.

• τ , the payroll tax rate for workers in the formal sector. As mentioned in section 4.1, the Household Income Survey (HIS) data allows for separate measurement of gross compensation and and employer contributions to social insurance. It is therefore straightforward to calculate τ = Total Compensation Cost Gross Compensation -1 = 0.123.

• Share of population in each employment state (Unemployment, Formal Employment, Informal Employment and Self Employment). As mentioned in section 4, the HIS does not allow for the identification of unemployment while the Labor Force Survey (LFS) does not allow one to distinguish formal from informal wage and salaried employment. However, the estimation strategy only requires the shares of the active population in each employment state, not the identification of the employment state for any particular individual. Accordingly, the shares in unemployment (0.0202), self employment (0.2140) and wage and salary employment (0.76857) were calculated directly from the LFS. The share of wage and salary employment that is in the formal sector (0.6451) was calculated directly from the HIS. This latter share was multiplied by the share in wage and salary employment to obtain the population share in formal employment (0.4940) and the share in informal employment (0.2717).

• Mean and variance of log earnings in the formal, informal and self employment sectors. These values were calculated directly from the HIS data, with the following results.

Recovery of y for All Sampled Individuals

According to the model, individuals in self employment earn the value of their type, y i . This implies that one can use observed income of those in self employment to characterize the determinants of an individual's type, and use this estimation to recover an estimate of the (unobserved) type for each person in the rest of the population, namely the unemployed and those in wage and salary employment.

Worker type is assumed to be a function of observed characteristics 18 Z i , i.e.

y i = Z i γ (8)
However, we further assume that there can be idiosyncratic shocks that affect the income an individual draws from her self employment at a point in time, and these shocks can be written as ν ∼ N (0, σ ν ). This implies that the income equation from self employment takes on a standard Mincerian form, namely

w SE i = y i + ν i = Z i γ + ν i (9)
As suggested by section 3, being observed in employment is the result of an optimization decision conditional on benefits received in unemployment, the income drawn from self employment, the riskiness of self employment, the likelihood of getting a formal or informal sector job offer and the wages and job stability associated with those offers. This implies that the set of individuals actually observed in self employment is a selected sample, so estimation of equation 9 requires a correction for selection bias. The selection into self employment is thus modeled as a function of observables 19 A, and we adopt the standard Heckman (1979) formulation for estimation of the vector γ. The results of this estimation are found in table 9 in the appendix. These results are used to estimate the value of of y for all individuals in the sample, including those not observed in self employment.

Estimation of the distributions of sector specific productivity draws G I (x |y )

and G F (x |y )

The distributions G j (x |y ) , with j ∈ {Formal, Informal} , are assumed to be logistic with mean equal to y + kj , where kj is a form of unobserved individual-specific heterogeneity that shifts the mean of the x distribution. It is assumed that kj is a Bernoulli-distributed random variable.

Recovering these distributions (one each for formal and informal wage employment) requires four step procedure:

1. Using the same determinants of wages as were used in the recovery of y from the self employed, estimate the part of wages that is not due to y;

2. Recover the part of this residual that is explainable by "unobserved" characteristics, and use this to characterize the distribution of the heterogeneity component kj ;

18 The explanatory variables included in Z that determine human capital are the highest degree obtained (7 levels), sex, age, age squared and indicators for the state of residence (16 levels). 19 The variables included in the A vector are limited by the relatively limited set of variables available in the LFS and HIS. Accordingly, the A vector includes the same variables as in Z, plus marital status (5 levels) and relation to household head (10 levels).

3. Recover the value of the draw that is added to the mean y + kj ; and 4. Calculate the distribution of these draws.

One first needs to estimate the relation between wages and y. 20 Since wages are not observed for each individual in every sector, recovery of the distributions of x begins with estimation of sector specific Mincer equations. 21 This estimation represents the first step in recovery of the unobserved heterogeneity and x distributions.

The first-stage residuals of these Mincer regressions are decomposed into a component that is explainable by the full set of variables, including the instruments that are considered "unobservables" for the purposes of the wage equation, and an orthogonal second-stage residual component. The expected first-stage residuals are divided into two groups at the median. The average predicted residual for each subgroup is calculated, the mean for the smaller half of the observations is subtracted from the expected wage resulting from the first stage regression (to normalize the support of the k j distribution to 0 and a positive value) and their difference becomes the estimator of k j , 22 each of which occurs (by construction) with probability 0.5.

The result of these calculations is a distribution (centered around y or y + k j ) of means for the draws from the x distribution. Subtracting this mean from the observed wage gives an estimator of the value of the draw from the x distribution. 23 The variance of the estimators for each distribution 20 In the model outlined in section 3, the wage is the result of Nash bargaining over the surplus of the employment relation between the employer and the individual. The surplus is a proportional to x, and the result of the bargaining gives a share of the surplus to the individual in the form a wage that must exceed the individual's outside option. These expressions imply that the relation between the wage and x is linear; see Margolis et al. (2011) . Since this paper does not need to provide a structural interpretation to the intercept or slope parameters of the linear relation in order to apply the simulation estimator, one can simply recover the mean and variance of the distribution of w, which will themselves be linear functions of the underlying (and unknown) mean and variance of x, and use these estimated parameters in the simulations.

21 Note that although selection into employment in each sector is an issue, as it was for self employment, there exist no valid exclusion restrictions for estimating a selection corrected mincer equation. This is because the wage is the result of bargaining between the worker and employer, whereas in self employment it was only a function of the individual's type and a shock. The bargaining dimension implies that wage outcome will depend on the value of the surplus, which itself is a function of all of the same factors that determine selection into one sector or the other. This dependence is modeled as affecting the distribution of kj, namely P kj = 0 = 1 -Φ (Aiκj) and P kj = kj = Φ (Aiκj). The estimation of the sector specific Mincer equations can thus be written as w j i = Ziγ j +ν j i . The results of these models are found in table 10 in the appendix. 22 The estimates are kF = 3.167 * 10 -3 and kI = 1.407 * 10 -4 . 23 More precisely, as noted in equations 6 and 7, the wage is a linear transformation of the (rescaled) reservation utility and a draw from the x distribution. As the reservation utility depends on the expected wage, which is a function of y + kj, the draw of x can be approximated by the difference between the observed wage and y + kj. This is calculated and converted into a scale parameter for each sector's distribution of x draws. For the formal sector, this gives 20.726 as the variance of the logistically distributed shock, or a scale parameter for a logistic distribution of 3var(x) π 2 = 2.510 and for the informal sector this gives 20.227 as the variance of logistically distributed shock and a scale factor of 3var(x) π 2 = 2.480.

Recovery of the remaining parameters by simulated pseudo method of moments

The simulation focuses on a sample of 500 individuals drawn from the distributions of y i and x i 24 as estimated in the previous section, where i indexes the individual and s the sector (formal, informal, or self employment). Figure 2 describes the distribution of y in the population. At the beginning of the simulation all workers are unemployed and the number of vacancies is equal to the number of unemployed. As noted in section 3.1, the matching function m (θ) = aθ β determines the probability of an individual meeting a vacancy, with θ being the ratio of vacancies to unemployment (i.e. a measure of labor market tightness). Contracts are only agreed upon when both profits are positive and the flow value of a given job offer is higher than the value of unemployment. The micro simulation model follows over time (monthly) each of the individuals in the sample, who are characterized by y i and x i . Through aggregation, the model generates steady state distributions for variables of interest: the current unemployment rate in Malaysia; the shares of approximation is best when β = 1.

24 For consistency in the simulations, the productivity draws x are assumed to be the same across firms within the same sector for a given individual.

informal, formal, and self employment; as well as the mean and variance of the log of earnings for each type of job. To conduct policy simulations, we have to estimate 7 parameters in order to match these distributions. The parameters are: job destruction rates (3); the share of informal vacancies; the arrival rate of job opportunities for self employment; the bargaining power coefficient; and the scale factor in the matching function. The identification of the model parameters is based on the minimization of the following function in the absence of an unemployment benefit system:

25 3 j=1 s j -s * j 2 + w j -w * j 2 + v j -v * j 2 (10)
where s j is the share of the labor force working in sector j, w i is the average of log wages across individuals working in the sector, v j is the variance, j=1: informal, 2:formal, 3:self employed, and a * indicates the targeted values of the variable, estimated from the data. The values of the recovered parameters,26 conditional on the sample of individuals drawn, are presented in Table 4. 27 The model is able to closely reproduce the employment shares but predicts higher wages for informal sector workers than found in the data, as seen in Table 5. We find job destruction rates ranging between 1 and 5% per month, the lowest in formal sector and the highest in the informal sector. The arrival rate of opportunities in self employment is close to 8% per month whereas the share of informal job offers is close 40%. Finally, for the sample of individuals drawn, workers appear to have a relatively high bargaining power (> 0.7) but below what would be observed in a perfectly competitive market.

Microsimulations of Policy Experiments

Based on the estimated parameters several policy experiments were conducted to assess the labor market impact of introducing an unemployment insurance system.

We considered 25 types of unemployment insurance systems based on variations in the values of the following policy parameters: the replacement rate; the contribution rate to the system (assumed to be paid by the employer); the vesting period (i.e., the number of contributions necessary to qualify for benefits); the duration of unemployment benefits. Although the last two are inconsistent with a literal interpretation of the model in section 3, they are nevertheless closer to situations found in the real world. The implicit assumption here is that workers are myopic and only take into account the availability of unemployment benefits in the next period when deciding whether to take a given job offer. The simulations take as a reference situation a world without unemployment benefits, i.e. where the payroll tax rate, replacement rate, vesting period and benefit duration are all zero.

The ranges considered for each of the parameters are summarized in Table 6. The results of the various simulations are presented in Appendix Table 11. We also analyze the impact of the unemployment benefit system in the case of a lower value for the bargaining coefficient, chosen to be 0.3. 28 The results of these simulations are presented in Appendix Table 12. Table 7 summarizes the key results from these tables for employment shares, while table 8 summarizes the key results for average earnings. The results in Table 11 suggest that, in general, an unemployment benefit system based on riskpooling would have modest effects on labor markets, except in the case of very generous replacement rates. The main effects would be a modest increase in the unemployment rate, the reallocation of labor from wage employment into self employment, and an increase in the average wage in both the formal and informal sectors. The unemployment benefit system increases the flow value of unemployment and the flow value of formal jobs (through an increase in wages and a higher expected income when the labor contract ends), but the first effect dominates for a high value of the bargaining power parameter. Because the flow value of unemployment increases, individuals receiving job offers are less likely to take them, which increases the unemployment rate. In all cases simulated, the increase in the unemployment rate as a result of introducing unemployment insurance is below 1 percentage point and in most cases less than or equal to 0.6 percentage points, which is to be compared to an unemployment share of 2.02 percent in the absence of unemployment insurance. As individuals become less likely to take job offers, unemployment rises and the labor market tightness measure θ = V U falls. Other things being equal, individuals are then more likely to enter self employment. The share of self employment can increase by up to 3 percentage points in the simulations examined here.

As discussed above, the unemployment benefit system also has a direct impact on wages in the formal sector, increasing the flow value of formal jobs and dampening the negative effect that the increase in the flow value of unemployment has on acceptance rates. In the simulations, the average wage in the formal sector increases by between 3 and 5 percent (more in the case of unemployment assistance). The other important effect is the change in average earnings of self employed workers. Because earnings in that sector only depend on the level of human capital of the individual, changes provide information about the types of workers who are more likely to move in or out of the sector. The results show that average earnings fall when the replacement rate of the unemployment insurance systems is 50%, indicating that low skilled workers disproportionately move to this sector. This also explains the increase in the average wage of the informal sector since those leaving are more likely to be low skilled workers. Moreover, the unemployment benefit system has an additional indirect positive effect on the wages of informal sector workers in that it increases the flow value of unemployment through the increase in formal sector wages. When the replacement rate is above 50%, however, average earnings for the self employed increase, indicating an inflow of workers with higher productivity. The interpretation is that as the replacement rate increases, the additional flow value of unemployment makes self employment attractive even for high skilled workers -for whom the "opportunity cost of unemployment is higher".

Overall, the effects of the unemployment benefit system become more important as the replacement rate increases. However, there are no systematic effects from changes in the duration of benefits or the vesting period. This is likely to be an artifact of the current simulations. Indeed, we have run only one set of random shocks that affect individuals over time. Because individuals can be in different states at time t in different policy simulations, the individual specific shock at time t (which is the same for a given individual across simulations) sometimes determines whether a job offer is made and sometimes whether a job is destroyed. For instance, the share of formal employment can change because initial changes in behavior put individuals on a stochastic path where they receive fewer formal job offers.

The contribution rate also appears to have only a marginal impact on the unemployment rate and employment shares, at least when kept below 5 percent. It does, however, considerably dampen the increase in the average formal sector wage. Indeed, the main effect of the contribution rate is to reduce the wage paid for a given skill level, meaning that firms pass at least part of the cost of additional payroll taxes through to the worker in the form of lower wages. Other things being equal, this reduces the likelihood of taking formal sector jobs but not enough to have substantial effects on employment shares.

Lowering the bargaining power of workers, as seen by Table 12, changes the results considerably. As indicated above, introducing UI reduces the likelihood of individual accepting informal job offers or opportunities for self employment. However, those receiving formal job offers are this time more likely to take them, and formal sector wages rise under UI. When the bargaining power of workers (β) falls, formal sector wages also fall. However, introducing a UI system induces a larger increase in formal sector wages when bargaining power is low than when it is high. This is because the bargaining process puts more weight on the flow value of unemployment (relative to the flow value of employment) when bargaining power is low than when it is high, so a given change in the flow value of unemployment leaders to a larger increase in the formal wage, and thereby the value of formal employment, than in the situation with a higher bargaining power for workers. As a result, we see a larger increase in the share of formal employment and a larger reduction in self employment across the simulations (except in the case of very generous unemployment assistance) when β is lower. This result, although not directly relevant for Malaysia, points to the importance that unemployment benefit systems can have in non-competitive labor markets where employers have more bargaining power relative to workers.

As noted in footnote 7, the model assumes that the state can enforce eligibility rules and ensure that only the unemployed can draw UI benefits. Relaxing this assumption so as to allow those employed in the informal sector (either in wage or self employment) to draw benefits would have both direct and indirect effects on the model's outcomes. The direct effect of allowing UI receipt while in the informal sector is that the value of informal sector jobs and self employment is increased since at least with some probability benefits can be drawn while working. The value of unemployment also increases since part of the benefits can continue to be drawn if the individual exits unemployment into an informal sector job. Another, indirect, effect of relaxing the assumption is that formal sector employment becomes more valuable, as the level of unemployment benefits which enters the value function increases. Presumably, therefore, workers would be less likely to remain unemployed and more likely to work in any sector, shortening unemployment durations. Without formally estimating this more complex model, however, it is impossible to quantify how much the share in each employment state would change as enforcement is weakened.

Conclusion

This paper has presented a Diamond-Mortensen-Pissarides type of macro labor market model to analyze the effects of introducing unemployment insurance. Although the application focuses in Malaysia, the results are likely to be relevant for other middle income countries. The model has four labor market states (unemployment, self employment, informal wage employment and formal wage employment) and was estimated to replicate the structure of the labor market in Malaysia in 2009 and the distribution of earnings for informal, formal and self employed workers. The model is estimated using direct techniques, OLS regression, selection-corrected regression and simulated pseudo method of moments estimators on data from Malaysia in 2009.

The model is then used to simulate the effects of alternative unemployment benefit system designs that depend on the replacement rate, the vesting period for benefits, the duration of benefits, and the contribution rate. The results suggest that introducing an unemployment insurance system in Malaysia would have only a modest negative effect on unemployment if benefits are not overly generous. The model suggests that a UI system would induce a reallocation of labor from wage into self employment while increasing average wages in the formal and informal sectors. The effects on the average earnings of the self employed would depend on the generosity of the system. With a 50% replacement rate, most workers entering self employment would be low skilled workers, driving average earnings down. High skilled workers would move into self employment with more generous systems, thereby increasing average earnings.

Although outcomes appear unaffected by variations in the vesting period needed to obtain benefits, and only slightly affected by changes in the duration of benefits, they do vary with the payroll tax rate, the replacement rate and worker bargaining power. The model suggests that these variations are due to workers changing their behavior in response to changes in the flow value of formal employment (both directly -for those coming from the formal sector -and indirectly for the others) and the flow value of unemployment.

A Basic Structure of the Model

Our model considers a labor market with salaried and self employed workers in the spirit of Albrecht et al. (2009). Wage workers can produce with firms offering either a formal or an informal contract. That is, firms can create vacancies in the formal or the informal sector. While formal contracts are subject to labor market regulations like payroll taxes τ , informal contracts are not directly affected by labor market policy. It is also assumed that matches in the informal sector produce a flow value of output which is a fraction < 1 of what the same match would yield with a formal contract. 29 The parameter can be interpreted for example as the expected cost of a fine for not complying with regulations. Even though we allow for two types of vacancies for wage jobs, we maintain the assumption that search is random. That is, letting φ denote the fraction of informal sector vacancies, the effective contact rate for informal and formal vacancies for the worker are φm (θ) and (1 -φ) m (θ), respectively, where θ = Vacancies Unemployment is a measure of labor market tightness and m (•) is a standard matching function.

Worker participation in the different sectors will be related to, but will not depend exclusively on, the worker's type. We assume an exogenous distribution, y ∼ F (y), y ≤ y ≤ y, of types across workers.

Self employed workers receive an income y equivalent to their type. Opportunities to work in the self employment sector arrive to the unemployed at exogenous Poisson rate α, and employment ends at exogenous Poisson rate λ 0 .

We allow for ex post idiosyncratic initial match productivity in both wage sectors. When a worker of type y meets a prospective employer with a vacancy, she draws a match-specific productivity, x ∼ G i (x|y), x ≤ x ≤ x, where the subscript i ∈ {F, I} indicates whether the job is in the formal or informal sector. In order to relate x with y, we assume first-order stochastic dominance, i.e., y > y => G i (x|y ) < G i (x|y) like in Albrecht et al. (2010). This means that the higher the value of the worker type indicator y, the greater her expected productivity. Once x is realized, the parties decide to produce if the net surplus of the match is positive and continue searching otherwise. The match surplus, and thereby the negotiated wage, depend both on the productivity x and on the worker's type.

As an attractive feature of the model, note that there is not perfect segmentation of large groups of workers across the sectors given that match productivity not only depends on the worker's type but also on match-specific characteristics. It is thus possible to have workers with employment histories in the three sectors as reflected in the data for many developing countries.

B Regression Results

Figure 1 :

 1 Figure 1: Working Age Population, Employment and Labor Productivity Trends, 2000-2008

  for details. Since w = a + bx, where a and b are unknown parameters, E (x) = E(w) b -a b and var (x) = var(w) b 2

Figure 2 :

 2 Figure 2: Distribution of y in the Population

Table 1 :

 1 Working Age Population

				Sabah and
		Peninsular Sarawak	Labuan	Total
	General Demographics
	Male	50.3	49.4	50.0	50.2
	Malaysian Citizen	95.6	96.5	75.6	93.7
	Never Married	46.8	42.7	47.3	46.5
	Married	48.9	53.4	48.9	49.3
	Widowed	3.3	2.7	2.6	3.2
	Divorced / Separated	1.0	1.1	1.2	1.0
	Highest certifcate obtained
	Not Applicable	3.6	10.2	13.1	5.1
	No Certificate	10	12.8	16	10.8
	UPSR/UPSRA or equivalent	11.5	17.1	17.9	12.6
	PMR/SRP/LCE	23.9	24.3	20.8	23.7
	SPM/MCE	35.3	27.6	22.5	33.4
	STPM/HSC or equivalent	2.9	2.4	2.9	2.9
	Certificate	1.5	0.8	0.9	1.4
	Diploma	5.4	2.3	2.6	4.8
	Degree	5.8	2.6	3.4	5.3
	Status in employment
	Not Employed	49.6	46.3	46.7	49
	Employer	2	1.6	1.8	1.9
	Government Employee	6.8	6.2	6	6.7
	Private Employee	29.7	27	30.4	29.5
	Own Account Worker	9.6	12	11.5	10
	Unpaid Family Worker	2.3	6.8	3.7	2.8
	Age
	15-24	37.7	37.2	43.4	38.2
	25-39	26.2	25.9	25.8	26.1
	40-44	23.3	23.7	21.9	23.2
	55-64	12.8	13.1	8.9	12.5

Source: Labor Force Survey 2009. Note: The Labor Force Survey does not sample collective housing. All figures are percentages using LFS sample weights.

Table 2 :

 2 Compensation, Hours, Employment and Formality

	Base Monthly Total Monthly Total Weekly Total Hourly Share of Share Employer/ Share Formal: Share Formal:	Wage & Salary Compensation Compensation Hours Worked Compensation Employment Own-Account All Jobs	68.0% Women 1,246 1,331 44.0 7.41 36.1% 15.1% 54.9%	61.5% Men 1,456 1,580 46.0 8.51 63.9% 28.1% 47.7%	64.2% Peninsular 1,484 1,596 45.1 8.69 80.8% 23.0% 51.8%	62.0% Sarawak 1,012 1,094 44.9 6.13 9.0% 25.5% 42.3%	Sabah and	62.0% Labuan 821 938 47.2 4.94 10.1% 24.8% 42.6%	67.8% Age 15-24 790 854 46.1 4.55 19.1% 8.1% 61.9%	69.7% Age 25-39 1,514 1,635 45.2 8.86 39.4% 16.0% 59.9%	57.3% Age 40-54 1,705 1,844 44.8 10.14 31.5% 31.0% 41.1%	35.8% Age 55-64 1,442 1,548 44.5 8.64 10.0% 58.1% 16.7%	Completed	43.3% Primary 802 862 46.1 4.55 29.1% 36.1% 25.1%	or Less	Completed	58.1% Lower 987 1,059 46.0 5.60 14.2% 26.9% 44.1%	Secondary	Completed	68.8% Upper 1,163 1,274 45.5 6.87 35.4% 17.9% 58.3%	Secondary	Completed	72.2% Pre-1,952 2,125 43.6 11.89 12.5% 13.8% 65.2%	University	Completed	73.4% Higher 4,111 4,358 42.7 24.29 8.7% 11.5% 68.1%	Education	Resource-	44.1% Based 952 1,027 44.7 5.62 6.9% 15.3%	Industry	84.0% Manufacturing 1,355 1,454 44.6 7.93 31.1% 77.8%	58.6% Services 1,668 1,952 43.7 11.36 62.0% 48.3%	Source: Labor Force Survey 2009 (compensation, hours and employment share); Household Income Survey 2007 (Share of formal jobs).	Note: Base Monthly Compensation, Total Monthly Compensation, and Total Hourly compensation are expressed in 2010 RM by using the CPI to convert the nominal 2009 figures.	Figures refer only to wages and salaries received and do not include any residual income earned by entrepreneurs. Calculations include private employees and own-account workers	for employment share, hours, and compensation.

Table 3 :

 3 Moments of Earnings Distributions, by Sector

	Sector	Mean Standard Deviation
	Self Employed 9.436	1.069
	Formal	10.001	0.716
	Informal	9.640	0.901

Table 4 :

 4 Value of Model Parameters Estimated for the Policy Simulations

	Parameter Value		Description
	β	0.7646		Bargaining power
	a	0.5631	Scale factor in matching function
	α	0.0817	Arrival of self employment opportunities
	ψ	0.4	Share of informal job offers
	λ i	0.0477 Job destruction rate in the informal sector
	λ F	0.01	Job destruction rate in the formal sector
	λ I	0.01	Job destruction rate for the self employed
		Table 5: Performance of Estimated Model
	Population Moment	Estimated Values Observed Value
	Share informal work	0.263	0.281
	Share formal work	0.538	0.511
	Share self employment	0.174	0.186
	Mean log-wage informal sector	10.0	9.640048
	Std log wage informal	1.2	0.9005742
	Mean log-wage formal sector	10.2	10.00101
	Std log wage formal	0.7	0.71
	Mean log-earnings self employment	9.7	9.436391
	Std log-earnings self employment	1.5	1.06

Table 6 :

 6 Values of Policy Parameters for Unemployment Benefit Systems

	Policy Parameter	Set of Values
	Contribution Rate	{0,0.01,0.02,0.03,0.04,0.05}
	Replacement rate	{0.5,0.6,0.7,0.8,0.9,1}
	Vesting Period (months)	{0,1,2,3,4,5,6}
	Duration (months)	{2,4,6,8,10,12,∞}

Table 7 :

 7 Effects of Alternative Unemployment Benefit Systems on Employment Shares

	Pay Replace-

Table 8 :

 8 Effects of Alternative Unemployment Benefit Systems on Average Earnings

	Pay Replace-			Mean	Mean	Mean
	Roll	ment	Vesting Dura-	Wage	Wage	Wage
	Tax	Rate	Period	tion	Informal Formal Self Employed
		Estimated Bargaining Power (β = 0.7646)
	0	0	0	0	0.0%	0.0%	0.0%
	0.01	0.5	6	6	12.3%	4.0%	-4.9%
	0.01	0.5	6	12	13.4%	3.8%	-4.9%
	0.01	0.5	2	6	12.3%	4.0%	-4.9%
	0.01	0.5	5	6	12.3%	4.0%	-4.9%
	0.01	0.7	6	6	11.3%	4.1%	3.5%
	0.01	0.9	6	6	22.5%	1.7%	2.0%
	0.02	0.7	6	6	11.3%	3.2%	3.5%
	0.05	0.7	6	6	11.5%	0.4%	3.5%
	0	0.5	0	0	24.2%	8.9%	-7.0%
	0	1	0	0	-86.3%	-2.8%	35.8%
			Low Bargaining Power (β = 0.3)
	0	0	0	0	0.0%	0.0%	0.0%
	0.01	0.5	6	6	0.6%	1.7%	1.2%
	0.01	0.5	6	12	0.6%	0.9%	1.1%
	0.01	0.5	2	6	0.6%	1.2%	1.1%
	0.01	0.5	5	6	0.6%	1.7%	1.2%
	0.01	0.7	6	6	1.1%	-5.4%	0.7%
	0.01	0.9	6	6	0.4%	-7.4%	1.2%
	0.02	0.7	6	6	1.1%	-5.9%	0.6%
	0.05	0.7	6	6	0.4%	-10.3%	0.7%
	0	0.5	0	0	0.6%	-18.2%	1.3%
	0	1	0	0	-40.0% 109.2%	-1.1%
	N.B.: Table presents the difference in steady state values between the
	simulated and baseline scenarii.

Table 9 :

 9 Results From Estimation of y

	Selection Into

Table 11 :

 11 Effects of Changing System Parameters on Employment Shares and Wages Table presents the difference in steady state values between the simulated and baseline scenarii. Simulation using parameters from table 6 and using the estimated bargaining power parameter of β = 0.7646.

	Pay Replace-

N.B.:

Table 12 :

 12 Effects of Changing System Parameters on Employment Shares and Wages (Low Bargaining Power) Table presents the difference in steady state values between the simulated and baseline scenarii. Simulation using parameters from table 6 and using the estimated bargaining power parameter of β = 0.3.

	Pay Replace-

N.B.:

For reviews see[START_REF] Holmlund | Unemployment Insurance in Theory and Practice[END_REF];[START_REF] Vodopivec | Unemployment Benefit Systems in Central and Eastern Europe: A Review of the 1990s[END_REF] and Olinto et al. (2007).

In the states of Sabah and Labuan, there are over 5 percent more people under the age of 25 and roughly 4 percent fewer people over the age of 55 than in the other regions. The state of Sarawak differentiates itself from Peninsular Malaysia in that its demographic bulge happened earlier, so that there are more people in their thirties and fewer people in their twenties and teens in Sarawak than in Peninsular Malaysia and Sabah/Labuan.

As savings are not a component of the model, it is assumed that taking a self employment opportunity requires no startup capital.

The HIS is collected by the Department of Statistics for the Economic Planning Unit.

The LFS is collected by the Department of Statistics.

It should be noted that some variables needed to be built form both sources. See section 5.1 for details.

The exclusion of collective housing is likely to be an issue for some sectors, particularly agriculture where many workers live in collective housing in the middle of plantations.

The actual question asked is "How much did .................. earn during the last twelve (12) months from paid employment?' for which one earnings category is "Employer's contributions to EPF, SOCSO, etc.".'

It should be noted that Malaysia does not have an explicit unemployment insurance system, however it does provide for mandatory severance pay in the case of dismissal or redundancy-based separation from (formal) jobs(Holzmann and Vodopivec, eds, 2011).

Unemployment durations are measured as: less than 3 months, 3 months -less than 6 months, 6 months -less than 1 year, 1 -3 years and more than 3 years.

This is not meant to imply that the estimation is fully non-parametric; in particular, a Heckman-type selection correction is employed in the estimation of y, implying joint normality between the disturbance term of the expression that determines Y and that which determines the probability of self employment; see section 5.2 for details.

See Margolis et al. (2011) for the full structural estimation.

The estimation uses the ANT algorithm[START_REF] Miller | Active Nonlinear Tests (ANTs) of Complex Simulation Models[END_REF].

The severance pay parameter, s, is set to zero for the purposes of the simulation.

Clearly, different samples would lead to different values for the model parameters. In principle, one could bootstrap samples to estimate standard errors for the parameters. In the micro-simulation estimation, however, we keep the sample of individuals constant.

Changing the value of the bargaining coefficient, of course, changes the employment shares and the distribution of wages. The impacts of the simulated unemployment benefit systems are analyzed against this new (counterfactual) steady state.

A similar assumption is done in[START_REF] Bosch | Cyclical Informality and Unemployment[END_REF].

data used here was provided under conditions set by Malaysia's Department of Statistics and the Economic Planning Unit; interested individuals are invited to contact the DoS


Jonathan Y Marchand
email: jonathan.yves.marchand@irisa.fr

Benoit Combemale
email: benoit.combemale@irisa.fr

Benoit Baudry
email: benoit.baudry@inria.fr

A Categorical Model of Model Merging and Weaving

Model driven engineering advocates the separation of concerns during the design time of a system, which leads to the creation of several different models, using several different syntaxes. However, to reason on the overall system, we need to compose these models. Unfortunately, composition of models is done in an ad hoc way, preventing comparison, capitalisation and reuse of the composition operators. In order to improve comprehension and allow comparison of merging and weaving operators, we use category theory to propose a unified framework to formally define merging and weaving of models. We successfully use this framework to compare them, both through the way they are transformed in the formalism, and through several properties, such as completeness or nonredundancy. Finally, we validate this framework by checking that it correctly identifies three tools as performing merging or weaving of models.

I. INTRODUCTION

The Model Driven Engineering (MDE) paradigm promotes separation of concerns to better handle the complexity of a software system, which leads to the creation several models However, in order to reason on the overall system, it is necessary to compose these models, e.g. to check their consistency or to generate code. As model composition is a key concern in MDE, a better comprehension of model composition techniques would greatly improve designers work. Unfortunately, composition of models is currently done in an ad hoc way, in the sense that each tool uses its own formalism and algorithm to perform it, preventing straightforward easy comparison.

In this article, we focus on merging and weaving operators. In order to get a better understanding of these two kind of operators, we propose a unified framework for model merging and weaving. As the high level of abstraction of category theory allows to identify different notions under a common vocabulary, this framework is based on category theory. More precisely, we use the pushout, a categorical operator which behaves like a merge when applied in a proper category [START_REF] Sabetzadeh | An algebraic framework for merging incomplete and inconsistent views[END_REF]. The categorical framework includes a transformation from classical MDE models to our category Model of models in which we perform the pushout. This transformation allows us to pinpoint the difference between merging and weaving operators. We also give several properties inspired from [START_REF] Brunet | A manifesto for model merging[END_REF], [START_REF] Chechik | A relationship-based approach to model integration[END_REF], that are verified by one or both approaches, and allow further comparison and comprehen-sion of the two kind of operators. Finally, we validate our framework by checking that it correctly identifies three tools from the literature, UML Package Merge [START_REF] Omg | Uml infrastructure specification v2.4[END_REF], Kompose [START_REF] France | Providing support for model composition in metamodels[END_REF] and ADORE [START_REF] Mosser | Workflow design using fragment composition[END_REF], as using a merging or a weaving operator.

Section II gives a first intuition of the difference between merging and weaving. Section III gives the notions of category theory necessary to understand the article and defines our category of models. Section IV explains how we formalise the weaving and merging operators using the pushout in this category, compares them using this framework and validate the latter using three tools resorting to one or the other approach. We explore related work in section V, finally concluding in section VI.

II. INTUITIVE DEFINITION OF WEAVING AND MERGING OPERATORS

In this section, we give an intuition of the difference between merging and weaving models that underlies the formal comparison done in section IV. To do this, we first clarify the vocabulary used, then split the two operators in four steps and precise the relevant steps for the comparison of merging and weaving. Finally we explain the intuitive difference between the merging and weaving approaches.

A. Vocabulary

In this article, we use vocabulary taken from Aspect Oriented Programming to deal with the weaving process. To avoid any ambiguity, we hereby define this vocabulary, as well as the notion of merging.

Definition 1 (Merging). Merging is the action of combining two models, such that their common elements are included only once and the other ones are preserved.

Definition 2 (Weaving). A weaving involves two actors: an aspect and a base model. The aspect is made of two parts, a pointcut, which is the pattern to match in the base model, and an advice, which represents the modification made to the base model during the weaving. The parts of the base model that match the pointcut are called joinpoints. During the weaving, each joinpoint is replaced by the advice.

B. Partition of the Merging and Weaving Processes

Merging and weaving processes can be separated in four steps. First, there is a pre-processing step, during which the input models are modified. This step is performed for the input models to conform to the tool expectation or ease automatic matching by renaming some elements.

Then, there is a match step. It is usually expressed at the metamodel level, by associating with two classes the criteria used to compare instances of these classes. In the rest of this article, we rely on the notion of mapping, which is instead expressed at the model level. It is a one-to-one relation, in which elements to be merged are linked. A mapping is the result of the application of the match on every elements of the two compared models.

The third step is the sum, where the models are effectively merged. It uses the match step in order to identify elements that should be merged, and copy the other ones.

Finally, the post-processing step performs various operations on the output model, typically for it to conform to its metamodel. It can consist in the identification and break of containment cycles, or deletion of user-defined elements.

In the rest of this article, we focus on the match and sum steps. Indeed, the pre-and post-processing usually resort to Turing-complete languages, thus preventing any attempt to extract general properties for these two steps. Properties on the overall process of a specific tool can still be extracted from the match and sum step, and proven to be invariant w.r.t. the post-processing of this tool.

C. Intuition of the Difference between Weaving and Merging

From Definitions 1 and 2, we can extract an informal difference between merging and weaving. Merging is symmetric, in the sense that the result of the merge does not depend on the order of the inputs. On the other hand, as the two inputs of a weaving (the base model and the aspect) do not play the same role, weaving is asymmetric. More precisely, in the symmetric merging case, each element is considered unique and should appear only once in the result, whereas in the asymmetric weaving case, each element of the aspect does not represent something unique and should be duplicated as many times as there are joinpoints. This intuition is formalised in section IV-B.

III. A CATEGORY OF MODELS

In order to formally compare the merging and weaving approaches, we choose the category theory formalism. Indeed, the high level of abstraction of this formalism allows the identification of different notions under a common vocabulary.

In this section, we first introduce the notions of category theory necessary to define our framework, then use them to define the Model category. This category will be used in section IV to formally define the merging and weaving operators.

A. Category Theory

Definition 3 (Category). A category consists of:

• a collection of objects1

• a collection of arrows with the following properties:

• Each arrow has a source and a target, called respectively domain and codomain. We note f : A → B to show that the arrow f has for domain the object A and for codomain the object B. • There is a composition operator for arrows, such that for every f : A → B and g : B → C, there exists g • f : A → C in the category.

• This composition is associative:

h•(g •f ) = (h•g)•f . • To each object A is associated an identity arrow id A : A → A, which is neutral for the arrow composition, i.e. ∀f : A → B, id B • f = f = f • id A Definition 4 (Pushout).
A pushout of a pair of arrows f : A → B and g : A → C is an object P and a pair of arrows g ′ : B → P and f ′ :

C → P s.t. g ′ • f = f ′ • g and if i : B → X and j : C → X are such that i • f = j • g then there is a unique k : P → X s.t. i = k • g ′ and j = k • f ′ .
This definition is illustrated on Figure 1. The symbol means that the diagram commutes, i.e. that the equalities of the definition are satisfied, e.g. i = k • g ′ . The arrow k is dashed to emphasise that its existence is a consequence of the rest of the diagram. The exclamation mark "!" emphasises the uniqueness of the arrow k, in the sense that it is the only arrow which makes the diagram commute.

B. A Category for Models

We define in this section the Model category, a category of models. This category will be used in section IV to define the merge and weaving in terms of a pushout.

In order to define the Model category, we first define formally the notions of model (which corresponds to the usual notion of model in MDE) and model morphism (which can loosely be interpreted as a mapping function between models). A model is a set of objects linked through associations. In order to treat associations as first-class citizens and not as simple links, we introduce the notion of edge, which links associations and objects.

Definition 5 (Model). A model is a set O of objects, a set R of associations and a set E of edges such that 1)

E ⊆ O × R ∪ R × O 2) ∀(r, o) ∈ E∩R×O, ∀o ′ ∈ O, (r, o ′ ) ∈ E ⇐⇒ o = o ′ 3) ∀(o, r) ∈ E∩O×R; ∀o ′ ∈ O, (o ′ , r) ∈ E ⇐⇒ o = o ′
Given an edge e, we use the notations e (o) and e (r) to represent the object and association ends of e.

The information on the direction of an association is stored in its edges: if (o, r) ∈ E, r is an association from object o, whereas if (r, o) ∈ E, r is an association to o. The points 2 and 3 state that an association is from at most one object and to at most one object. For the sake of simplicity, we may write that

x ∈ M instead of x ∈ O M ∪ R M ∪ E M to say that x is an element of the model M .
Figure 2 We now define model morphisms as three functions on objects, associations and edges.

Definition 6 (Model morphism). Given two models

A = (O A , R A , E A ) and B = (O B , R B , E B ), a model morphism f : A → B is a triple (f O , f R , f E ) with f O : O A → O B , f R : R A → R B and f E : E A → E B three functions such that ∀e ∈ E A , f O (e (o) ) = (f E (e)) (o) and f R (e (r) ) = (f E (e)) (r) .
The goal of the latter constraint is to preserve the structure of models: if an edge is mapped with another edge, then their ends are mapped accordingly. For the sake of simplicity, we use morphism instead of model morphism in the rest of this article.

According to Definition 3, we need composable arrows and the identity arrows to define the category. We thus formally define model morphism composition and the identity model morphism.

Definition 7 (Model morphisms composition). The composition of two model morphisms is done

component-wise, i.e. g • f = (g O • f O , g R • f R , g E • f E ).
Proof: We need to check that the composed morphism satisfies the condition of Definition 6. Let e ∈ E A be an edge. As f and g are morphisms, we have that (o) . The arguments are the same for e (r) .

f O (e (o) ) = (f E (e)) (o) and g O ((f E (e)) (o) ) = (g E (f E (e))) (o) . So g O • f O (e (o) ) = (g E • f E (e))

Definition 8 (Identity model morphism). Given a model A, the identity morphism of A is a model morphism id A :

A → A such that (id A ) O ,(id A ) R and (id A ) E are the identity functions on O A , R A and E A respectively.

Proof: We need to check that id A satisfies the condition of Definition 6. Let e ∈ E A be an edge. As (id A ) O is the identity function on O A , (id A ) O (e (o) ) = e (o) . As (id A ) E is the identity function on E A , (id A ) E (e) = e. So ((id

A ) E (e)) (o) = e (o) = (id A ) O (e (o)
). The same arguments hold for e (r) .

We now prove that models together with model morphisms form a category. Proof: We have to check if the four properties of Definition 3 are satisfied.

• Every morphism has obviously a source and a target • Given two morphisms f : A → B and g : B → C, the composed morphism g • f : A → C always exists. • The composition of functions is associative and the composition of morphisms is done component-wise, so composition of morphisms is associative:

h • (g • f ) = (h O • (g O • f O ), h R • (g R • f R ), h E • (g E • f E )) = ((h O • g O ) • f O , (h R • g R ) • f R , (h E • g E ) • f E ) = (h • g) • f
• The identity functions are neutral for function composition and the composition of morphisms is done component-wise, so the identity morphism is neutral for morphism composition.

IV. CATEGORICAL MERGE AND WEAVING OPERATORS

In this section, we use the pushout in the previously defined Model category to formally define merging and weaving. We begin by formally defining the notion of mapping in our category. Then we expose how the transformation from models to elements of the category allows to differentiate merging and weaving, and how the pushout is used to perform them. We then define several properties that are used to check the commonalities and differences between these two approaches. Finally, we check that the framework correctly classifies three tools from the literature: UML Package Merge, Kompose and ADORE.

A. Mappings in the Model Category

In order to treat merge in Model, we define a notion of mapping between elements of the category Model, which corresponds to the notion of mapping between models introduced in section II-B.

A mapping is a relation between two models, defined through three relations on objects, associations and edges. If two elements a and b are related by a mapping, we call the couple (a, b) an alignment rule. Note that we only consider binary mappings. In the symmetric case, n-ary mappings can be decomposed in a set of binary mappings. The notion of n-ary mapping in the asymmetric case should need further investigations. The latter constraint has the same role than the similar constraint on model morphisms: to preserve the structure of models.

Definition 10 (Model mapping). Given two models

B = (O B , R B , E B ) and C = (O C , R C , E C ), a model mapping map between B and C is a triple (map O , map R , map E ) where map O ⊆ O B × O C , map R ⊆ R B × R C , map E ⊆ E B × E C are

B. From MDE Models to a Pushout Configuration

As the pushout is fixed by its definition, the only way to make a difference between merging and weaving in the sum process lies in the transformation from the input models (conform to their metamodel) to a pushout configuration: two arrows with a common domain. Hence, this transformation takes as input not only the models to be composed and the mapping between them, but also the type of composition (weaving or merging) expected.

1) Symmetric Case: Given B and C two models and map a mapping between them, we want to merge them w.r.t. map. To do this, we first transform map in a model A together with two morphisms f and g, using the following procedure. For every alignment rule (o b , o c ) ∈ map O , we add an element o a to O A and define f O (o a ) = o b and g O (o a ) = o c . We use the same procedure for map R and map E to define R A , E A , f R , f E , g R and g E . We can prove that f = (f O , f R , f E ) and g = (g O , g R , g E ) are model morphisms, using the structure preserving property of map which leads to the structure preserving property of f and g.

As an example, consider Figure 3, where two models B and C and a mapping map between them are pictured. After the transformation of map into a model A, we obtain the pushout configuration picture on Figure 4. As f and g are morphisms with common domain, we can compute their pushout.

2) Asymmetric Case: If we want to weave an aspect to several joinpoints, the pointcut of this aspect will have to be mapped on each joinpoint. By transitivity of the mapping relation, all the joinpoints will be considered equivalent, hence they will all be merged during the merge process, not yielding the expected result. Thus, in order to make an asymmetric merge, we have to duplicate the aspects so that each joinpoint can have its own.

C. Merging and Weaving Models using Pushout

Using the procedure described in the two previous sections, from a mapping map we obtain two arrows f and g with common codomain A, both in the symmetric and asymmetric case. If we compute their pushout2 (D, f ′ , g ′ ) in Model, we can check that it yields the expected result in the two cases.

Every couple of elements (b, c) ∈ B × C which have the same antecedent a ∈ A by f and g respectively will have the same image d ∈ D by f ′ and g ′ respectively, thanks to the commutativity property f ′ •g = g ′ •f of the pushout. As each element a of A has been constructed from an alignment rule of map, and as its images by f and g are the ends of this alignment rule, every couple of elements mapped by map will have the same image in D, which means that they have been merged. If we take up the previous symmetric example, and do the pushout of f and g, we indeed get the merge D of B and C w.r.t. map, as pictured on Figure 6. Nevertheless, this procedure gives only the structural part of the merging and weaving and does not give the values of the attributes of the resulting model. Indeed, consider the attribute name:String of some merged element, it may be the concatenation of the names of its antecedents, or the name of one of them, or any other possibility. However, the pushout is not only D but the triple (D, f ′ , g ′ ). Thanks to the morphisms f ′ and g ′ , we can trace back the origin of each element of the resulting model, including the attributes. Knowing the exact origin of an attribute, we can compute its expected value, but this operation requires some postprocessing out of the categorical framework, such as the application of a preference function [START_REF] Pottinger | Merging models based on given correspondences[END_REF].

D. Composition Operators Properties

In both cases (symmetric and asymmetric), the merging operators satisfy the following properties, adapted from Brunet and Chechik [START_REF] Brunet | A manifesto for model merging[END_REF], [START_REF] Chechik | A relationship-based approach to model integration[END_REF]:

• Completeness: Ensure that no data is lost along the merging process: each model element from the input models should be represented in the merged model. • Minimality: The merged model contains information that originates solely from the input models. • Totality: Given any pair of models and any mapping, a merged model should always exists. • Idempotency: Merging a model with itself should produce a model that is an exact copy of the original model. • Validity: The operator merges only (transitively) matching elements.

Proofs:

• Completeness The pushout operator does not remove any information, as the merged model contains the image of all the objects, associations and edges of the input models. Indeed, as the arrows f ′ and g ′ produced by a pushout are morphisms, made of three functions, they necessarily provide an image for each element. • Minimality Every model element in the merged model has an antecedent by f ′ or g ′ . This guarantees that no information is added during the pushout. This property comes directly from the co-universal property of the pushout [START_REF] Pierce | Basic category theory for computer scientists[END_REF].

• Totality Let M 1 and M 2 be two models and map be a mapping between M 1 and M 2 . The sum of M 1 and M 2 w.r.t. map exists as long as map verifies the following property: if a reference r 1 ∈ R M1 is mapped with a reference r 2 ∈ R M2 , then their incoming and outgoing edges are mapped accordingly. From a MDE perspective, this condition says that when two references are mapped together, then their containers and containees are mapped as well. • Idempotency In the symmetric case, if you merge a model with itself using the identity mapping (which maps each element to itself), the result is the model itself. In the asymmetric case, consider the identity mapping as the pointcut, and the model as both the advice and the receiving model. As the advice is identical to the pointcut, it means that we weave an empty advice on the receiving model. Hence, in the asymmetric merge, the idempotency property is preserved. • Validity In the two cases, the merged elements are the elements (transitively) linked by alignment rules. Indeed, these merged elements are the ones that have the same antecedents in A by f and g. As A, f and g are generated from the alignment rules, the operators merge only matching elements. The following property, also inspired from [START_REF] Brunet | A manifesto for model merging[END_REF], [START_REF] Chechik | A relationship-based approach to model integration[END_REF], is true for a symmetric merge, but false for an asymmetric one:

• Non-redundancy: Any pair of matched model elements leads to the creation of a single element in the merged model.

Indeed, in the asymmetric case, elements of the advice model may be duplicated during the transformation to a Model element, hence this latter property does not hold.

Proof for symmetric case: This property is guaranteed by the construction of A, f and g from the mapping. If x from B and y from C are linked by the mapping, they have the same antecedent in A by f and g respectively, hence they have the same image by f ′ and g ′ thanks to the commutativity property f ′ • g = g ′ • f of the pushout.

E. Validation Using Existing Tools

In order to validate our framework, we check if it correctly classifies three tools from the literature as using a merging (symmetric) or a weaving (asymmetric) operator. This is done by checking which of the transformation processes exposed in section IV-B is adapted to simulate the tool using the Model category. A fourth tool, TreMer+ [START_REF] Nejati | Matching and merging of statecharts specifications[END_REF], is introduced to show the limits of our approach.

UML Package Merge: Package merge has been introduced in UML2 to improve modularity [START_REF] Omg | Uml infrastructure specification v2.4[END_REF]. It takes as input two class diagrams, and extends the first with the second by merging their common classes, and deep copying the other ones. These common classes are identified by their names and types. The merge is done recursively, following the containment links of the models. The output of the merge replaces the first class diagram, hence the merge is asymmetric, in the sense that only the receiving model is modified. However, except for the place where the merged model is stored, the result does not depend on the order of the inputs. Moreover its algorithm is symmetric. This algorithm fits seamlessly in the merging process of our framework.

Kompose: Kompose3 is a model merging tool [START_REF] France | Providing support for model composition in metamodels[END_REF] implemented in the Kermeta language [START_REF] Muller | Weaving executability into object-oriented meta-languages[END_REF]. It merges two homogeneous models (instances of the same metamodel) by comparing the signatures of their elements. These signatures can be arbitrarily complex, using the element's name, type, field or method names and types, and so on. Elements with the same signature are merged, while the other ones are deep copied. Kompose proposes a system of pre-and postdirectives to modify the models before and after the merge. The two models are called base model and aspect model, as in Aspect-Oriented Modeling, which suggests an asymmetric treatment, yet the tool is symmetric [START_REF] France | Providing support for model composition in metamodels[END_REF]. Only the merging process of our framework simulates correctly Kompose.

ADORE: ADORE4 is a tool for service orchestration using PROLOG. It allows the merging of partial orchestrations (fragments) in a main orchestration using a set of user-defined relationships [START_REF] Mosser | Workflow design using fragment composition[END_REF]. The treatment is clearly asymmetric, as the fragments are not orchestration in themselves (they do not conform to the metamodel), and must be merged in the main orchestration in order to make sense. As a fragment might be weaved in several places in the main orchestration, only the weaving process of our framework is relevant.

TreMer+: In [10], Nejati et. al. propose an approach, implemented in TreMer+5 , to match and merge statechart diagrams while preserving their semantics by ensuring bisimulation. Thus, their operator is not only structural, and does not fit in our framework. Indeed, preserving bisimulation may lead to the duplication of states in the two diagrams, thus not respecting the non-redundancy property [START_REF]Matching and merging of variant feature specifications[END_REF]. From our framework point of view, it is as if the merge was asymmetric (as states are duplicated) in a symmetric manner (this duplication may occur in both models, hence they play the same role).

V. RELATED WORK

In [START_REF] Jeanneret | A reference process for model composition[END_REF], Jeanneret et. al. propose a categorisation of model composition operators based on three criteria: What, Where and How. The What criteria tells which concepts of the models will be composed, the Where criteria indicates where the composed concepts will be inserted, and the How criteria describes how the composition of the concepts is done. This qualitative approach shares the same purpose than ours, as it allows the comparison of different composition operators and gives a better understanding of them. However, our categorical framework provides an operational operator, which can be used to promote re-use and evolution management in future work.

The use of colimits (a generalisation of pushouts in category theory) to perform merging has been encouraged since the 90s by Goguen [START_REF] Goguen | A categorical manifesto[END_REF] and already been applied to merge models, e.g. in the TreMer tool [START_REF] Sabetzadeh | Tremer: A tool for relationship-driven model merging[END_REF], [START_REF] Sabetzadeh | An algebraic framework for merging incomplete and inconsistent views[END_REF]. While they use a categorical framework to define a new merging operator, we aim at capitalising the sum process of different merging approaches. Moreover, these approaches, as well as the algebraic graph transformation approaches to model transformation [START_REF] Ehrig | Fundamental theory for typed attributed graph transformation[END_REF], consider models as (possibly attributed) graphs and do not take into account the specificity of models. Indeed, they consider associations as simple edges whereas we consider them as first-class constructs, which allows us to manipulate them.

VI. CONCLUSION

This paper proposes a formal framework based on category theory to unify the common mechanisms of model merging and model weaving. Using this framework allow us to compare these two kind operators, bringing a better comprehension of their commonalities and differences. This comparison is based on two points: the transformation from the inputs to a pushout configuration, and the properties checked by the two approaches. This framework provides

Figure 1 .

 1 Figure 1. (P, f ′ , g ′ ) is a pushout of f and g.

Figure 2 .

 2 Figure 2. Three representations of a class diagram, and its metamodel.

  illustrates a model and its formal representation according to the previous definition. The upper part of the figure represents a simplified metamodel of a class diagram. The lower part shows three different equivalent notations for a class diagram conforming to the previous metamodel. Figure 2a depicts the model using the classdiagram notation. The same model is illustrated in Figure 2b, using the object diagram notation showing the conformance to the metamodel. Finally, Figure 2c, proposes the underlying graph according to the latter, which corresponds to the formal representation of the model, as expressed in Definition 5. Notice that we uniformly consider attributes as references to their relative datatypes.

Definition 9 (

 9 Category Model). The category Model has models as objects and model morphisms as arrows. Composition of arrows is the composition of morphisms. Identity arrows are identity morphisms.

  three sets of alignment rules on objects, associations and edges respectively, such that ∀e b , e c ∈ map E , (e

Figure 3 .Figure 4 .

 34 Figure 3. Two models B and C and a mapping map between them, represented in dashed lines

Figure 5 .Figure 6 .

 56 Figure 5. Transformation towards a pushout configuration in the case of an asymmetric merge.

We use a different font for the notion of object of a category in order not to confuse it with the notion of object as element of a model used later

The pushout exists in Model as long as the mapping is consistent, i.e. if two references are mapped, the classes they are linked to should be mapped as well.

http://www.kermeta.org/mdk/kompose

http://rainbow.i3s.unice.fr/adore/wiki/doku.php

http://se.cs.toronto.edu/index.php/TReMer+ a clear definition of the two kinds of composition, and is validated by classifying correctly three tools from the literature in one or the other category.We envisage to extend the framework to support more model composition operators, e.g. intersection and override, in order to bring a better comprehension of this key concern in MDE.

ACKNOWLEDGEMENT This work has been partially supported by VaryMDE, a collaboration between INRIA and Thales Research and Technology. The authors warmly thank Robert B. France for insightful feedback and comments on early versions of this paper.