Cover

‘r

The Analysis of Complex Adaptive Systems Method SBCANAL

Second edition

Luís Soares Barreto

Costa dede Caparica Caparica 2019201X 2 © L. S. Barreto, 2018. The Analysis of CAS CAS

CAS

Without text

© L. S. Barreto, 2018. The Analysis of CAS 3 CAS

CAS

The Analysis of Complex Adaptie Systems Method SBCANAL

Second edition 4 © L. S. Barreto, 2018. The Analysis of CAS The Analysis of CAS

The Analysis of CAS

Without text © L. S. Barreto, 2018. The Analysis of CAS 5 The Analysis of CAS

The Analysis of Complex Adaptie Systems Method SBCANAL

Second edition

Luís Soares Barreto Jubilee Professor of Forestry University of Lisbon Portugal 6 © L. S. Barreto, 2018. The Analysis of CAS © Luís Soares Barreto, 2018, 2019

© Luís Soares Barreto, 2018, 2019

The Analysis of Complex Adaptie Systems. Method SBCANAL Second editon

E-book published by the author htp://hdl.handle.net/10400.5/1 5100

Prof. Doutor Luís Soares Barreto Av. do Movimento das Forças Armadas, 41 – 3D 2825-372 Costa de Caparica Portugal

This e-book is free ware but neither public domain nor open to changes. It can be copied and freely disseminated only in its to- tality, with respect for the authorship rights. It can not be sold.

With compliments © L. S. Barreto, 2018. The Analysis of CAS 7 Dedicaton

Dedicaton

To Sandra Isabel, and Luísa Maria

I am grateful to those who contribute to the existence of ClickCharts, LibreOfce, Maxima, R, Scilab e wxMaxima 8 © L. S. Barreto, 2018. The Analysis of CAS CAS

CAS © L. S. Barreto, 2018. The Analysis of CAS 9 The author

The author

Luís Soares Barreto was borne in 1935, in Chinde, a small village in the delta of the Zambezi River, in Mozambique. In this African country, from 1962 tll 1974, he did research in forestry, and he was also member of the faculty of the Universidade de Lourenço Marques (actual Universidade Eduardo Mondlane, Maputo), where he started the teach- ing of Forestry. While member of this university, from 1967 to 1970, he was a graduate student at Duke Univer- sity, Durham, NC, U.S.A.. From this university, he re- ceived his Master of Forestry in Forest (1968), and his Ph. D. in Operatons Research applied to Forestry (1970). Since 1975 tll March, 2005, he taught at the Insttuto Superior de Agronomia, Universidade de Lis- boa. From 1975 to 1982, simultaneously, he taught in the Department of Environmental Sciences of the Universidade Nova de Lisboa. Here, in 1977, he conceived, and created a new fve years degree in environmental engineering. He is the only Portuguese who established a scientfc theory. Besides the ecological theory presented in this book, he proposed also a unifed theory for forest stands of any kind and ecologically sound management practces grounded on it. The later theory is a partcular case of the former one. Actually, the author is jubilee professor of the Univer- sity of Lisbon. 10 © L. S. Barreto, 2018. The Analysis of CAS Other books by the author:

Other books by the author:

Madeiras Ultramarinas. Insttuto de Investgação Cientfca de Moçambique, Lourenço Marques, 1963. A Produtiidade Primária Líquida da Terra. Secretaria de Estado do Ambiente, Lisboa, 1977. O Ambiente e a Economia. Secretaria de Estado do Ambiente, Lisboa, 1977. Um Noio Método para a Elaboração de Tabelas de Produção. Aplicação ao Pinhal. Serviço Nacional de Parques, Reservas e Conservação da Natureza, Lisboa 1987. A Floresta. Estrutura e Funcionamento. Serviço Nacional de Parques, Reservas e Conservação da Natureza, Lisboa, 1988. Alto Fuste Regular. Instrumentos para a sua Gestão. Publicações Ciência e Vida, Lda., Lisboa, 1994. Étca Ambiental. Uma Anotação Introdutória. Publicações Ciência e Vida, Lda., Lisboa, 1994. Poioamentos Jardinados. Instrumentos para a sua Gestão. Publicações Ciência e Vida, Lda., Lisboa, 1995. Pinhais Mansos. Ecologia e Gestão. Estação Florestal Nacional, Lisboa, 2000. Pinhais Braios. Ecologia e Gestão. E-book, Lisbon, 2005. htp://hdl.handle.net/10400.5/14258 Theoretcal Ecology. A Unifed Approach. E-book, Lisbon, 2005. Iniciação ao Scilab. E-book, Lisbon, 2008 Áriores e Arioredos. Geometria e Dinâmica. E-book, Costa de Caparica, 2010. htp:// hdl.handle.net/10400.5/14229 From Trees to Forests. A Unifed Theory. E-book, Costa de Caparica, 2011. htp://hdl.handle.net/ 10400.5/14230 Iniciação ao Scilab. Second editon. E-book, Costa de Caparica, 2011. htp://hdl.handle.net/ 10400.5/14259 Ecologia Teórica. Uma Outra Explanação. I - Populações Isoladas. E-book, Costa de Caparica, 2013. htp://hdl.handle.net/10400.5/14231 Ecologia Teórica. Uma Outra Explanação. II - Interações entre Populações. E-book, Costa de Capa- rica, 2014. htp://hdl.handle.net/10400.5/14231 Ecologia Teórica. Uma Outra Explanação. III – Comunidade e Ecossistema. E-book, Costa de Capa- rica, 2016. htp://hdl.handle.net/10400.5/142 31 Theoretcal Ecology. A Unifed Approach. Second editon. E-book, Costa de Caparica, 2017. htp:// hdl.handle.net/10400.5/14 1 75 © L. S. Barreto, 2018. The Analysis of CAS 11 Contents

Contents

Sumário Cover...... 1 CAS...... 2 CAS...... 3 The Analysis of...... 3 The Analysis of CAS...... 4 The Analysis of...... 5 © Luís Soares Barreto, 2018, 2019...... 6 The Analysis of Complex Adaptve Systems. Method SBCANAL...... 6 Dedicaton...... 7 CAS...... 8 The author...... 9 Other books by the author:...... 10 Contents...... 11 A Note on the Second Editon...... 13 1. Introducton...... 15 1.1. The Scope of this Book...... 15 1.2. A Sketch of the Explanatory Strategy...... 15 1.3. The Book...... 17 1.4. References...... 17 2. A System of Omnivory...... 19 2.1 Direct, Indirect, and Total Efects...... 19 2.2 The Matrix of Total Efects...... 21 2.3 A Model for Omnivory...... 23 2.4 References...... 31 3 SBCANAL: A Procedure to Analyse CAS...... 33 3.1 Introducton...... 33 3.2 The Procedure...... 33 3.3 References...... 34 4 Identficaton of , and Controlling Components in the ...... 37 4.1 Introducton...... 37 4.2 The Simulated Ecosystem...... 37 12 © L. S. Barreto, 2018. The Analysis of CAS Contents

4.3 The Identfcaton of Keystone Species...... 40 4.4 The Identfcaton of Controlling Components in ...... 43 4.5 Conclusive Remarks...... 44 4.6 References, and Related Bibliography...... 45 5 Developmental, Structural, and Functonal Sensitvites to Inital Values...... 47 5.1 Introducton...... 47 5.2 Ascendency...... 47 5.3 Analysis...... 57 5.4 Conclusion...... 58 5.5 References, and Related Bibliography...... 58 6 Klein’s Data of the US Economy...... 61 6.1 Introducton...... 61 6.1 Applicaton of SBCANAL...... 61 6.2 Interpretaton...... 66 6.3 References...... 67 7. The Portuguese Market of Electricity...... 69 7.1 Introducton...... 69 7.2 The Data...... 69 7.3 The Applicaton of Method SBCANAL...... 69 7.4 Interpretaton...... 77 7.5 References...... 77 8. Final Comments...... 79 8.1. The Nature of Complex Systems...... 79 8.2 Epistemological aspects...... 79 8.3 References...... 80 Epilogue...... 81 © L. S. Barreto, 2018. The Analysis of CAS 13 A Note on the Second Editon

A Note on the Second Edition

The main changes of this second editon of the book are the following ones: • I improve fgure 2.2. • I illustrate the deducton of the matrix of total efects (secton 2.2). • I show that the functonal structure of systems, and the basic strategy to analyse them are available since the XVII century (secton 2.3). • I introduce chapter 8 with conclusive remarks. 14 © L. S. Barreto, 2018. The Analysis of CAS A Note on the Second Editon

Without text © L. S. Barreto, 2018. The Analysis of CAS 15 1. Introducton

1. Introduction

1.1. The Scope of this Book This book is a spillover of the method I introduced in Barreto (2017: chapters 17, and 18) to identfy keystone species, and controlling factors in ecosystems. The same method is also capable of the appraisal of the developmental, structural, and functonal sensitvites of the system relat- ively to its components. The scope of this text is to show that the method is applicable to other complex adaptve systems (CAS). If the reader is not familiar with the topic of complexity, and the concept of CAS there is plethora of informaton about the subject available in the internet, such as the entries in the Wikipedia. Mitchell (2009: 13) defnes succinctly CAS as: “A system that exhibits non trivial emergent and self-organizing behaviours”. The state of the art on the subject of complex systems can be found in Naciri and Tkiouat (2015). An accessible introductory text to complexity is Mitchell ( 2009). A more embracing per- spectve of complex systems can be found in Hooker (2011). The complex systems approach is applied in : • physics • ecology • biology • social sciences • forestry • economics • patern formaton • collectve moton • business management For related references see table 2 in Naciri and Tkiouat (2015). The use of the expression complexity science is commented by Professor Melanie Mitchell (Portland State University, and Santa Fe Insttute – the sanctuary of complexity) as fol- lows: “But how can there be a science of complexity when there is no agreed-on quanttatve defniton of complexityv I have two answers to this queston. First, neither a single science of complexity nor a single complexity theory exists yet, in spite of the many artcles and books that have used this terms.” (Mitchell, 2009: 13-14). Actually, the method more used to study CAS is individual (or agent) based modelling (e.g., Grimm, and Railsback, 2005). See also Niazi (2013, and references herewith). Despite the increasing use of agent based models, the interpretaton, and analysis of their outputs are conspicuously unsatsfactory (Ju-Sung Lee, Tatana Filatova, Arika Ligmann-Zielinska, Behrooz Hassani-Mahmooei, Forrest Stonedahl, Iris Lorscheid, Alexey Voinov, Gary Polhill, Zhan- liSun and Dawn C. Parker, 2015). Thus, any efort to contribute to the analysis of CAS is clearly jus- tfed.

1.2. A Sketch of the Explanatory Strategy CAS has two conspicuous atributes: 16 © L. S. Barreto, 2018. The Analysis of CAS 1. Introducton

A1. High mutability derived from its adaptability A2. High connectvity related to its complexity A1 suggests that the study of real CAS must be sustained by tme series covering a large period of tme. A2 advises the use of models that for each variable accommodates the maximum number of potental interactons. This purpose can be atained applying iector autoregressiie models (VAR) also named multiariate autoregressiie models (MAR). High connectvity associated with high number of components give origin to an intricate web of indirect efects. Thus, ultmately, the behaviour of the CAS is the refecton of the acton of the total or net efects that emerge. Consequently, the analysis of CAS must be focused on the study of the matrix of total efects. Ahead, we will be more specifc about this issue. These three paragraphs encapsulate the essental of the procedure we purpose for the analysis of CAS. In the subsequent text, frst we show that models of systems of ODE can produce simu- lated data that mirror the acton of both direct, and indirect efects, and the method to obtain total efects produces coherent results. For this purpose we use a system of omnivory. In the possession of a reliable matrix of total efects, we call the concept of autocatalysis ( Ulanowicz , 1997, 2009) to support a method concentrated on the analysis of the matrix of the total positive efects. In fgure 1.1, we atempt a fguratve synthesis of the concept of autocata- lysis.

Figure 1.1. Atempt to synthesize the causal chain related to autocatalysis. Main source of this fgure is Ulanowicz (2009)

Briefy, the core of the analysis of a CAS is the analysis of the network associated to the matrix of the total positve efects that emerges from its dynamics. © L. S. Barreto, 2018. The Analysis of CAS 17 1. Introducton

1.3. The Book Referring to the areas were the existence of CAS emerge, we will not be exhaustve. The CAS used to illustrate the applicability of the method of analysis are from ecology, and economics. In chapter 2,we use a simple system from ecology (omnivory) to illustrate the correctness of the frst part of the proposed method to analyse CAS, this is, the obtenton of a credible mat- rix of total efects. Chapter 3 is dedicated to the presentaton of method SBCANAL, for the analysis of CAS. In chapter 4, I apply SBCANAL to ecological CAS. We verify the adequacy of the method to identfy keystone species, and controlling factors in ecosystems. In chapter 5 we widen the signifcance of the results given by SBCANAL. Chapter 6 is devoted to the analysis of a macroeconomic CAS. In chapter 7 the proposed method is applied to the analysis of the Portuguese market of electricity. Chapter 8 is dedicated to conclusive remarks. For easier control we insert in the text the adequate R scripts.

1.4. References

Barreto, L. S., 2017. Theoretcal Ecology. A Unified Approach. Second editon. E-book, Costa de Caparica. htp:// hdl.handle.net/10400.5/14 1 75 Grimm, V., and S. F. Railsback. 2005. Indiiidual Based Modeling and Ecology. Princeton University Press. Mitchell, M., 2009. Complexity. A Guided Tour. Oxford University Press. Hooker, C., Editor, 2011. Philosophy of Complex Systems. Elsevier. Ju-Sung Lee, Tatana Filatova, Arika Ligmann-Zielinska, Behrooz Hassani-Mahmooei, Forrest Stonedahl, Iris Lorscheid, Alexey Voinov, Gary Polhill, ZhanliSun and Dawn C. Parker, 2015. The Complexites of Agent-Based Model- ing Output Analysis. Journal of Artficial Societes and Social Simulaton 18 (4) 4. DOI: 10.18564/jasss.2897 Naciri, N., and M. Tkiouat, 2015. Complex System Theory Development. Internatonal Journal of Latest Research in Science and Technology, 4(6):93-103. ISSN (Online):2278-5299 Niazi, M. A., 2013. Complex Adaptve Systems Modeling: A multdisciplinary Roadmap. Complex Adaptie Systems Modeling 2013, 1:1 htp://www.casmodeling.com/content/1/1/1 Ulanowicz, R. E., 1997. Ecology, the Ascendent Perspectie. Columbia University Press, New York Ulanowicz, R.E., 2009. Autocatalysis. Em S. E. Jørgensen, (Main editor), . Elsevier, Amsterdam. Pages 41-43. htps://en.wikipedia.org/w/index.phpvttle=Complex_adaptve_systemooldid=82356771 "2 18 © L. S. Barreto, 2018. The Analysis of CAS 1. Introducton

Without text © L. S. Barreto, 2018. The Analysis of CAS 19 2. A System of Omnivory

2. A System of Omnivory

2.1 Direct, Indirect, and Total Effects In the social, and fnancial sphere, we are all familiar with chain efects triggered by a single event or measure adopted by a government. The European Central Bank maintains a low rate of interest, and buy natonal debt of some countries because it assumes that this measures trigger a net of interrelated efects that favours the economies of the European countries. We are all fa- miliar with the following causal chain: increasing the income of citzens → increases consumpton → increases investment in produc- ton of goods for the consumers → increase employment .. This example is a very simple causal chain. Real systems are much more complex and the task of economists are much more difcult and plagued with disagreement. What makes the understanding of the behaviour of complex systems (as ecosystems, and natonal economies) in- tricate, and their dynamics almost unpredictable beyond a short period of tme, are the rich network of direct, and indirect efects (those mediated by a third component). Let us introduce an example that will be numerically illustrated ahead. Consider the fol- lowing chain of omnivory:

Figure 2.1. Diagrammatc representaton of omnivory. Populatons as: y1 is the plant; y2 is the ; y3 is the

The omnivore y3 has a negatve direct efect on plant y1, and a positve indirect efect be-

cause it diminishes the number of y2 that also consume the plant. The total efect (TE) of y3 on y1 is the sum of the direct, and indirect efects:

Total or net efeet oo 3 on 1= Direet efeet oo 3 on 1 + indireet efeet oo 3 on 1

If y3 has a very small consumpton of y1, y2 grazes y1 intensively, and y3 consumes intens-

ively y2, the total efect of y3 on y1 may be positve.

On the other side, If y3 has a heavy consumpton of y1, y2 grazes y1 lightly, and y3 consumes

lightly y2, the total efect of y3 on y1 may be negatve. In an ecosystem, the is the set of all populatons of the species present in the ecosystem. Tentatvely, let me introduce an ontological interpretaton (fgure 2.2). The direct efects are controlled by the propertes of the components. These propertes determine the kind of interactons that relate the components to each other. Interactons are indispensable for the existence of systems, causality, identty, and unity. Interactons are ubiquitous from social sciences to theoretcal physics. 20 © L. S. Barreto, 2018. The Analysis of CAS 2. A System of Omnivory

Interactons are constrained by laws (e.g., physical, chemical, allometric) actuatng in each given situaton, and give origin to direct efects. From direct efects and high connectvity emerge indirect efects. Total efects are the sum or balance of direct, and indirect efects. It is the network of TE that controls the system. We can add the efects of the environ- mental factors on the system, and arrive to a similar conclusion: the network of TE controls the system (CAS).

Figure 2.2. Simplifed conjecture about the dynamics of CAS

In fgure 2.2, the chain components→ interactons → direct efects is reductonist but the chain direct efects → high connectvity → indirect efects is holistc. To clarify the dynamics of CAS we must use both approaches. In the XVII century, Blaise Pascal, in his Pensées, (Pascal, 1958: Secton II, subsecton 72)" already wrote:

“...I hold it equally impossible to know the parts without knowing the whole, and to know the whole without knowing the parts in detail.”

From fgure 2.2, we also conclude that if we want to understand CAS we must fnd a pro- cedure to estmate TE. It is at this point that MAR(1) reveal their utlity. © L. S. Barreto, 2018. The Analysis of CAS 21 2. A System of Omnivory

2.2 The Matrix of Total Effects

A procedure to calculate the total efect of species yj on species yi is to verify how this spe-

cies responds to the introducton of individuals of species yj in the system. To illustrate this statement, let us use model BACO3 (Barreto, 2017: chapter 11) for inter- specifc competton. The ordinary diferental equatons of this model are modifed forms of the ODE for the Gompertz equaton (e.g., Barreto, 2017: chapter 4). To the intraspecifc compet-

ton, we add the interspecifc competton. Let us assume the presence of three compettors, yi, i=1,2,3. Then, the model is writen as:

dy1  y1c1(ln y1 f  a11 ln y1  a12 ln y2  a13 ln y3) dt (2.1)

dy2  y2c2 (ln y2 f  a21 ln y1  a22 ln y2  a23 ln y3) dt (2.2)

dy3  y3c3(ln y3 f  a31 ln y1  a32 ln y2  a33 ln y3) dt (2.3)

Being yif, the fnal sizes of the populatons, when the species grow isolated. In a fxed point it is verifed:

0  ln y  a ln y  a ln y  a ln y 1 f 11 1 12 2 13 3 (2.4)

0  ln y  a ln y  a ln y  a ln y 2 f 21 1 22 2 23 3 (2.5)

0  ln y  a ln y  a ln y  a ln y 3 f 31 1 32 2 33 3 (2.6)

Now, we introduce perturbaton I2=1, in the equaton of species y2. The system moves to a new equilibrium y*i, i=1,2,3. To calculate the alteratons caused by perturbaton I2 we diferentate the equatons with respect to I2, at the new equilibrium (yif are constants):

3 y (I ) 0  a j 2  1 j I j1 2 (2.7)

3 y  (I ) 0  a j 2 1  2 j I j1 2 (2.8) 22 © L. S. Barreto, 2018. The Analysis of CAS 2. A System of Omnivory

3 y (I ) 0  a j 2  3 j I j1 2 (2.9)

Let us now use the matrix form of our problem, for easier soluton. The competton coefcients aij are the elements of matrix A.

 y1 (I2 ) I 0 2 y (I )  1  A 2 2 I 0 2  y3 (I2 ) I 2 (2.10)

From this equaton we obtain:

 y1 (I2 ) I 2 0 y (I ) 2 2  E1 I 2 0  y3 (I2 ) I 2 (2.11)

Where E=-A-1. To have the inverse, matrix A must be nonsingular (determinant diferent from zero). Matrix E is the matrix of total efects, and matrix A is the community matrix. Matrix E says that the total efect caused by the additon of one individual of species 2 on the new equilibrium of species 1 is:

y (I ) 1 2  (a )1  e I 12 12 2 (2.12)

-1 -1 In this equaton, -(a12) is the element of line i, and column j of matrix -A . Generically, the total efect caused by the additon of one individual of species j (column of matrix E) in the new equilibrium of specie i (line of matrix E) is:

y (I ) i j  (a )1  e I ij ij j (2.13)

Recapitulatng, if we construct a matrix with the coefcients of the multvariate linear models suggested in secton 1.2, we have the community matrix A. To obtain the matrix of total efects E: © L. S. Barreto, 2018. The Analysis of CAS 23 2. A System of Omnivory

• We calculate the inverse of matrix A;

•The inverse matrix is multplied by -1 to obtain the matrix of total efects E.

Let eij be the element of line i, and column j of E. The element eij is the total efect of spe- cies j (column) on species i (row). Now we apply these concepts to a system of omnivory.

2.3 A Model for Omnivory The model for omnivory is an extension of model SBPRED for predaton (Barreto, 2016: secton 18.4). This model exhibits two ODE that are modifed forms of the ODE of theGompertz equa- ton. The equaton for the is:

(2.14)

Gompertz equaton Consumpton by the

K is the , asymptotc or fnal value of y1. The speed of growth is determ-

ined by the parameter c1. The expression for the consumpton is called the hyperbolic or Holling type 2 functonal

response, and it is multplied by the number of consumers y2. The greater is a, the area of dis- covery, the greater is the consumpton. The handling tme of the resource, h, is the tme re- quired to dominate, eat, and digest the prey, before the consumer start searching another prey. The greater is h, the smaller is the consumpton per tme unit.

The ODE for the consumer, y2, is:

(2.15)

The carrying capacity of the predator is equal to the number of prey multplied by the parameter b, that mirrors the contributon of each prey to the carrying capacity of the predator

(K2=by1). The parameter b depends on the parameters of the functonal response, and the ef- ciency of the predator on transforming the preys in its own growth Now we can introduce the model to omnivory.

2.3.1 Assumptons Let us approach the interacton of omnivory represented in fgures 2.2. We assume the following:

 The basal species (y1) is a plant that only plays the role of resource;

 The middle species (y2) is a herbivore that plays both the role of consumer, and resource;

 The top species (y3) is an omnivore that consumes the previous two species 24 © L. S. Barreto, 2018. The Analysis of CAS 2. A System of Omnivory

2.3.2 The Model The model is writen as:

(2.16)

(2.17) (2.18)

For easier reference I call this model PANT3.

2.3.3 Model Analysis PANT3 has not an explicit soluton, thus we will use a numerical approach. This model evinces stable fxed points, and periodic solutons. Now let us illustrate the concepts of the previous secton, using R:

> > library(deSolve) > library(rootSolve) Warning message: package ‘rootSolve’ was built under R version 3.3.2 > library(MASS) > > ############ Parameters > c1=0.05; k1=80; a1=1; h1=1; a2=.8; h2=1; c2=0.1 > b1=.4; a3=0.6; h3=0.7; c3=0.15; b2=.3; b3=.2 > #**************** para obter comensalismo presa-omniv subir a1 de 1 para 8 > > #*************** Model, and solution > baco3<-function(times,y,parms) { + n<-y + + + + dn1.dt<- c1*n[1]*(log(k1)-log(n[1]))-a1*n[1]*n[2]/(1+a1*h1*n[1])- a2*n[1]*n[3]/(1+a2*h2*n[1]+a3*h3*n[2]) + dn2.dt<- c2*n[2]*(log(b1*n[1])-log(n[2]))-a3*n[2]*n[3]/(1+a2*h2*n[1]+a3*h3*n[2]) + dn3.dt<- c3*n[3]*(log(b2*n[1]+b3*n[2])-log(n[3])) + return(list(c(dn1.dt,dn2.dt,dn3.dt))) + } > > > > initialn<-c(2, 0.5, 0.8) > t.s<- seq(1,300, by=0.1) > > > out<- ode(y=initialn, times=t.s, baco3, parms=parms) > > > matplot(out[,1], out[,-1], type="l", col=1, xlab="Time", ylab="",ylim=c(0,3)) > title("Omnivory") > r<-c('Plant','Herbivore','Omnivore') © L. S. Barreto, 2018. The Analysis of CAS 25 2. A System of Omnivory

> legend('topright',paste(rev(r)),lty=3:1,col=1, bty='n') >

We obtain fgure 2.3.

> #Fixed point > y<-initialn > ST2 <- runsteady(y=y,func=baco3,parms=parms,times=c(0,5000)) > ye<-ST2$y > ye [1] 1.0750756 0.1435188 0.3512265 Fixed point > #Preparing data to fit MAR(1) > h<-out[,-1] > > g<-seq(1,2991,10) > dat0<-matrix(c(h[g,]),300,3) > N1<-dat0[,1] > N2<-dat0[,2] > N3<-dat0[,3] > ###################################### > > ## Functional responses of plant consumption > > rf1=a1*N1*N2/(1+a1*h1*N1) > rf2=a2*N1*N2/(1+a2*h2*N1+a3*h3*N2) > rf=matrix(c(rf1,rf2),nrow=300, ncol=2) > > matplot(rf, type="l", col=1:2, xlab="Tempo", ylab="Biomassa",ylim=c(0,0.5)) > > title("Fuctional response of plant consumption") > r<-c('Herbivore','Omnivore') > legend('topright',paste(r),lty=1,col=1:2, bty='n')

We obtain fgure 2.4.

> ###### MAR(1) > > m<-c(dim(dat0)) > N1a<-N1[-1] > N1b<-N1[-m[1]] > N2a<-N2[-1] > N2b<-N2[-m[1]] > N3a<-N3[-1] > N3b<-N3[-m[1]] > > fit1<-lm(N1a ~ N1b+N2b+N3b) > fit2=lm(N2a ~ N1b+N2b+N3b) > fit3=lm(N3a ~ N1b+N2b+N3b) > summary(fit1) Call: lm(formula = N1a ~ N1b + N2b + N3b)

Residuals: Min 1Q Median 3Q Max -0.0187033 -0.0005764 -0.0005748 -0.0005692 0.0176170

Coefficients: Estimate Std. Error t value Pr(>|t|) 26 © L. S. Barreto, 2018. The Analysis of CAS 2. A System of Omnivory

(Intercept) 0.147109 0.002704 54.398 < 2e-16 *** N1b 1.031816 0.002032 507.672 < 2e-16 *** N2b -0.984843 0.024103 -40.859 < 2e-16 *** N3b -0.112166 0.013577 -8.261 4.93e-15 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.003742 on 295 degrees of freedom Multiple R-squared: 0.999, Adjusted R-squared: 0.999 F-statistic: 1.025e+05 on 3 and 295 DF, p-value: < 2.2e-16

> summary(fit2)

Call: lm(formula = N2a ~ N1b + N2b + N3b)

Residuals: Min 1Q Median 3Q Max -0.0030700 0.0000033 0.0000037 0.0000049 0.0040778

Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.0113767 0.0003498 32.53 <2e-16 *** N1b 0.0283827 0.0002629 107.98 <2e-16 *** N2b 0.7648236 0.0031173 245.35 <2e-16 *** N3b -0.0231806 0.0017560 -13.20 <2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.0004839 on 295 degrees of freedom Multiple R-squared: 0.9997, Adjusted R-squared: 0.9997 F-statistic: 3.044e+05 on 3 and 295 DF, p-value: < 2.2e-16

> summary(fit3)

Call: lm(formula = N3a ~ N1b + N2b + N3b)

Residuals: Min 1Q Median 3Q Max -0.0041753 0.0001649 0.0001662 0.0001670 0.0023129

Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.0020775 0.0006634 3.131 0.00191 ** N1b 0.0563517 0.0004986 113.016 < 2e-16 *** N2b -0.0001651 0.0059132 -0.028 0.97775 N3b 0.8211913 0.0033309 246.535 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.0009179 on 295 degrees of freedom Multiple R-squared: 0.9997, Adjusted R-squared: 0.9997 F-statistic: 2.95e+05 on 3 and 295 DF, p-value: < 2.2e-16

> > > L1=coef(fit1)[-1] > L2=coef(fit2)[-1] > L3=coef(fit3)[-1] © L. S. Barreto, 2018. The Analysis of CAS 27 2. A System of Omnivory

> > #Community matrix > A=(matrix(c( L1,L2,L3), nrow=3,ncol=3,byrow=T)) > A [,1] [,2] [,3] [1,] 1.03181611 -0.9848425491 -0.11216580 [2,] 0.02838268 0.7648236499 -0.02318058 Community matrix [3,] 0.05635174 -0.0001650524 0.82119130 > > #Matrix of total effects > > E=-ginv(A) > E [,1] [,2] [,3] [1,] -0.92754899 -1.19441415 -0.16040902 [2,] 0.03635079 -1.26068963 -0.03062162 matrix of total effects [3,] 0.06365752 0.08170963 -1.20674163 > > eigen(A)$values [1] 0.8708778+0.1203088i 0.8708778-0.1203088i 0.8760755+0.0000000i > eigen(E)$values [1] -1.141454+0.000000i -1.126763+0.155658i -1.126763-0.155658i >

The omnivore has a negatve total efect on the plant (e13=-0.1604). The dominant eigenvalue of matrix A close to 1 (0.876) mirror the statonarity of the fxed point of the system. The negatve real part of the eigenvalues of the TE matrix (E) refects the stability of the soluton.

> ############# Simulation with MAR(1) > > bc4<-function(N) { + + N1.t1<-coef(fit1)[1]+A[1,1]*N[1]+A[1,2]*N[2]+A[1,3]*N[3] + N2.t1<-coef(fit2)[1]+A[2,1]*N[1]+A[2,2]*N[2]+A[2,3]*N[3] + N3.t1<-coef(fit3)[1]+A[3,1]*N[1]+A[3,2]*N[2]+A[3,3]*N[3] + + c(N1.t1, N2.t1,N3.t1) + } > > > t<-300 > > N<-matrix(NA,nrow=t+1, ncol=3) > N[1, ]<-c(2, 0.5, 0.8) > for (i in 1:t) N[i+1, ]<-bc4(N[i, ]) > > matplot(0:t, N, type='l', col=1, ylim=c(0,4), xlab="Time", ylab="Biomass",) > lines(N1b, col='red') > lines(N2b, col='red') > lines(N3b, col='red') > title("Linear model fitting") > r<-c('Plant','Herbivore','Omnivore') > legend('topleft',paste(rev(r)),lty=3:1,col=1, bty='n') >

Figure 2.5 is created. 28 © L. S. Barreto, 2018. The Analysis of CAS 2. A System of Omnivory

Figure 2.3. Simulaton of the dynamics of model PANT3

Figure 2.4. Dynamics of the plant consumpton, in the simulaton with model PANT3 © L. S. Barreto, 2018. The Analysis of CAS 29 2. A System of Omnivory

Figure 2.5. Populaton dynamics with MAR(1), and model PANT3 (red line)

Now we assume that the area of discovery of the herbivore is not 1 but 8 (a1=8). Let us see what happens to the system. The dynamics of the system is evinced in fgure 2.6.

Figure 2.6. Simulaton of the dynamics of model PANT3, with a1=8

The fxed point is now y1= 0.51215076, y2=0.09995082, y3= 0.17363530. The consumpton of the plant is exhibited in fgure 2.7. 30 © L. S. Barreto, 2018. The Analysis of CAS 2. A System of Omnivory

Figure 2.7. Dynamics of the plant consumpton, in the simulaton with model PANT3, with a1=8

The new community, and total efects matrices are:

> #Community matrix > A=(matrix(c( L1,L2,L3), nrow=3,ncol=3,byrow=T)) > A [,1] [,2] [,3] [1,] 1.16972321 -2.6493694 0.48446100 [2,] 0.03915076 0.7286820 -0.02593494 [3,] 0.05062359 0.2389646 0.69399462 > > ##Matrix of total effects > > E=-ginv(A) > E [,1] [,2] [,3] [1,] -0.77454315 -2.9571862 0.43017840 [2,] 0.04309751 -1.1911807 -0.07460039 Matrix E [3,] 0.04165936 0.6258743 -1.44662551

Now, with a very voracious herbivore, the omnivore has a positve total efect on the plant

(e13=0.43017840). Model PANT3, and the used analytcal procedure evinced satsfactory sensitvity, and coherence. The problem of obtaining matrix E is solved with a trustul soluton. Let us examine matrix E, in the output of the previous R script. All elements of matrix E are non zero. This is, each species is simultaneous cause (column), and efect (line). It is this web of mutual causal relatons that render systems less prone to a simple analysis. This situaton is more acute when systems have a large number of components. © L. S. Barreto, 2018. The Analysis of CAS 31 2. A System of Omnivory

More than three centuries ago, Blaise Pascal had already depicted this duality of roles in nature. For him, it is this duality that justfy the fail of the analysis of systems adoptng only a reductonist or only a holistc approach, as stated in his previous quotaton. Now, we can introduce the complete thought of Pascal (previous quotaton in brown):

“Since everything then is cause and efect, dependent and supportng, mediate and immediate, and all is held together by a natural though imperceptble chain, which binds together things most distant and most diferent, I hold it equally impossible to know the parts without knowing the whole, and to know the whole without knowing the parts in detail.” The functonal structure of systems, and the basic strategy to analyse them are available since the XVII century. Pascal’s conjectures were too advanced relatvely to the available mathematcal tools to implement them. Probably, this is the reason why they fell in oblivion. Today, very few scientsts read Pascal’s Pensés. In fgure 2.8 the fowchart of the analytcal process is exhibited.

Figure 2.8. A fowchart of the method to obtain the matrix of total efects

From here on, the matrix of the coefcients of the MAR will be called community matrix, and will be represented by A. The matrix of total efects is represented by E. This chapter benefts from Barreto (2017), and Case (2000).

2.4 References

Barreto, L. S., 2016. Ecologia Teórica. Uma Outra Explanação. III – Comunidade e Ecossistema. E-book, Costa de Capari- ca. htp://hdl.handle.net/10400.5/142 31 32 © L. S. Barreto, 2018. The Analysis of CAS 2. A System of Omnivory

Barreto, L. S., 2017. Theoretcal Ecology. A Unified Approach. Second editon. E-book, Costa de Caparica. htp:// hdl.handle.net/10400.5/14 1 75 Case, T. J., 2000. An Illustrated Guide to Theoretcal Ecology. Oxford University Press, Oxford, U. K. Pascal, B., 1958. "Pascal's Pensées".Published 1958 by E. P. Duton o Co., Inc.. Downloaded from Project Gutenberg. © L. S. Barreto, 2018. The Analysis of CAS 33 3 SBCANAL: A Procedure to Analyse CAS

3 SBCANAL: A Procedure to Analyse CAS

3.1 Introduction As already stated in chapter 1, the method here proposed was originated in the area of ecology, and conservaton (Barreto, 2017). Initally, the method searched a soluton for a problem created by the increasing disrupt- ive efect of humanity on the biosphere. This degrading impact rendered the detecton of key- stone species, and of controlling components of the ecosystem in almost an ethical imperatve for ecologists. It is not surprising that several authors had already approached this subject, such as Libralato, Christensenc, and Paulyc (2006), Smith et al. (2014), and Zhao et al. (2016). Thus the method was our contributon to the soluton of this problem. After, successfully, we searched the applicability of the method to other types of CAS. This text is a consequence of this inquiry.

3.2 The Procedure The procedure integrates the following concepts, and models: - CAS can be modelled by MAR(1). - The concept of autocatalysis (Ulanowicz , 1997, 2009). - The concept of total positve efects (chapter 2). - The concept of transitvity or clustering coefcient, from network analysis (e.g., Kolaczyk, and. Csárdi, 2014). The procedure is sustained by the following conjecture:

In the network associated to the matrix of total positie efects (MTPE), the nodes with high transitiity must giie a strong contributon to the process of autocatalysis, and thus they haie high probability of being components to which the CAS is iery sensitie.

Given the tme series of the components of the CAS, the steps of the procedure are the following ones (fgure 3.1): 1. Fit a MAR(1) model to the data; 2. From the matrix of the coefcients extract the matrix of the total positve efects; 3. Use this matrix as a weighted adjacency matrix, and obtain the correspondent network; 4. Calculate the clustering coefcient or transitvity of each node; 5. Select the nodes (components) with high coefcients as candidates to be controlling components of the CAS. Basically, we apply network analysis not to the data itself, but to the matrix of total positve efects underpinning the data dynamics. The procedure is simultaneously dynamic (MTPE), and statc (network analysis). For easier reference, this procedure is named SBCANAL . The analysis of the network associated to the matrix of the total positve efects may have a larger scope then the sole transitvity, and may be object of a more enlarged, and deeper analysis using the available functons in the package igraph or any other similar package available. The extension of the analysis, and the analytcal tools used depend on the kind of CAS, and the purpose of the analysis. 34 © L. S. Barreto, 2018. The Analysis of CAS 3 SBCANAL: A Procedure to Analyse CAS

As it will be illustrated ahead, the cluster coefcients of the nodes provide a ranking of the sensitvity of the CAS to the variatons per se of each one of the components of the system. In same situatons this informaton may high valuable.

Figure 3.1. Flowchart of the procedure to analyse CAS, with method SBCANAL

The method reveals a shortcoming: its exigence of tme series of several years. In some area of research, as ecology, more often projects last only 3-4 years. This is seldom enough to obtain a good fing for the VAR model. Probably, we must revise the funding of ecological projects, as the administratve tme scale is not coincident with the one of some ecological research projects. Otherwise, we will never acquire the informaton we need to successfully overcome the environmental crisis.

3.3 References Barreto, L. S., 2017. Theoretcal Ecology. A Unified Approach. Second editon. E-book, Costa de Caparica. htp:// hdl.handle.net/10400.5/14 1 75 Kolaczyk, E. D., and G. Csárdi, 2014. Statstcal Analysis of Network Data with R. Springer, Berlin. Libralato, S., V. Christensenc, and D. Paulyc, 2006. A method for identfying keystone species in models. Ecological Modelling, 195:153–171. © L. S. Barreto, 2018. The Analysis of CAS 35 3 SBCANAL: A Procedure to Analyse CAS

Smith, C. et al, 2014. Report on identficaton of keystone species and processes across regional seas. Deliverable 6.1, DEVOTES Project. 105 pp + 1, Annex. Ulanowicz, R. E., 1997. Ecology, the Ascendent Perspectie. Columbia University Press, New York Ulanowicz, R.E., 2009. Autocatalysis. Em S. E. Jørgensen, (Main editor), Ecosystem Ecology. Elsevier, Amsterdam. Pages 41-43. Zhao, L. et al., 2016. Weightng and indirect efects of identfy keystone species in food webs. Ecology Leters, 19:1033-1040. 36 © L. S. Barreto, 2018. The Analysis of CAS 3 SBCANAL: A Procedure to Analyse CAS

Without text © L. S. Barreto, 2018. The Analysis of CAS 37 4 Identfcaton of Keystone Species, and Controlling Components in the Ecosystem

4 Identification of Keystone Species, and Controlling Components in the Ecosystem

4.1 Introduction We were unable to fnd real data, a tme series covering many years (or other tme unit), of an ecosystem or community including a keystone species. Then, we used simulated data to apply the method in the search of keystone species, and real data for the problem of the identfcaton of controlling factors of the ecosystem. In the next secton we succinctly present the model of ecosystem we use. It is obtained from Barreto (2017: chapters 15 and 16). This reference can consulted for more details.

4.2 The Simulated Ecosystem The hypothetcal ecosystem is characterized as follows: • It has a community with nine populatons; • The existence of a nutrient that acts as a limitng factor; • The cycle of the nutrient is closed. In terrestrial ecosystems this can be accepted with any reluctance. For instance, see Chapin III, Matson, and Mooney (2002:220-222). The interactons present in the community are: • Herbivory; • Competton; • Facultatve ; • Obligatory mutualism; • Predaton; • Omnivory. A graphical representaton of the ecosystem is exhibited in fgure 4.1. From fgure 15.3, we can infer the following:

• Variable 1 refers to the nutrient;

• Variable 2 refers to the vegetaton;

• Species 3 to 7 are herbivores;

• Variable 10 is a top predator (can also be a parasite);

• Specie 8 is omnivore and reveals intra-trophic predaton, as he consumes 9;

• There is an interacton of obligatory mutualism between species 3 e 4;

• There is an interacton of facultatve mutualism between species 6 e 7; The size of the populatons are measured using an arbitrary unit of biomass B. There are more compettve interactons then those represented in fgure 4.1. We sup- pressed them to avoid an almost illegible network. The complementary informaton about the prevailing competton is as follows: • As the species have a Gompertzian dynamics they are submited to intraspecifc com- petton; • The interspecifc competton between herbivores is asymmetric; • The species of each mutualistc interacton do not compete with each other;

• Specie y3 benefts from the presence of species y5, y6, y7;

• Specie y4 benefts from the presence of species y5, y6, y7;

• Specie y5 benefts from the presence of species y6, y7 but is depressed by species y3, y4;

• Specie y6 is depressed by y3, y4, y5; 38 © L. S. Barreto, 2018. The Analysis of CAS 4 Identfcaton of Keystone Species, and Controlling Components in the Ecosystem

• Specie y7 is depressed by y3, y4, y5.

Figure 4.1. Flowchart of the simulated ecosystem

The following is also assumed: • All species release 1% of their biomasses to the soil, in unit of tme; • For each unit of nutrient assimilated by the plant, it produces 1000 units of plant biomass;

• The carrying capacity of the plant is 1000 y1; • The contents of the nutrient in the biomasses are: plant: 0,001; herbivores: 0.01;

omnivore, and predator y9:0,1; top predator:0,3; • The ODE of the nutrient is equal to the contents of the fallen liter less the plant uptake;

• The plant uptake is given by y2*y1/(50+0.4*y1). The model is described by the following system of 10 ordinary diferental equatons:

dy 10 y y 1  Te 0.01y  1 2  i i (4.1) dt 2 (50  0.4y1) Te=[0.001 0.01 0.01 0.01 0.01 0.01 0.1 0.1 0.3]

dy 2  y r (ln(1000 y  ln y ))  ex  0.01y dt 2 1 1 2 2 (4.2) © L. S. Barreto, 2018. The Analysis of CAS 39 4 Identfcaton of Keystone Species, and Controlling Components in the Ecosystem

r1= 0.05

ex<-y2*y3/(70+0.2*y4)+ y4*y2/(90+0.3*y2)+y5*y2/(90+0.3*y2)+y6*y2/(80+0.3*y2)+

+y7*y2/(75+0.3*y2)+y8*y2/(83+0.3*y2) dy 3  r y (8y 1010 )(ln(b y )  ln( y  comp )  prey7[1] 0.01y dt 2 3 4 2 2 3 2 3 (4.3)

r2= 0.069, b2= 0.2

comp2=0+0+0.02*ln y5+0.03*ln y6+0.04*ln y7

prey7[1]=y8*y3/(50+0.2*y3)

dy 4  r y (9y 1010 )(ln(b y )  ln( y  comp )  prey7[2] 0.01y dt 3 4 3 3 2 4 3 4 (4.4)

r3= 0.061, b3= 0.21

comp3=0+0+0.01*ln y5+0.02*ln y6+0.03*ln y7

prey7[2]=y8*y4/(60+0.3*y4)

dy (4.5) 5  r y (ln(b y )  ln y  comp )  prey8[1] 0.01y dt 4 5 4 2 5 4 5

r4=0.057, b4= 0.28

comp4=-0.04*ln y3 -0.03*y4+0+0.01*ln y6+0.02*ln y7

prey8[1]=y9*y5/(50+0.21* y5)

dy 6  r y (ln(b y (2  e0.003y7 )  ln y )  comp )  prey8[2] 0.01y dt 5 6 5 2 6 5 6 (4.6)

r5= 0.055, b5= 0.29

comp5=-0.04*y3-0.03*y4-0.02y5+0+0

prey8[2]=y9*y6/(60+0.3*y6)

dy 7  r y (ln(b y (2  e0.03y7 )))  ln( y  comp )  prey8[3] 0.01y dt 6 7 6 2 7 6 7 (4.7)

r6= 0.05, b6= 0.27

comp6=-0.04*y3-0.03*y4-0.02y5+0+0

prey8[3]=y9*y7/(70+0.3*y7))

dy 8  r y (ln k  ln y )  prey9[1] 0.01y dt 7 8 7 8 8 (4.8)

r7= 0.06, k7= 6.667y2+ 0.0667y3+ 0.070y4 40 © L. S. Barreto, 2018. The Analysis of CAS 4 Identfcaton of Keystone Species, and Controlling Components in the Ecosystem

prey9[1]=y10*y8/(30+0.2*y8) dy (4.9) 9  r y (ln k  ln y )  prey9[2] prey7[3] 0.01y dt 8 9 8 9 9 r8= 0.035, k8= 0.112y5+ 0.116y6+ 0.108y7 prey9[2]= y10*y9/(40+0.3*y9) prey7[3]=y8y9(45+0.23*y9))

dy 10  r y (ln k  ln y )  0.01y dt 9 10 9 10 10 (4.10) r9= 0.02, k9=0.4535y8+ 0.028y9

If we remove the top predator (y10) from the system it collapses, this is, the answer of the

simulator for the system, in R platorm, is ‘NA’ for the sizes of the other variables. Thus, y10 is a keystone species. We showed in Barreto (2017: chapter 16) that MAR(1) can be well fted to the data gen- erated by the simulator of the described ecosystem. The constructed ecosystem do not pretend to represent any partcular community, and the choice of the interactons only serves to our explanatory purposes. The same is applicable to the parametrisaton of the model.

4.3 The Identification of Keystone Species

To apply SBCANAL to the ecosystem we constructed, the following R script is applied:

> #semomtransBk > library(deSolve) > library(MASS) > library(rootSolve) > > modul<-function(times,y,parms) { + n<-y + + r<-c(0.05, 0.09, 0.071, 0.057, 0.055, 0.07, 0.06, 0.035, 0.02) + b<-c(20, 0.2, 0.21, 0.28, 0.29, 0.27) + b7<-c(b[1], b[2], b[3])/3 + b8<-c(b[4], b[5], b[6])/2.5 + bm7<-mean(b7)/5 + bm8<-mean(b8)/4 + b9<-c(bm7, bm8) + + + #plant:consumption of the plant + #herb & omniv + ex<-sum( y[2]*y[3]/(70+0.2*y[2]), y[4]*y[2]/(90+0.3*y[2]), y[5]*y[2]/(90+0.3*y[2]), y[6]*y[2]/(80+0.3*y[2]), y[7]*y[2]/(75+0.3*y[2]), y[8]*y[2]/(83+0.3*y[2])) + + # and of the herbivores © L. S. Barreto, 2018. The Analysis of CAS 41 4 Identfcaton of Keystone Species, and Controlling Components in the Ecosystem

+ #inicial/final<-iniciais/(bi*resouce) + + a1n<-c(0, 0, 0.02, 0.03, 0.04) + y1n<-log(c(y[3], y[4], y[5], y[6], y[7])) + a2n<-c(0, 0, 0.01, 0.02, 0.03) + y2n<-log(c(y[3], y[4], y[5], y[6], y[7])) + a3n<-c(-0.04, -0.03, 0, 0.01, 0.02) + y3n<-log(c(y[3], y[4], y[5], y[6], y[7])) + a4n<-c(-0.04, -0.03, -0.02, 0, 0) + y4n<-log(c(y[3], y[4], y[5], y[6], y[7])) + a5n<-c(-0.04, -0.03, -0.02, 0, 0) + y5n<-log(c(y[3], y[4], y[5], y[6], y[7])) + + #effects of competition + comp2<-sum(a1n*y1n) + comp3<-sum(a2n*y2n) + comp4<-sum(a3n*y3n) + a5n<-c(-0.04, -0.03, -0.02, 0, 0) + y5n<-log(c(y[3], y[4], y[5], y[6], y[7])) + comp5<-sum(a4n*y4n) + comp6<-sum(a5n*y5n) + + + + #consumption of predators y[8], y[9] & y[10] + prey7<-y[8]*c(y[3]/(50+0.2*y[3]), y[4]/(60+0.3*y[4]), y[9]/(45+0.23*y[9])) + prey8<-y[9]*c(y[5]/(50+0.21*y[5]), y[6]/(60+0.3*y[6]), y[7]/(70+0.3*y[7])) + + prey9<-c(y[10]*y[8]/(30+0.2*y[8]), y[10]*y[9]/(40+0.3*y[9])) + #comp. oblig mutual prey + + #carrying capacity of y8 + k7<-sum(b7*c(y[2], y[3], y[4])); + + #carrying capacity of y9 + k8<-sum(b8*c(y[5], y[6], y[7])) + #carrying capacity of y10 + k9<-sum(b9*c(y[8], y[9])) + #fraction of biomass that falls + fr=0.01 + biom=c(y[2:10]) + m=fr*biom # fallen biomass + #nutrient in the biomasses + te=c(0.001,rep(0.01,5),rep(0.1,2),0.3) + + #ODE + dy1.dt<-sum(te*m)-y[2]*y[1]/(50+0.4*y[1]) + dy2.dt<-y[2]*r[1]*(log(1000*y[1])-log(y[2]))-ex-m[1] + dy3.dt<-y[3]*r[2]*(8*y[4]-10^(-10))*(log(b[2]*y[2])-log(y[3])+comp2)- prey7[1]-m[2] + dy4.dt<-y[4]*r[3]*(9*y[3]-10^(-10))*(log(b[3]*y[2])-log(y[4])+comp3)- prey7[2]-m[3] + dy5.dt<-y[5]*r[4]*(log(b[4]*y[2])-log(y[5])+comp4)-prey8[1]-m[4] + dy6.dt<-y[6]*r[5]*(log(b[5]*y[2]*(2-exp(-0.003*y[7])))-log(y[6]) +comp5)-prey8[2]-m[5] + dy7.dt<-y[7]*r[6]*(log(b[6]*y[2]*(2-exp(-0.03*y[7])))-log(y[7])+comp6)- prey8[3]-m[6] + dy8.dt<-y[8]*r[7]*(log(k7)-log(y[8]))-prey9[1]-m[7] + dy9.dt<-y[9]*r[8]*(log(k8)-log(y[9]))-prey9[2]-prey7[3]-m[8] + dy10.dt<-y[10]*r[9]*(log(k9)-log(y[10]))-m[9] 42 © L. S. Barreto, 2018. The Analysis of CAS 4 Identfcaton of Keystone Species, and Controlling Components in the Ecosystem

+ + + return(list(c(dy1.dt,dy2.dt,dy3.dt, dy4.dt, dy5.dt, dy6.dt,dy7.dt,dy8.dt, dy9.dt, dy10.dt))) + } > > #parms<-c(r, b, k) > initials<-c(40, 400, 36, 36, 36, 36, 36, 12, 12, 4) > t.s<- seq(1, 300, by=0.1) > > > out<- ode(y=initials, times=t.s, modul) > #matplot(out[,1], out[,-1], type="l", xlab="Tempo", ylab="N") > > > library(MASS) > library(rootSolve) > library(mAr) > > y<-initials > ST2 <- runsteady(y=y,func=modul,parms=parms,times=c(0,5000)) > ye<-ST2$y > ye # Fixed point [1] 0.1590013091 5.0090621641 0.7430847673 0.7773484198 1.2074297620 [6] 1.2346934021 1.2341296936 8.4034232056 0.0002859149 2.3117477578 > > h=out[,-1] > > > g<-seq(1,2991,10) > > M=h[g,] > > y=mAr.est(M,1,1) > y$SBC [1] -15.60132 > > # matrix of total effects > E=-ginv(y$AHat) > # METP > AS=E > n=1:10 > for (i in n) { + for (j in n) { + if (AS[i,j]<0) {AS[i,j]=0} + + } + } > rownames(AS)=c('N','V','H1','H2','H3','H4','H5','O','P1','P2') > colnames(AS)=rownames(AS) # AS is the matrix of total positive effects > library(igraph) > > teia.adjacency=AS > > teia= graph.adjacency(teia.adjacency) > TR=transitivity(teia, type="weighted") > round(TR,3) [1] 0.333 0.700 0.571 0.476 0.600 0.667 0.900 0.600 0.667 1.000 © L. S. Barreto, 2018. The Analysis of CAS 43 4 Identfcaton of Keystone Species, and Controlling Components in the Ecosystem

Table 4.1. The transitvity values of the components of the data of the simulated ecosystems

y1 y2 y3 y4 y5 y6 y7 y8 y9 y10

0.333 0.700 0.571 0.476 0.600 0.667 0.900 0.600 0.667 1.000

The transitvity of the nodes confrms the top predator (y10) as a keystone species. For easier percepton of the MTPE, we present its chromatc representaton

Figure 4.2. Chromatc matrix that corresponds to the matrix of total efects. Positve efects: green; negatve ef- fects :red. The nutrient y1, and the herbivores y4, y5 are the components that have a positve impact on a larger num- ber of species. The herbivores y3, y6 are the components that have a negatve impact on a larger number of species

Figure 4.2 suggests that the causality in CAS is formed by a web of dynamic interdependencies (Hooker, 2011:885).

4.4 The Identification of Controlling Components in Ecosystems

In this secton, I will use data of the well known research project of Isle Royale (www.isleroyalewolf.org; Nelson, Peterson, and Vucetch, 2008). This project is the longest uninterrupted study of a predator–prey relatonship in the world. The columns of the data, from left to right, are: the number of wolves (W), the number of moose (M), average temperature of January, and February (wtemp), average precipitaton of January, and February (wprecip), and average temperature of July, and September (stemp). To apply the procedure to this data, the following script is used:

> library(MARSS) > library(mAr) > library(igraph) > #Data isleRoyal > royale.dat=(isleRoyal[1:53,c(2,3,4,10,6)]) > > #Obtaining MAR(1) > y=mAr.est(royale.dat,1,1) 44 © L. S. Barreto, 2018. The Analysis of CAS 4 Identfcaton of Keystone Species, and Controlling Components in the Ecosystem

> > #The matrix of coefficients is matrix y$AHat > E=-ginv(y$AHat) # Total effects matrix > > #Obtaining total positive effects matrix > AS=E > n=1:5 > for (i in n) { + for (j in n) { + if (AS[i,j]<0) {AS[i,j]=0} + } + } > rownames(AS)=c('W','M','wtemp ','wprecip','stemp') > colnames(AS)=rownames(AS) > > #Network analysis > net.adjacency=AS > net= graph.adjacency(net.adjacency) > > #Desired transitivity > TR=transitivity(net, type="weighted") > round(TR,3) [1] 0.667 NaN 0.667 1.000 1.000 The transitivity of the nodes

The output of the script is inserted in table 17.2.

Table 4.2. The transitvity values of the components of the data of Isle Royale

W M wtemp wprecip stemp

0.667 NaN 0.667 1.000 1.000

To evaluate the results in table 17.2, I use the appreciaton of the project inserted in Nelson, Peterson, and Vucetch (2008). In page 108 of this paper it is stated the following: - ‘Wolves seemed to have relatvely litle impact on moose ’, and they are the least important factor that afects short-term fuctuatons in moose abundance. - ‘Climatc factors (such as summer heat and winter severity) are much more important’. In table 17.2, only two climatc factors have values of transitvity equal to 1. One parameter is measured in summer (temperature), and the other in winter (precipitaton). Thus, the results in table 17.2 agree with the empirical evidence recorded in Nelson, Peterson, and Vucetch (2008:108).

4.5 Conclusive Remarks

The results obtained support the applicaton of the proposed procedure to identfy keystone species, and controlling components in ecosystems. The discovery of the relaton between autocatalysis and total positve efects is conceptually, and theoretcally relevant. The relevance of the process of autocatalysis for the structure, and dynamics of ecosystems is here corroborated, and reinforced. It is also shown that the aggregaton of several diferent tools, and concepts in new synthesis can give rise to new insights, and operatonal procedures, capable of solving relevant problems. © L. S. Barreto, 2018. The Analysis of CAS 45 4 Identfcaton of Keystone Species, and Controlling Components in the Ecosystem

4.6 References, and Related Bibliography

Barbosa, S. M., 2012. mAr: Multvariate AutoRegressive analysis. R package version 1.1-2. htps://CRAN.R-projec- t.org/package=mAr Barreto, L. S., 2011. From Trees to Forests. A Unified Theory. E-book. Costa de Caparica. Barreto, L. S., 2016. Ecologia Teórica. Uma outra Explanação. III. Comunidade e Ecossistema. E-book. Costa de Ca- parica. Barreto, L. S., in press. A Procedure to Identfy Keystone Species, and Controlling Components in Ecosystem. Sub- mited to Silia Lusitana in April, 2017. Csárdi, G., and T. Nepusz, 2006. The igraph software package for complex network research. InterJournal, Complex Systems, 1695. htp://igraph.org Holmes, E., E. J. Ward, and K. Wills, 2012. MARSS: Multvariate Auto-Regressive State-Space Models for Analizing Time Series. The R Journal, 4(1):11-19. Hooker, C., 2011. Introducton to Philosophy of Complex Systems. In Clif Hooker, Editor, Philosophy of Complex Systems, Elsevier, pages 842-909. Jain, S., and S. Krishna, 2001. Crashes, Recoveries, and ‘Core-Shifts’ in a Model of Evolving Networks. Proceedings of the Natonal Academy of Sciences USA, 98:543-547. Jain, S., and S. Krishna, 2002. Large Extnctons in an Evolutonary Model: The Role of Innovaton and Keystone Species. Proceedings of the Natonal Academy of Sciences USA, 99:2055-2060. Jordán, F., 2009. Keystone species and food webs. Philos Trans R Soc Lond B Biol Sci., 364(1524): 1733–1741. doi: 10.1098/rstb.2008.0335 Jørgensen, S. E., (Main editor), 2009a. Ecosystem Ecology. Elsevier, Amsterdam. Kolaczyk, E. D., and G. Csárdi, 2014. Statstcal Analysis of Network Data with R. Springer, Berlin. Libralato, S., V. Christensenc, and D. Paulyc, 2006. A method for identfying keystone species in food web models. Ecological Modelling, 195:153–171.´ Nelson, M. P., Rolf O. Peterson, and John A. Vucetch, 2008. The Isle Royale Wolf–Moose Project: Fifty Years of Challenge and Insight. The George Wright Forum, 25(2):98-113. Ramsey, D., and C. Veltman, 2005. Predictng the efects of perturbatons on ecological communites: what can qualitatve models oferv. Journal of Animal Ecology, 74: 905–916. doi: 10.1111/j.1365-2656.2005.00986.x Salas, A. K., and S. R. Borret, 2011. Evidence for the of indirect efects in 50 trophic ecosystem networks. Ecological Modelling, 222 (2011): 1192–1204. Scharler, U. M., 2009. Analysis, Ascendency. Em S. E. Jørgensen, Compilador principal, Ecosystem Ecology. Elsevier, Amsterdam. Páginas 57-64. Smith, C. et al, 2014. Report on identficaton of keystone species and processes across regional seas. Deliverable 6.1, DEVOTES Project. 105 pp + 1, Annex. Tanner, J. E., T. P. Hughes, and J. H. Connell, 1994. Species coexistence, keystone species, and succession: a sensitvity analysis. Ecology, 75(8):2204-2219. Ulanowicz, R.E., 1980. An hypothesis on the development of natural communites. J. theor. Biol. , 85: 223–245. Ulanowicz, R.E., 2004. Quanttatve methods for ecological network analysis. Computatonal Biology and Chemistry, 28:321 – 339. Ulanowicz, R.E., 2009. Autocatalysis. Em S. E. Jørgensen, (Main editor), Ecosystem Ecology. Elsevier, Amsterdam. Pagess 41-43. Zhao, L. et al., 2016. Weightng and indirect efects of identfy keystone species in food webs. Ecology Leters, 19:1033-1040. 46 © L. S. Barreto, 2018. The Analysis of CAS 4 Identfcaton of Keystone Species, and Controlling Components in the Ecosystem

Without text © L. S. Barreto, 2018. The Analysis of CAS 47 5 Developmental, Structural, and Functonal Sensitvites to Inital Values

5 Developmental, Structural, and Functional Sensitivities to Initial Values

5.1 Introduction

With the growth, and spread of human populaton, the predicton of the response of populatons, communites, and ecosystems to anthropogenic impacts is an issue that must receive the atenton of ecology researchers. It is our understanding that keystone species, and controlling factors are the extreme case of the sensitvity of the ecosystem to their components. Thus, the transitvity of the biotc, and non living components of the ecosystem (e.g., tables 4.1, and 4.2) are a metric for the developmental, structural, and functonal sensitvites of the ecosystem to the perturbatons of each one of them, per se. This conjecture also originates a tool to distnguish ecosystems that start in diferent points of the basin of atracton of a given fxed point. These ecosystems have diferent community matrices, and thus diferent MTPE, although they have a common fxed point. To accomplish the scope of this chapter we considered three variants of the ecosystem described in the previous chapter. They are: • The ecosystem without competton; • The ecosytem without mutualism; • Only the interacton resource-consumer (trophic web) To each one of these four ecosystems we applied SBCANAL. The results are exhibited in table 5.1

Table 5.1. Weighted values of the transitvity of the networks associated to the MTE of the four mentoned ecosystems. WO = without omissions; WC = without competton; WM = without mutualism; OT = only trophic interacton

1 2 3 4 5 6 7 8 9 10 WO 0,333 0,700 0,571 0,476 0,600 0,667 0,900 0,600 0,667 1,000 WC 0,444 0,467 0,600 0,600 0,600 0,600 0,667 1,000 0,833 1,000 WM 0.333 0.300 0.400 0.667 0.500 0.500 0.667 1.000 NaN 0.667 OT 0.476 0.600 0.476 0.800 0.800 0.524 0.667 0.800 0.667 0.833

The concepts in the ttle of this chapter have the meaning conferred to them in context of the analysis of ascendency. Thus, before we proceed we clarify this concept, and the associated network analysis.

5.2 Ascendency

The concepts, and indices presented in this secton were developed with the purpose of analyse networks including a sole interacton: the food web. If the reader is familiar with the model for proposed by Odum (Odum, and Barret, 2005:Table 8-1), consistent with the model of facilitaton, knows that in this concept the succession reveals directonality, this is, the development of the succession is characterized by the emergence of a predictable sequence of communites that evince a set of 48 © L. S. Barreto, 2018. The Analysis of CAS 5 Developmental, Structural, and Functonal Sensitvites to Inital Values atributes that have a fxed patern of change. Some of them are characterized in fgure 5.1. In the axis of tme occurs the sequence of communites.

+

Figure 5.1. Patern of the evoluton of some atributes of the communites, along the succession. The stages of the succession move along the axis of tme. To obtain these graphics in R, I adopted the scripts in Basic, displayed in Odum, and Odum (2000:257)

It is our understending that according to the concept of ecosystem development proposed by Jørgensen (2009a), and Jørgensen et al, (2007), this development has also directonality. In this concepton of ecosystem, directonality is a basic property of ecosystems. Ecosystems reveal also openness, hierarchy, connectvity among their components, and complex dynamics. From these propertes it is possible to obtain 10 atributes candidates to ecological laws (Jørgensen, 2009b:5, Table 1). Directonality implies self-organizaton, and self-regulaton, this is, due only to internal processes of the system, emerge self-sustained order, and structure. In fgure 5.2 we represent a system of four components, limited by a fronter. This is, there is the internal space of the system, and the external space where the system exists. The components interact through a loop of positve efects. The network of fgure 5.2 is also called a autocatalytc cycle (ACC), positve feedback loop, loop of positve directed interacton. The mutualistc interacton between two species is a simple ACC. We can say that autocatalyse is a generalized form of mutualism. © L. S. Barreto, 2018. The Analysis of CAS 49 5 Developmental, Structural, and Functonal Sensitvites to Inital Values

Figure 5.2. Autocatalyse (black arrows), and centripetality (green arrows crossing the system fronter, atracted by its components), in a system with four compartments. Red arrows represent dissipaton of non usable materials or/and energy

The ACC gives origin to a spiral of growing benefts to the components of the cycle. It is the autocatalyse that provokes the emergence of directonality, and centripetality (atracton to the centre) in the ecosystem. Centripetality is the capacity of the system to atract resources, and free energy from the surroundings to its internal space, after they had crossed the system’s fronter. In fgure 1.1 we atempted to present a graphical syntheses of the causal chain triggered by autocatalyse. Autocatalyse promotes the increment of the organizaton of the ecosystem. The degree of organizaton is measured by ascendency, to be detailed later. The archetype of the system studied by the analysis of ascendency is illustrated in fgure 5.3. A reifcaton of this archetype is exhibited in fgure 5.6.

Figure 5.3. Ecosystem formed by four compartments that can be biotc or non living. The other compartments can be, or not, related to the outer space as compartment 1 50 © L. S. Barreto, 2018. The Analysis of CAS 5 Developmental, Structural, and Functonal Sensitvites to Inital Values

This analysis is based in the fows between the compartments or nodes of the network. The following notaton is used:

Flow from node i to j: Tij T ij

n Flow received by node j from all other nodes i: ∑ T ij=T. j T .j i=1

n Flow sent by node i to all other nodes j: ∑ T ij=Ti . T i. j=1 n n Sum of all fows: ∑∑ T ij=∑ T ij=T .. T .. i=1 j=1 i , j

The remaining text of this secton take advantage of Scharler (2009), and Ulanowicz (2004). Below, we introduce the mathematcal expressions of the eight indices that we will use. To analyse the ascendency of an ecosystem, we use a set of indices whose aim is a global evaluaton of the development of the ecosystem, atained by its autocatalysis. It is underpinned by the theory of informaton, and the concept of conditonal probability. Briefy, we will introduce the formulas of some indices calculated by functon enaAseendene , of package enaR (Lau, Borret, Hines, and Sing, 2017; Lau, Sing, and Borret, 2017), and their ecological interpretatons. For more informaton on this issue, see Jørgensen et al, (2007:chapter 4), Scharler (2009), Ulanowicz (2004), and references herewith. Let us recall the Shannon-Wiener index of diversity:

When MacArthur (1955) was seeking for a relaton between the diversity, and stability of a community, replaced pi by the rato Tij/T.., and after multplied the obtained value by constant k, obtaining a measure of the diversity of the fows in the net work:

(5.1)

The rato Tij/T.. is the probability that a randomly selected quantum of medium is in transit between compartments i and j. H estmates the incerttude associated to the predicton of to which Tij belongs a randomly sampled quantum, from the network. After, Rutledge et al. (1976) included in equaton (5.1) the conditonal probability of a quantum that had originated from component i will fow to compartment j (Tij/T.j). This alteraton let them show that equaton (5.1) can be decomposed as:

H = AMI + Hc (5.2)

Both components are non-negatve. © L. S. Barreto, 2018. The Analysis of CAS 51 5 Developmental, Structural, and Functonal Sensitvites to Inital Values

AMI is the aierage mutual informaton characteristc of the network, and it measures the level of organizaton of the way the fow occurs in the network. It is linked to the concept of structure, is an indicator of the developmental status of an ecosystem, and its formula is:

(5.3)

Hc measures the residual (conditonal) diversity/freedom (known as the conditonal entropy in informaton theory). It is writen as:

(5.4)

Later, Ulanowicz (1980) made k=T.., in equaton (5.3), and obtained what he named ascendency (A):

(5.5)

Ascendency is a measure of the size and organizaton of fows, and can be interpreted as the tghtness of the constraints that channel trophic linkages. A food web with more trophic specialists, increased cycling, and higher efciency is characterized by higher values of ascendency. Conversely, lower values for ascendency are associated to a more generalist-based food web, decreased cycling, and lower transfer efciencies. The upper bound, to ascendency is the developmental capacity. Ascendency associates to the total actvity of the system (T..) its level of organizaton, and measures its development. Theoretcally, A increases with the channelling the material fowing into a smaller number of paths, with an increasing fow per link. This situaton assumes an evoluton in the directon of specializaton. This statements brings to light the connectvity of the network, and its density. This issue will be approached ahead. Before we pursue, let us introduce three simple networks that makes more clear the informaton given by AMI, and A. We start with a network with four compartments, linked by all possible fows. All fows are equal to 3, as exhibited in fgure 5.4. 52 © L. S. Barreto, 2018. The Analysis of CAS 5 Developmental, Structural, and Functonal Sensitvites to Inital Values

Figure 5.4. Directed network with four nodes, with the maximum number of links, and all fows equal to 3

Now, we construct a functon that calculates AMI, and A, assuming k=1:

ami=function(x){ + m =x + n = ncol(m) + ami = mat.or.vec(n, n) + T = sum(m) + for (i in 1:n) { + for (j in 1:n) { + if (m[i, j] == 0) { + ami[i, j] = 0 + } + else { + ami[i, j] = m[i, j]/T * log2((m[i, + j] * T)/(sum(m[, j]) * sum(m[i, + ]))) + } + } + } + print('AMI') + print(sum(ami)) + print('ASC') + print(T*sum(ami)) + } The matrix of the network in fgure 16.13 is:

x=matrix(rep(3,16), nrow=4,ncol=4)

We apply the functon to this matrix:

> ami (x) [1] "AMI" © L. S. Barreto, 2018. The Analysis of CAS 53 5 Developmental, Structural, and Functonal Sensitvites to Inital Values

[1] 0 [1] "ASC" [1] 0

This network is undiferentated because all nodes are equally characterized. Thus the values of A, and AMI are zero. Now, we maintain the total fow equal to 48 48 (3 x 16 = 48), and we reduce the links to half of the maximum possible number (8), all with the same fow 6, as illustrated in fgure 5.5.

Figure 5.5. Directed network with four nodes, with half of the maximum number of links, and all fows equal to 6. The total fows remains 48

The matrix of this second network is:

> x=matrix(c(0,0,6,6,6,0,0,6, + 6,6,0,0,0,6,6,0), nrow=4,ncol=4, byrow=T)

Applying the functon we obtain:

> ami (x) [1] "AMI" [1] 1 [1] "ASC" [1] 48

Again, we reduce the number of paths of the second network by half, and we duplicate the fow that circulates in each one (fgure 5.6). The total fow remains 48. The correspondent matrix is:

> x=matrix(c(0,0,0,12,12,0,0,0, + 0,12,0,0,0,0,12,0), nrow=4,ncol=4, byrow=T) > 54 © L. S. Barreto, 2018. The Analysis of CAS 5 Developmental, Structural, and Functonal Sensitvites to Inital Values

Figure 5.6. Directed network with four nodes, with one fourth of the maximum number of links, and all fows equal to 12. The total fows remains 48

For this third network we obtain:

> ami (x) [1] "AMI" [1] 2 [1] "ASC" [1] 96

From fgures 5.3 to 5.5, actng constrictons give origin to a process of increasing diferentaton, and specializaton in the way the fow of materials is processed in the network. Favoured by autocatalysis, these changes increase the degree of self-organizaton, and efciency. The evoluton in specializaton, and organizaton is mirrored by the values of AMI (012), and ascendency (04896).

Hc can be multplied by T.. to obtain the oierhead Φ of the system:

(5.6)

H (equaton (16.1)) can be multplied by T.. to obtain the deielopment capacity, C:

(5.7)

Now, we are able to obtain from equaton (16.2) the following one:

(5.8)

This equaton shows that in a given ecosystem, if its development capacity is constant, its development (increasing of A) sacrifces the overhead. A high level of ascendency is associated © L. S. Barreto, 2018. The Analysis of CAS 55 5 Developmental, Structural, and Functonal Sensitvites to Inital Values with high perfecton, but low fexibility to cope with unexpected perturbatons. The development of the ecosystem is a balanced compromise between A, and Φ. Presumably, mature ecosystems in very stable environments must have smaller values of overhead then ecosystems in more unstable environments. For our purposes, from functon enaAseendene we obtain AMI, A (ASC), Φ (OH), C (CAP), the ratos A/C (ASC.CAP), Φ/C (OH.CAP), robustness R,and efectie linkage density ELD. Let us clarify the two last indices. Robustness R estmate the capacity of the system to resist to perturbatons, and disruptve impacts. Is writen as:

R = -1 * A/C * log(A/C) (5.9)

Efectie linkage density is calculated as a weighted geometric mean. It measures the degree of connectvity of a network. Its expression is:

(5.10)

Now, we use functon enaAseendene , of package enaR (Lau, Borret, Hines, and Sing, 2017; Lau, Sing, and Borret, 2017), and their ecological interpretatons. For more informaton on this issue, see Jørgensen et al, (2007:chapter 4), Scharler (2009), Ulanowicz (2004), Barreto (2017:secton 16.5) and references herewith. The applicaton of functon enaAseendene to the ecosystem Cone Springs (fgure 5.7) is as follows:

> library(enaR) Warning message: package ‘enaR’ was built under R version 3.4.0 > data(troModels) > m.list=troModels > > unpack(m.list[[6]])#description of the ecosystem $F PLANTS BACTERIA FEEDERS DETRITUS PLANTS 0 0 0 0 8881 BACTERIA 0 0 75 0 1600 DETRITUS FEEDERS 0 0 0 370 200 CARNIVORES 0 0 0 0 167 DETRITUS 0 5205 2309 0 0

$z [1] 11184 0 0 0 635

$r [1] 2003 3275 1814 203 3109

$e [1] 300 255 0 0 860

$y [1] 2303 3530 1814 203 3969

$X 56 © L. S. Barreto, 2018. The Analysis of CAS 5 Developmental, Structural, and Functonal Sensitvites to Inital Values

[1] 285.0 117.0 60.0 17.0 3579.4

$living [1] TRUE TRUE TRUE TRUE FALSE

> enaAscendency(m.list[[6]]) H AMI Hr CAP ASC OH ASC.CAP OH.CAP [1,] 3.20096 1.336447 1.864513 135864.7 56725.49 79139.25 0.4175144 0.5824856 robustness ELD TD A.input A.internal A.export A.respiration [1,] 0.3646722 1.908258 2.525286 19147.85 29331.98 1051.765 7193.894 OH.input OH.internal OH.export OH.respiration CAP.input CAP.internal [1,] 6221.751 29832.46 7810.812 35274.22 25369.6 59164.44 CAP.export CAP.respiration [1,] 8862.578 42468.11 >

/

Figure 5.7. Network of the Cone Springs ecosystem. Dissipaton losses are represented by the red colour

Let us assume a network where what circulates it is not energy or biomass (as in the food web) but informaton in the form of total efects. This assumpton let us, in an innovatve manner, extend the analysis of ascendency (the eight described indices) to the study of the ecosystem in its entre wholeness. This is accomplished applying it to the matrix of total positve efects of each system created in secton 5.1.

Table 5.2. The analysis of ascendency of the MTPE of the four mentoned ecosystems

All Without Without Onl the oood web interaetions eompetition mutualism AMI 0.9630886 0.9617592 0.5675819 0.6404051 ASC 1608.594 2044.6 1074.629 1660.262 OH 4371.033 6046.707 3917.225 6041.902 CAP 5979.627 8091.307 4991.854 7702.164 ASC.CAP 0.2690125 0.252691 0.2152766 0.2155579 OH.CAP 0.7309875 0.747309 0.7847234 0.7844421 robustness 0.3532127 0.3475987 0.3306286 0.3307791 ELD 2.476839 2.679854 2.048363 2.242732

In this table (5.2), as expected, it is shown that mutualism gives a high support to AMI. © L. S. Barreto, 2018. The Analysis of CAS 57 5 Developmental, Structural, and Functonal Sensitvites to Inital Values

5.3 Analysis

We will analyse the sensitvity of inital values that difer only in the value of one variable, and after we compare them to the values in table 5.2, frst column. The variables chosen are y1

(transitvity=0.333), y4 (0.476), y7 (0.900). Their inital values will be decreased by 1/3. Thus, y1 is reduced to 26.66667, and the other two variables to 24 (see the script in chapter 4). The ascendency analysis of the MTPE of the four trajectories of the system are inserted in table 5.3. The corresponding relatve variatons, RV ((parameter of the simulaton with reduced variable-parameter of the simulaton of the variant WO)/(parameter of the simulaton of the variant WO)) are exhibited in table 5.4. The script in chapter 4 can be used to control our results.

Table 5.3. Ascendency analysis of the MTPE of the four trajectories of the ecosystem described in the text

WO Reduced y1 Reduced y4 Reduced y7 AMI 0.9630886 0.9411782 0.9134651 0.9228698 CAP 1608.5940000 4496.6240000 7687.9330000 8801.5120000 ASC 4371.0330000 1190.4330000 1933.8040000 2220.4040000 OH 5979.6270000 3306.1910000 5754.1300000 6581.1080000 ASC.CAP 0.2690125 0.2647393 0.2515375 0.2522753 OH.CAP 0.7309875 0.7352607 0.7484625 0.7477247 Robustness 0.3532127 0.3518411 0.3471628 0.3474422 ELD 2.4768390 2.4742090 2.5651280 2.5805130

Table 5.4. The relatve variatons of the atributes of the ascendency analysis of the MTPE of the three new trajectories of the ecosystem, described in the text

RV(y1) RV(y4) RV(y7) AMI -0.022750139 -0.05152537 -0.04176023 CAP -0.248009282 0.28568772 0.47191656 ASC -0.259954345 0.20217034 0.38033836 OH -0.243613352 0.31642337 0.50561847 ASC.CAP -0.015884764 -0.06495981 -0.06221718 OH.CAP 0.005845791 0.02390602 0.02289670 Robusthess -0.003883213 -0.01712821 -0.01712821 ELD -0.001061837 0.03564584 0.03564584

These two tables exhibit results that can be comment as follows: ● The ascendency analysis of the MTPE of diferent trajectories in the basin of atracton of the same fxed point give diferent results for each one. This type of analysis is sensitvity to the origin of the trajectory; ● The reducton of the inital value of the nutrient causes the reducton of all eight atributes; 58 © L. S. Barreto, 2018. The Analysis of CAS 5 Developmental, Structural, and Functonal Sensitvites to Inital Values

● The ranking of the sensitvity of the atributes AMI, CAP, ASC, OH, robustness, and ELD refect the ranking of the transitvity of the variables in table 5.1. ● This chapter, and the previous one form a coherent conceptual wholeness that can be visualised in fgure 5.1.

Figure 5.1. Diagrammatc representaton of the integrated concepts of chapters 17, and 18

5.4 Conclusion

Given the previous analysis, our conclusion is:

The simulatons executed, and the associated analysis do not invalidate our hypothesis: it is highly probable that in the networks associated to the matrix of total positve efects (MTPE), the ranking of the clustering coefcients of the nodes mirror the ranking of the developmental, structural, and functonal sensitvites of the ecosystem to changes of the associated variables.

5.5 References, and Related Bibliograph

Barreto, L. S., 2011. Modelling and Simulatng Omnivory. Silia lusitana, 19(1):47-58. htp:www.inrb.pt/inia/silva-lusitana Barreto, L. S., 2017. Theoretcal Ecology. A Unified Approach . Second editon . E-book , Costa de Caparica. htp:// hdl.handle.net/10400.5/14 1 75 Borret, S. R. e M. K. Lau, 2017. Vignete: enaR. htp://CRAN.R-project.org/package=enaR Canham, C.D., J.J. Cole, and W.K. Lauenroth, Compiladores, 2003. Models in Ecosystem Science. Princeton Univer- sity Press, Princeton, NJ. Chapin III, F. S., P. A. Matson, and H. A. Mooney, 2002. Principles of Terrestrial Ecosystem Ecology. Springer, New York. Csárdi, G., and T. Nepusz, 2006. The igraph software package for complex network research. InterJournal, Com- plex Systems, 1695. htp://igraph.org Fath, B. D., 2012. Overview of Network Environ Analysis: A systems analysis technique for understanding complex ecological systems. Biologi Italiani, Marzo 2012:20-27. Fath, B.D., and B. C. Paten, 1999. Review of the foundatons of network environ analysis. Ecosystems, 2:167–179. Fath, B. D, U. M. Scharler, R,t E. Ulanowicz, and B. Hannon, 2007. Ecological network analysis: network constructon. Ecological Modelling, 208:49–55. Fontaine, C., et al., 2011. The ecological and evolutonary implicatons of merging diferent types of networks. Ecology Leters, 14: 1170–1181. doi: 10.1111/j.1461-0248.2011.01688.x Hampton, S. E. et all, 2013. Quantfying efects of abiotc and biotc drivers on community dynamics with mult- variate autoregressive (MAR) models. Ecology, 94(12): 2663–2669. © L. S. Barreto, 2018. The Analysis of CAS 59 5 Developmental, Structural, and Functonal Sensitvites to Inital Values

Holmes, E. E., E. J. Ward e K. Wills, 2012. MARSS: Multvariate Autoregressive State-space Models for Analyzing Time-series Data. The R Journal, 4(1):11-19. Holmes, E., E. Ward, and K. Wills, 2013. MARSS: Multiariate Autoregressiie State-Space Modeling. R package version 3.9. Ings, T. C. et al., 2009. Ecological networks – beyond food webs. J. Anim. Ecol., 78: 253–269. Jain, S. e S. Krishna, 2001. Crashes, Recoveries, and ‘Core-Shifts’ in a Model of Evolving Networks. Proceedings of the Natonal Academy of Sciences USA, 98:543-547. Jain, S., and S. Krishna, 2002. Large Extnctons in an Evolutonary Model: The Role of Innovaton and Keystone Species. Proceedings of the Natonal Academy of Sciences USA, 99:2055-2060. Jørgensen, S. E., 2009, (Main editor). Ecosystem Ecology. Elsevier B.V. Jørgensen, S. E. et al., 2007, (Editors). A New Ecology. Systems Perpectie. Elsevier B.V. Kolaczyk, E. D., and G. Csárdi, 2014. Statstcal Analysis of Network Data with R. Springer, Berlin. Lau, M.K., S.R. Borret, D.E. Hines, and P. Sing, 2017. enaR: Tools for ecological network analysis (ena) in R. R package version 2.10.0. htp://CRAN.R-project.org/package=enaR Lau, M. K., P. Sing, and S.R. Borret, 2017. Vignete: enaR. htp://CRAN.R-project.org/package=enaR Scharler, U. M., 2009. Ecological Network Analysis, Ascendency. In S. E. Jørgensen, Main editor, Ecosystem Ecology. Elsevier, Amsterdam. Páginas 57-64. Scheef L., 2013. MAR1: Multiariate Autoregressiie Modeling for Analysis of Community Time-Series Data. R pack- age version 1.0. Ulanowicz, R.E., 1980. An hypothesis on the development of natural communites. J. theor. Biol. , 85: 223–245. Ulanowicz, R. E., 1986. Growth and Deielopment: Ecosystems Phenomenology. Springer–Verlag, New York. Ulanowicz, R. E., 1997. Ecology, the Ascendent Perspectie. Columbia University Press, New York. Ulanowicz, R. E. 2004. Quanttatve methods for ecological network analysis. Comput. Biol. Chem., 28:321–339. URL htp://dx.doi.org/10.1016/j.compbiolchem.2004.09.001. Ulanowicz, R.E., 2009. Autocatalysis. Em S. E. Jørgensen, (Main editor), Ecosystem Ecology. Elsevier, Amsterdam. Pagess 41-43. Ulanowicz, R. E. 2011. Quanttatve Methods for Ecological Network Analysis and Its Applicaton to Coastal Ecosystems. Treatse on Estuarine and Coastal Science, 2011, Vol.9, 35-57, DOI: 10.1016/B978-0-12-374711-2.00904- 9 . Weathers, K. C., D. L. Strayer, and G. E. Likens, 2013. Fundamentals of Ecosystem Science. Academic Press/Elsevier, Waltham, MA , USA. 60 © L. S. Barreto, 2018. The Analysis of CAS 5 Developmental, Structural, and Functonal Sensitvites to Inital Values

Without text © L. S. Barreto, 2018. The Analysis of CAS 61 6 Klein’s Data of the US Economy

6 Klein’s Data of the US Economy

6.1 Introduetion Let me clarify an issue: I am not an economist, and this intrusion in this area of knowledge is only to show that SBCANAL is applicable to other CAS then the ecological ones. Professor Lawrence R. Klein was a distnguished America economist that was actve in aca- demia, government, and private research insttutes through the world. His studies in economet- rics brought him a world wide recogniton. Professor Klein was awarded the Nobel Memorial Prize in Economic Sciences, in 1980. In 1950, he published a book (Klein,1950) where he used the data we will use here. The data is obtained from R package sem (Fox, Nie and Byrnes, 2017). Klein’s data covers years 1921–1941, has 22 rows, and 10 columns. The columns are:

Year 1921–1941 C consumpton. P private profts. Wp private wages. I investment. K.lag capital stock, lagged one year. X equilibrium demand. Wg government wages. G government non-wage spending. T indirect business taxes and net exports.

6.1 Application of SBCANAL

VAR models have already large applicaton in econometrics (e.g., Green, 2003: chapter 19). The following R script applies method SBCANAL to Klein’s data:

> #Klein_mAr > > library(sem) > library(mAr) > library(igraph) > > #data from library sem. sem > klein.dat=(Klein[,-1]) > ttt=as.matrix(c(20:41),nrow=21,ncol=1) > matplot(ttt,klein.dat, + ylab="Variables",xlab="Year",type="l", + lwd=3,bty="L") > > y=mAr.est(klein.dat,1,1) > > > y$SBC [1] -6.138954 > E=-ginv(y$AHat) # Total effects matrix > windows() # Figure 6.2 > Variables=1:1:9 62 © L. S. Barreto, 2018. The Analysis of CAS 6 Klein’s Data of the US Economy

> > > split.screen(c(2,2)) [1] 1 2 3 4 > screen(1) > matplot(Variables,E[,3],type='l',lw=2, + xlab='Variables') > title('Total effects of private wages') > > screen(2) > matplot(Variables,E[,4],type='l',lw=2,xlab='Variables' ) > title('Total effects of investments') > > > screen(3) > matplot(Variables,E[,5],type='l',lw=2, xlab='Variables') > title('Total effects of capital stock') > > > screen(4) > matplot(Variables,E[,7],type='l',lw=2, xlab='Variables') > title('Total effects of government wages') > > > #------> #Matrix of total positive effects > AS=E > n=1:9 > for (i in n) { + for (j in n) { + if (AS[i,j]<0) {AS[i,j]=0} + + } + } > > > teia.adjacency=AS > > teia= graph.adjacency(teia.adjacency) > TR=transitivity(teia, type="weighted") > > print('Community matrix') [1] "Community matrix" > round(y$AHat,3) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.189 1.364 0.076 -1.027 -0.153 0.150 1.038 -0.166 0.703 [2,] 0.212 1.540 0.062 -1.842 -0.332 0.162 -1.286 -0.739 0.924 [3,] 0.060 1.518 -0.218 -0.376 -0.063 0.053 1.282 0.860 0.598 [4,] 0.018 1.459 -0.311 -0.738 -0.171 0.012 -0.282 0.029 0.477 [5,] -0.003 0.002 0.002 0.997 1.000 0.001 0.000 -0.003 0.002 [6,] 0.067 2.673 -0.454 -0.583 -0.245 0.065 2.187 2.062 0.851 [7,] 0.016 -0.143 0.072 -0.005 -0.015 0.013 0.893 0.116 -0.098 [8,] -0.140 -0.151 -0.219 1.182 0.079 -0.097 1.431 2.199 -0.330 [9,] -0.205 -0.385 -0.298 1.635 0.149 -0.150 2.191 1.941 -0.671 > > print('Total effects matrix') [1] "Total effects matrix" > round(E,3) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -2.394 -1.381 2.968 1.364 -0.216 -0.569 2.909 0.461 -2.155 © L. S. Barreto, 2018. The Analysis of CAS 63 6 Klein’s Data of the US Economy

[2,] -2.306 -1.392 3.542 0.358 -0.332 -0.795 3.033 1.153 -2.946 [3,] -4.870 -2.875 6.035 2.935 -0.432 -1.130 5.787 0.805 -4.290 [4,] -2.496 0.605 0.807 1.411 0.321 -0.165 5.857 0.919 -1.577 [5,] 2.496 -0.606 -0.803 -1.412 -1.321 0.164 -5.855 -0.919 1.574 [6,] -1.958 -1.128 2.424 1.118 -0.176 -0.465 2.387 0.374 -1.761 [7,] 0.235 0.502 -0.783 -0.163 0.076 0.132 -1.032 0.060 0.413 [8,] 0.595 -0.674 0.206 0.089 -0.139 -0.138 -1.079 -0.822 0.329 [9,] 1.714 3.380 -6.729 0.775 0.822 1.200 0.743 -1.290 4.549 > > print('Positive total effects matrix') [1] "Positive total effects matrix" > round(AS,3) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.000 0.000 2.968 1.364 0.000 0.000 2.909 0.461 0.000 [2,] 0.000 0.000 3.542 0.358 0.000 0.000 3.033 1.153 0.000 [3,] 0.000 0.000 6.035 2.935 0.000 0.000 5.787 0.805 0.000 [4,] 0.000 0.605 0.807 1.411 0.321 0.000 5.857 0.919 0.000 [5,] 2.496 0.000 0.000 0.000 0.000 0.164 0.000 0.000 1.574 [6,] 0.000 0.000 2.424 1.118 0.000 0.000 2.387 0.374 0.000 [7,] 0.235 0.502 0.000 0.000 0.076 0.132 0.000 0.060 0.413 [8,] 0.595 0.000 0.206 0.089 0.000 0.000 0.000 0.000 0.329 [9,] 1.714 3.380 0.000 0.775 0.822 1.200 0.743 0.000 4.549 > print('Transitivity') [1] "Transitivity" > round(TR,3) [1] 0.400 0.167 0.600 0.833 1.000 0.500 0.600 NaN 0.167 > > ##------> > m=E > #z= > z=t(m) > z=rbind(m[9,],m[8,],m[7,],m[6,],m[5,],m[4,],m[3,],m[2,],m[1,]) > z=t(t(t(z))) > > > # Figure 6.1 > windows() > x=1 > y=1 > plot(x,y, pch=1, ylim=c(0,11),xlim=c(0,11), col='white') > for (x in 1:9) { + for (y in 1:9) { + if (z[x,y]<0) { + points(x, y, pch=15, col='red', cex=5)} + + if (z[x,y]>0) { + points(x, y, pch=15, col='green3',cex=5)} + + } + } > title('Chromatic total effects matrix') > > > > > AS2=AS > n=1:9 > for (i in n) { + for (j in n) { 64 © L. S. Barreto, 2018. The Analysis of CAS 6 Klein’s Data of the US Economy

+ if (AS2[i,j]>0) {AS2[i,j]=1} + + } + } > > teia2.adjacency=t(AS2) > > teia2= graph.adjacency(teia2.adjacency) > > #Figure 6.3 > windows() > plot(teia2) > title('Positive total effects network') > V(teia2)$color<-c('sienna2','green','greenyellow', + 'yellowgreen','orange1','lightblue','red','snow3', 'violet') > V(teia2)$name <- c('C', 'P', 'Wp', 'I', 'Klag', 'X','Wg', 'G', 'T') > #------> > #Figure 6.4 > windows() > wc <- walktrap.community(teia2) > wc IGRAPH clustering walktrap, groups: 2, mod: 0.11 + groups: $`1` [1] "C" "Klag" "X" "Wg" "T"

$`2` [1] "P" "Wp" "I" "G"

> plot(wc, teia2) > #______

Now, we introduce four graphics that can facilitate the percepton, and characterizaton of the web of total efects, in the US economy from 1921 to 1941.

Figura 6.1. Chromatc matrix of total efects © L. S. Barreto, 2018. The Analysis of CAS 65 6 Klein’s Data of the US Economy

Figura 6.2. Positve efects of the variables with greater transitvity

Figure 6.3. Network of the matrix of total positve efects 66 © L. S. Barreto, 2018. The Analysis of CAS 6 Klein’s Data of the US Economy

Figure 6.4. Network of the matrix of total positve efects with communites of nodes defned

6.2 Interpretation

Let us present the transitvity values of the variables in table 6.1.

Table 6.1. The transitvity values of the economic variables

C P Wp I K.lag X Wg G T

0.400 0.167 600 0.833 1.000 0.500 0.600 0.600 0.167

Figure 6.4 shows that Wp, G, I, and P form a cohesive subgroup named A, and the other fve variables another community, named B. The nodes of each subgroup are more intensely connected among them, then with nodes outside the group. This is, for instance, a perturbaton of the government spending may have a greater impact on private wages, investment, and private profts, then on the other fve variables. The interpretaton of the transitvity of capital stock (K.lag) equal to 1 can be synthesised in a short statement: no capital, no capitalism. Also the emergence of the investment with the second higher value is coherent with the structure and operaton of market economies. These two results are undoubtedly correct. As I already said, I am not an economist, and Klein’s data include the years of the Great Depression that occurred in the United States. The Great Depression began in August 1929, and lasted for a decade. Probably, in the period of tme covered by the tme series, the depression rendered the performance of the economy partcularly sensitve to wages (Wp, Wg), and government spending (G). These three variables show transitvity equal to 0.600, the highest value after the fgures for capital, and investment. The shortage of money supply in the economy, and the New Deal may be an explanaton, at least partal, for the structure of community A. © L. S. Barreto, 2018. The Analysis of CAS 67 6 Klein’s Data of the US Economy

The interpretatons of the Big Crash, and the Great Depression are stll a mater of controversy. Thus, I do not dare to make more comments in the fgures of table 6.1, and the occurrence of the two communites depicted in fgure 6.4. My conclusion is the following:

We can accept SBCANAL as a valid instrument for the analysis of macroeconomic CAS.

6.3 References Fox, John Zhenghua Nie and Jarret Byrnes, 2017. sem: Structural Equaton Models. R package version 3.1-9. htps://CRAN.R-project.org/package=sem Green, W. H., 2003. Econometric Analysis. Fifth editon. Pearson Educaton, Inc.. Klein, L., 1950. Economic Fluctuatons in the United States 1921–1941. Wiley. 68 © L. S. Barreto, 2018. The Analysis of CAS 6 Klein’s Data of the US Economy

Without text © L. S. Barreto, 2018. The Analysis of CAS 69 7. The Portuguese Market of Electricity

7. The Portuguese Market of Electricity

7.1 Introduction

In the previous chapter we use data from a whole economy of a naton, United States of America. In this chapter, we are confned only to a given market, the market of electricity in the Portuguese economy. This subsystem of the Portuguese economy is the CAS to which we will apply method SBCANAL. Carmona (2006) atempted an explanaton of electricity demand in mainland Portugal, developing econometric models, based on Cobb-Douglas demand functons. For this purpose, he compiled tme-series of several variables with annual periodicity, in the period between 1957 and 2002 (Carmona, 2006:115-116). From the abstract of the thesis, we quote its main conclusions (Carmona, 2006:4): ‘Evidence was found supportng cointegraton at three levels: (i) between total electricity demand and Portuguese GDP; (ii) between residental electricity demand and gross disposable income of families; (iii) between industrial electricity demand and industrial value added. In terms of long-term equilibrium, the remaining variables analyzed were unable to increase explanatory capacity either in the sectoral or global approach.’ The analysis here presented is distnct of the one accomplished by Carmona. This text is note an econometric study. We are looking for the sensitvity of the holistc propertes (in the sense previously clarifed) of the CAS to the perturbatons of its components.

7.2 The Data The fourteen variables we will use are obtained from (Carmona:115-116), and are inserted in table 7.1.

7.3 The Application of Method SBCANAL The applicaton of method SBCANAL to the data obtained from Carmona (2006) was done with the following R script: 70 © L. S. Barreto, 2018. The Analysis of CAS 7. The Portuguese Market of Electricity

Table 7.1. The characterizaton of the data used, and the transitvity (TR) of the nodes of the network of total positve efects

Variable Acronym Units Mean TR

Total consumpton of electricity in mainland Portugal CTC GWh 17674.06 0.667 Consumo Total (de eletricidade) no Contnente Household consumpton of electricity E_Dom GWh 4298.290 0.300 Consumo de eletricidade no sector Doméstco Consumpton of electricity by industry and agriculture E_Ind Gwh 8910.532 1.000 Consumo de eletricidade no sector da Indústria e Agricultura Consumpton of electricity by services E_serv Gwh 4465.245 0.600 Consumo de eletricidade no sector dos seriiços Hot Degree Days HDD 364.785 0.143

Cold Degree Days CDD 577.925 0.300

Real average price of electricity with medium and high-voltage P € 91.535 0.244 Preço real médio da eletricidade em média e alta tensão (1970=100) Real average price of electricity with low-voltage P_bt € 77.060 0.267 Preço real da eletricidade em baixa tensão (1970=100) Gross natonal product PIB 106 € 59039.923 0.267 Produto Interno Bruto Populaton living in Portugal Popul 103 inhab. 9445.955 0.500 População residente em Portugal Relatve price of electricity versus fuel oil PR 61.375 0.167 Preço relatio da eletricidade face ao fuelóleo (1970=100) Gross disposable income by families RDBF 106 € 39480.110 0.500 Rendimento Disponíiel Bruto das Famílias Gross value added by industry VAB_ind 106 € 20892.440 0.300 Valor Acrescentado Bruto pela indústria Gross value added by services VAB_serv 106 € 39772.705 0.500 Valor Acrescentado Bruto pelos seriiços

> library(mAr) > library(igraph) > > #Creating a data frame with Carmona's data > carm1=matrix(as.numeric(c(1963, 3639.8, 22721.9, 9134.0, 122.9, 156.7, 72.7, 283.5, 617.0, + 1964, 4073.6, 24335.2, 9120.7, 118.5, 148.1, 71.7, 445.8, 682.3, + 1965, 4256.3, 26136.0, 9059.7, 113.7, 140.6,73.2,280.7,622.5, + 1966,4720.0, 27129.2, 8984.1, 114.7, 132.8, 75.4, 389.1,543.7, + 1967,4978.8, 29326.6, 8945.6, 108.2, 125.7, 76.5, 285.3, 642.9, + 1968, 5261.0, 31467.5, 8907.6, 106.3, 118.1, 77.3, 326.5, 594.6, + 1969, 5768.5, 32505.9, 8786.2, 102.0, 107.7, 82.3, 370.0, 697.6, + 1970, 6282.0, 35301.4, 8751.4, 100.0, 100.0, 100.0, 391.0, 716.3, + 1971, 6833.9, 37631.4, 8712.1, 95.2, 86.6, 107.4, 295.7, 699.4, + 1972, 7489.7, 40641.8, 8724.5, 88.7, 77.0, 108.0, 201.1, 732.3, + 1973, 8192.4, 45193.7, 8717.4, 80.1, 67.0, 106.7, 310.1, 651.7, © L. S. Barreto, 2018. The Analysis of CAS 71 7. The Portuguese Market of Electricity

+ 1974, 8975.5, 45690.9, 8969.5, 67.7, 53.5, 64.6, 309.8, 665.5, + 1975, 9282.6, 43726.2, 9402.6, 65.0, 45.6, 59.8, 291.1, 677.6, + 1976, 9987.6, 46437.2, 9499.5, 65.2, 46.0, 45.4, 353.1, 668.3, + 1977, 11208.2, 48667.2, 9604.3, 55.4, 44.9, 37.5, 211.7, 530.8, + 1978, 12150.9, 50315.3, 9706.8, 62.1, 47.3, 39.2, 286.3, 569.4, + 1979, 13420.9, 53408.6, 9812.5, 66.4, 45.6, 38.3, 330.1, 647.8, + 1980, 14362.5, 55975.4, 9918.9, 90.4, 59.4, 38.0, 321.2, 611.7, + 1981, 14496.5, 56681.4, 9984.6, 100.0, 63.1, 37.3, 428.8, 490.8, + 1982, 15343.0, 57877.5, 10040.3, 117.1, 73.3, 36.3, 304.9, 523.1, + 1983, 16388.6, 57763.4, 10071.4, 126.0, 77.0, 37.7, 360.0, 578.8, + 1984, 16871.4, 56713.8, 10110.4, 129.9, 75.1, 35.7, 337.6, 635.4, + 1985, 17682.8, 58418.5, 10116.2, 128.0, 74.8, 35.6, 402.3, 625.7, + 1986, 18438.8, 60838.1, 10108.9, 120.1, 76.8, 48.4, 355.7, 706.1, + 1987, 19246.6, 63972.2, 10083.0, 118.9, 77.1, 65.2, 485.6, 510.3, + 1988, 20629.5, 66536.7, 10056.4, 109.2, 76.1, 62.0, 328.5, 528.2, + 1989, 22014.9, 70031.6, 10020.7, 103.9, 73.3, 62.6, 519.2, 435.1, + 1990, 23308.3, 73681.7, 978.0, 99.7, 71.9, 61.4, 478.3, 501.2, + 1991, 24771.6, 75946.0, 9965.3, 101.9, 71.7, 69.2, 522.5, 629.7, + 1992, 25885.6, 77592.8, 9974.6, 102.8, 69.9, 76.5, 343.3, 545.2, + 1993, 26096.1, 76590.3, 9990.6, 96.9, 69.6, 76.7, 341.1, 583.7, + 1994, 27095.6, 78495.0, 10017.6, 87.8, 68.1, 76.3, 330.4, 485.2, + 1995, 28543.6, 80826.7, 10043.2, 78.9, 64.8, 72.5, 518.3, 359.4, + 1996, 30039.5, 83692.1, 10072.5, 71.7, 61.7, 63.0, 406.7, 496.0, + 1997, 31650.0, 87006.3, 10109.7, 67.3, 60.8, 57.7, 450.9, 290.8, + 1998, 33531.6, 90991.7, 10148.9, 63.6, 59.4, 64.1, 379.0, 393.3, + 1999, 35798.7, 94450.1, 10195.0, 55.6, 54.8, 50.2, 399.0, 530.6, + 2000, 37912.5, 97641.6, 10256.7, 52.3, 52.8, 30.2, 432.3, 589.8, + 2001, 39413.5, 99364.7, 10329.3, 53.8, 53.3, 30.6, 427.2, 622.8, + 2002, 40919.7, 99873.3, 10407.5, 53.5, 54.4, 31.8, 357.7, 484.4)), nrow=40,ncol=9, byrow=T) > > colnames(carm1)=c('Ano', 'CTC', 'PIB', 'Popul', 'P', 'P_bt', 'PR', 'HDD', 'CDD') > carm1 Ano CTC PIB Popul P P_bt PR HDD CDD [1,] 1963 3639.8 22721.9 9134.0 122.9 156.7 72.7 283.5 617.0 [2,] 1964 4073.6 24335.2 9120.7 118.5 148.1 71.7 445.8 682.3 [3,] 1965 4256.3 26136.0 9059.7 113.7 140.6 73.2 280.7 622.5 [4,] 1966 4720.0 27129.2 8984.1 114.7 132.8 75.4 389.1 543.7 [5,] 1967 4978.8 29326.6 8945.6 108.2 125.7 76.5 285.3 642.9 [6,] 1968 5261.0 31467.5 8907.6 106.3 118.1 77.3 326.5 594.6 [7,] 1969 5768.5 32505.9 8786.2 102.0 107.7 82.3 370.0 697.6 [8,] 1970 6282.0 35301.4 8751.4 100.0 100.0 100.0 391.0 716.3 [9,] 1971 6833.9 37631.4 8712.1 95.2 86.6 107.4 295.7 699.4 [10,] 1972 7489.7 40641.8 8724.5 88.7 77.0 108.0 201.1 732.3 [11,] 1973 8192.4 45193.7 8717.4 80.1 67.0 106.7 310.1 651.7 [12,] 1974 8975.5 45690.9 8969.5 67.7 53.5 64.6 309.8 665.5 [13,] 1975 9282.6 43726.2 9402.6 65.0 45.6 59.8 291.1 677.6 [14,] 1976 9987.6 46437.2 9499.5 65.2 46.0 45.4 353.1 668.3 [15,] 1977 11208.2 48667.2 9604.3 55.4 44.9 37.5 211.7 530.8 [16,] 1978 12150.9 50315.3 9706.8 62.1 47.3 39.2 286.3 569.4 [17,] 1979 13420.9 53408.6 9812.5 66.4 45.6 38.3 330.1 647.8 [18,] 1980 14362.5 55975.4 9918.9 90.4 59.4 38.0 321.2 611.7 [19,] 1981 14496.5 56681.4 9984.6 100.0 63.1 37.3 428.8 490.8 [20,] 1982 15343.0 57877.5 10040.3 117.1 73.3 36.3 304.9 523.1 [21,] 1983 16388.6 57763.4 10071.4 126.0 77.0 37.7 360.0 578.8 [22,] 1984 16871.4 56713.8 10110.4 129.9 75.1 35.7 337.6 635.4 [23,] 1985 17682.8 58418.5 10116.2 128.0 74.8 35.6 402.3 625.7 [24,] 1986 18438.8 60838.1 10108.9 120.1 76.8 48.4 355.7 706.1 [25,] 1987 19246.6 63972.2 10083.0 118.9 77.1 65.2 485.6 510.3 72 © L. S. Barreto, 2018. The Analysis of CAS 7. The Portuguese Market of Electricity

[26,] 1988 20629.5 66536.7 10056.4 109.2 76.1 62.0 328.5 528.2 [27,] 1989 22014.9 70031.6 10020.7 103.9 73.3 62.6 519.2 435.1 [28,] 1990 23308.3 73681.7 978.0 99.7 71.9 61.4 478.3 501.2 [29,] 1991 24771.6 75946.0 9965.3 101.9 71.7 69.2 522.5 629.7 [30,] 1992 25885.6 77592.8 9974.6 102.8 69.9 76.5 343.3 545.2 [31,] 1993 26096.1 76590.3 9990.6 96.9 69.6 76.7 341.1 583.7 [32,] 1994 27095.6 78495.0 10017.6 87.8 68.1 76.3 330.4 485.2 [33,] 1995 28543.6 80826.7 10043.2 78.9 64.8 72.5 518.3 359.4 [34,] 1996 30039.5 83692.1 10072.5 71.7 61.7 63.0 406.7 496.0 [35,] 1997 31650.0 87006.3 10109.7 67.3 60.8 57.7 450.9 290.8 [36,] 1998 33531.6 90991.7 10148.9 63.6 59.4 64.1 379.0 393.3 [37,] 1999 35798.7 94450.1 10195.0 55.6 54.8 50.2 399.0 530.6 [38,] 2000 37912.5 97641.6 10256.7 52.3 52.8 30.2 432.3 589.8 [39,] 2001 39413.5 99364.7 10329.3 53.8 53.3 30.6 427.2 622.8 [40,] 2002 40919.7 99873.3 10407.5 53.5 54.4 31.8 357.7 484.4 > > > carm2=matrix(as.numeric(c(1963, 2463.1, 579.2, 597.5, 9534.5, 14852.8, 14698.1, + 1964, 2775.2, 630.9, 667.5, 9930.6, 15591.3, 15370.6, + 1965, 2835.0, 698.1, 723.3, 11182.9, 16317.3, 16219.9, + 1966, 3221.3, 731.1, 767.7, 11553.7, 17559.6, 17135.1, + 1967, 3359.5, 787.3, 832.0, 11787.3, 19018.1, 18371.8, + 1968, 3512.8, 864.6, 883.6, 12119.4, 20375.7, 19540.2, + 1969, 3846.3, 972.6, 949.6, 12393.6, 21324.2, 20022.3, + 1970, 4025.7, 1062.6, 1193.7, 13740.2, 23282.1, 20727.2, + 1971, 4319.8, 1234.3, 1279.8, 15744.8, 26578.3, 21957.5, + 1972, 4670.6, 1393.1, 1426.1, 17388.4, 29404.3, 23891.3, + 1973, 5123.0, 1517.0, 1552.3, 18167.7, 30305.6, 25414.2, + 1974, 5348.3, 1794.0, 1833.2, 18643.4, 31382.0, 25900.1, + 1975, 5396.2, 1984.4, 1902.1, 16881.2, 32192.2, 25869.8, + 1976, 5733.6, 2281.2, 1972.8, 16605.6, 31907.2, 27167.3, + 1977, 6699.5, 2517.7, 1990.9, 17718.8, 30000.2, 29066.3, + 1978, 7224.4, 2730.8, 2195.7, 18925.3, 32644.7, 32868.3, + 1979, 8055.0, 2952.4, 2413.5, 20331.9, 34871.8, 33244.7, + 1980, 8527.9, 3173.4, 2661.1, 21045.7, 37226.4, 35207.5, + 1981, 8344.3, 3409.0, 2743.3, 21042.7, 39015.2, 36310.5, + 1982, 8763.8, 3617.5, 2961.7, 21232.2, 41600.5, 37341.8, + 1983, 9120.9, 4021.9, 3245.8, 21246.5, 40529.4, 37759.9, + 1984, 9334.8, 3992.1, 3544.5, 20525.5, 38921.7, 36981.0, + 1985, 9680.7, 4203.8, 3798.3, 20895.8, 39958.5, 37947.5, + 1986, 9799.5, 4548.4, 4090.9, 21913.3, 41576.5, 39311.5, + 1987, 9995.0, 4834.3, 4417.3, 22852.1, 43665.6, 41347.4, + 1988, 10634.6, 5178.4, 4816.5, 23933.4, 44714.8, 44916.6, + 1989, 11294.9, 5455.1, 5264.9, 25119.8, 46043.0, 48503.7, + 1990, 11757.3, 5711.5, 5839.5, 25552.9, 49077.8, 51314.9, + 1991, 11601.6, 6367.8, 6802.2, 25480.2, 51513.4, 55098.1, + 1992, 12236.7, 6752.9, 6896.0, 25537.7, 52822.8, 57548.4, + 1993, 11967.7, 6947.4, 7181.0, 24693.4, 52350.1, 57792.1, + 1994, 12581.3, 7090.5, 7423.7, 25156.9, 52958.4, 55375.8, + 1995, 13284.4, 7318.5, 7940.6, 26054.8, 54471.0, 58030.5, + 1996, 13575.4, 7881.3, 8582.8, 27623.3, 54821.6, 58970.8, + 1997, 14373.9, 8124.6, 9151.5, 28847.9, 55654.1, 61825.2, + 1998, 15091.0, 8468.4, 9972.2, 29510.4, 58512.2, 65386.5, + 1999, 15639.6, 9189.9, 10969.2, 30069.9, 60765.9, 68276.1, + 2000, 16439.0, 9699.1, 11774.5, 30709.6, 63804.2, 71203.8, + 2001, 16706.1, 10239.3, 12468.1, 31172.0, 65402.9, 73371.0, + 2002, 17061.6, 10975.2, 12882.9, 32832.3, 66191.0, 73622.9)),nrow=40,ncol=7,byrow=T) > © L. S. Barreto, 2018. The Analysis of CAS 73 7. The Portuguese Market of Electricity

> > colnames(carm2)=c( 'Ano', 'E_Ind', 'E_Dom', 'E_Serv', 'VAB_Ind', 'RDBF', 'VAB_Serv') > carm2=carm2 > carmdat=cbind(carm1,carm2) > carmdat=carmdat[,-10] > carmdat=carmdat[,-1] > > #data frame to be used > carmdat CTC PIB Popul P P_bt PR HDD CDD E_Ind E_Dom [1,] 3639.8 22721.9 9134.0 122.9 156.7 72.7 283.5 617.0 2463.1 579.2 [2,] 4073.6 24335.2 9120.7 118.5 148.1 71.7 445.8 682.3 2775.2 630.9 [3,] 4256.3 26136.0 9059.7 113.7 140.6 73.2 280.7 622.5 2835.0 698.1 [4,] 4720.0 27129.2 8984.1 114.7 132.8 75.4 389.1 543.7 3221.3 731.1 [5,] 4978.8 29326.6 8945.6 108.2 125.7 76.5 285.3 642.9 3359.5 787.3 [6,] 5261.0 31467.5 8907.6 106.3 118.1 77.3 326.5 594.6 3512.8 864.6 [7,] 5768.5 32505.9 8786.2 102.0 107.7 82.3 370.0 697.6 3846.3 972.6 [8,] 6282.0 35301.4 8751.4 100.0 100.0 100.0 391.0 716.3 4025.7 1062.6 [9,] 6833.9 37631.4 8712.1 95.2 86.6 107.4 295.7 699.4 4319.8 1234.3 [10,] 7489.7 40641.8 8724.5 88.7 77.0 108.0 201.1 732.3 4670.6 1393.1 [11,] 8192.4 45193.7 8717.4 80.1 67.0 106.7 310.1 651.7 5123.0 1517.0 [12,] 8975.5 45690.9 8969.5 67.7 53.5 64.6 309.8 665.5 5348.3 1794.0 [13,] 9282.6 43726.2 9402.6 65.0 45.6 59.8 291.1 677.6 5396.2 1984.4 [14,] 9987.6 46437.2 9499.5 65.2 46.0 45.4 353.1 668.3 5733.6 2281.2 [15,] 11208.2 48667.2 9604.3 55.4 44.9 37.5 211.7 530.8 6699.5 2517.7 [16,] 12150.9 50315.3 9706.8 62.1 47.3 39.2 286.3 569.4 7224.4 2730.8 [17,] 13420.9 53408.6 9812.5 66.4 45.6 38.3 330.1 647.8 8055.0 2952.4 [18,] 14362.5 55975.4 9918.9 90.4 59.4 38.0 321.2 611.7 8527.9 3173.4 [19,] 14496.5 56681.4 9984.6 100.0 63.1 37.3 428.8 490.8 8344.3 3409.0 [20,] 15343.0 57877.5 10040.3 117.1 73.3 36.3 304.9 523.1 8763.8 3617.5 [21,] 16388.6 57763.4 10071.4 126.0 77.0 37.7 360.0 578.8 9120.9 4021.9 [22,] 16871.4 56713.8 10110.4 129.9 75.1 35.7 337.6 635.4 9334.8 3992.1 [23,] 17682.8 58418.5 10116.2 128.0 74.8 35.6 402.3 625.7 9680.7 4203.8 [24,] 18438.8 60838.1 10108.9 120.1 76.8 48.4 355.7 706.1 9799.5 4548.4 [25,] 19246.6 63972.2 10083.0 118.9 77.1 65.2 485.6 510.3 9995.0 4834.3 [26,] 20629.5 66536.7 10056.4 109.2 76.1 62.0 328.5 528.2 10634.6 5178.4 [27,] 22014.9 70031.6 10020.7 103.9 73.3 62.6 519.2 435.1 11294.9 5455.1 [28,] 23308.3 73681.7 978.0 99.7 71.9 61.4 478.3 501.2 11757.3 5711.5 [29,] 24771.6 75946.0 9965.3 101.9 71.7 69.2 522.5 629.7 11601.6 6367.8 [30,] 25885.6 77592.8 9974.6 102.8 69.9 76.5 343.3 545.2 12236.7 6752.9 [31,] 26096.1 76590.3 9990.6 96.9 69.6 76.7 341.1 583.7 11967.7 6947.4 [32,] 27095.6 78495.0 10017.6 87.8 68.1 76.3 330.4 485.2 12581.3 7090.5 [33,] 28543.6 80826.7 10043.2 78.9 64.8 72.5 518.3 359.4 13284.4 7318.5 [34,] 30039.5 83692.1 10072.5 71.7 61.7 63.0 406.7 496.0 13575.4 7881.3 [35,] 31650.0 87006.3 10109.7 67.3 60.8 57.7 450.9 290.8 14373.9 8124.6 [36,] 33531.6 90991.7 10148.9 63.6 59.4 64.1 379.0 393.3 15091.0 8468.4 [37,] 35798.7 94450.1 10195.0 55.6 54.8 50.2 399.0 530.6 15639.6 9189.9 [38,] 37912.5 97641.6 10256.7 52.3 52.8 30.2 432.3 589.8 16439.0 9699.1 [39,] 39413.5 99364.7 10329.3 53.8 53.3 30.6 427.2 622.8 16706.1 10239.3 [40,] 40919.7 99873.3 10407.5 53.5 54.4 31.8 357.7 484.4 17061.6 10975.2 E_Serv VAB_Ind RDBF VAB_Serv [1,] 597.5 9534.5 14852.8 14698.1 [2,] 667.5 9930.6 15591.3 15370.6 [3,] 723.3 11182.9 16317.3 16219.9 [4,] 767.7 11553.7 17559.6 17135.1 [5,] 832.0 11787.3 19018.1 18371.8 [6,] 883.6 12119.4 20375.7 19540.2 [7,] 949.6 12393.6 21324.2 20022.3 [8,] 1193.7 13740.2 23282.1 20727.2 74 © L. S. Barreto, 2018. The Analysis of CAS 7. The Portuguese Market of Electricity

[9,] 1279.8 15744.8 26578.3 21957.5 [10,] 1426.1 17388.4 29404.3 23891.3 [11,] 1552.3 18167.7 30305.6 25414.2 [12,] 1833.2 18643.4 31382.0 25900.1 [13,] 1902.1 16881.2 32192.2 25869.8 [14,] 1972.8 16605.6 31907.2 27167.3 [15,] 1990.9 17718.8 30000.2 29066.3 [16,] 2195.7 18925.3 32644.7 32868.3 [17,] 2413.5 20331.9 34871.8 33244.7 [18,] 2661.1 21045.7 37226.4 35207.5 [19,] 2743.3 21042.7 39015.2 36310.5 [20,] 2961.7 21232.2 41600.5 37341.8 [21,] 3245.8 21246.5 40529.4 37759.9 [22,] 3544.5 20525.5 38921.7 36981.0 [23,] 3798.3 20895.8 39958.5 37947.5 [24,] 4090.9 21913.3 41576.5 39311.5 [25,] 4417.3 22852.1 43665.6 41347.4 [26,] 4816.5 23933.4 44714.8 44916.6 [27,] 5264.9 25119.8 46043.0 48503.7 [28,] 5839.5 25552.9 49077.8 51314.9 [29,] 6802.2 25480.2 51513.4 55098.1 [30,] 6896.0 25537.7 52822.8 57548.4 [31,] 7181.0 24693.4 52350.1 57792.1 [32,] 7423.7 25156.9 52958.4 55375.8 [33,] 7940.6 26054.8 54471.0 58030.5 [34,] 8582.8 27623.3 54821.6 58970.8 [35,] 9151.5 28847.9 55654.1 61825.2 [36,] 9972.2 29510.4 58512.2 65386.5 [37,] 10969.2 30069.9 60765.9 68276.1 [38,] 11774.5 30709.6 63804.2 71203.8 [39,] 12468.1 31172.0 65402.9 73371.0 [40,] 12882.9 32832.3 66191.0 73622.9 > > #VAR model > y=mAr.est(carmdat,1,1) > > # Schwartz Bayesian Criterion > y$SBC [1] 8.911428 > E=-ginv(y$AHat) > > > m=E > #z= > z=t(m) >z=rbind(m[13,],m[12,],m[11,],m[10,], m[9,],m[8,],m[7,],m[6,],m[5,],m[4,],m[3,],m[2,],m[1,]) > z=t(t(t(z))) > > # Fugure 7.1 > windows() > x=1 > y=1 > plot(x,y, pch=1, ylim=c(0,11),xlim=c(0,11), col='white') > for (x in 1:13) { + for (y in 1:13) { + if (z[x,y]<0) { + points(x, y, pch=15, col='red', cex=5)} + + if (z[x,y]>0) { © L. S. Barreto, 2018. The Analysis of CAS 75 7. The Portuguese Market of Electricity

+ points(x, y, pch=15, col='green3',cex=5)} + + } + } > title('Chromatic matrix of total effects') > > # > AS=E > n=1:14 > for (i in n) { + for (j in n) { + if (AS[i,j]<0) {AS[i,j]=0} + + } + } > > > teia.adjacency=AS > > teia= graph.adjacency(teia.adjacency) > TR=transitivity(teia, type="weighted") > > print('Community matrix') [1] "Community matrix" > round(y$AHat,3) Error in y$AHat : $ operator is invalid for atomic vectors > > print('Total effects matrix') [1] "Total effects matrix" > round(E,3) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -0.909 0.509 -0.452 60.584 -76.931 -8.565 6.251 -3.943 -1.101 [2,] -0.490 0.886 0.344 14.588 59.813 9.326 -8.949 3.601 -0.146 [3,] -1.358 2.382 -2.230 435.048 -549.262 -68.726 43.790 -11.198 -9.252 [4,] -0.005 0.001 0.011 -2.181 2.135 -0.455 -0.149 0.082 0.006 [5,] -0.005 0.004 0.006 -0.381 -0.046 -0.280 -0.097 0.033 0.001 [6,] -0.006 0.007 0.012 0.318 0.735 -1.139 -0.209 0.076 -0.009 [7,] 0.054 -0.185 0.118 -15.761 9.808 4.168 -0.249 0.009 0.590 [8,] 0.068 0.032 -0.341 13.602 -32.970 -0.260 4.968 -1.696 0.035 [9,] -0.370 0.143 0.183 7.697 2.912 -0.460 -5.132 -2.389 -0.640 [10,] -0.264 0.145 -0.213 15.831 -22.499 -5.248 3.704 0.159 -0.297 [11,] -0.275 0.221 -0.422 37.052 -57.350 -2.852 7.682 -1.713 -0.164 [12,] 0.068 0.660 0.492 -48.580 104.587 19.505 -6.051 9.641 -1.010 [13,] -0.526 0.145 0.166 19.729 8.275 11.341 -3.521 10.485 0.719 [14,] -1.335 2.330 -0.958 308.147 -291.657 -44.053 12.891 -12.596 -5.316 [,10] [,11] [,12] [,13] [,14] [1,] -0.365 1.233 -0.645 -0.370 -0.135 [2,] -0.691 0.013 0.399 -1.396 -0.644 [3,] 5.690 7.050 -1.680 -2.946 0.377 [4,] -0.008 -0.023 0.013 0.002 0.002 [5,] 0.005 -0.012 0.006 -0.002 0.000 [6,] 0.011 -0.011 0.017 -0.013 0.004 [7,] -0.618 -0.032 0.046 0.164 0.025 [8,] -0.141 0.424 -0.477 0.060 -0.074 [9,] -0.299 0.573 0.119 -0.162 0.013 [10,] -0.264 0.491 -0.232 -0.071 -0.059 [11,] 0.199 0.169 -0.532 -0.137 -0.088 [12,] 3.086 -2.825 -0.138 -0.793 -0.183 [13,] -2.151 0.907 1.336 -2.073 0.599 [14,] 0.726 6.076 -0.469 -2.685 -1.003 76 © L. S. Barreto, 2018. The Analysis of CAS 7. The Portuguese Market of Electricity

> > print('Positive total effects matrix') [1] "Positive total effects matrix" > round(AS,3) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 0.000 0.509 0.000 60.584 0.000 0.000 6.251 0.000 0.000 0.000 1.233 [2,] 0.000 0.886 0.344 14.588 59.813 9.326 0.000 3.601 0.000 0.000 0.013 [3,] 0.000 2.382 0.000 435.048 0.000 0.000 43.790 0.000 0.000 5.690 7.050 [4,] 0.000 0.001 0.011 0.000 2.135 0.000 0.000 0.082 0.006 0.000 0.000 [5,] 0.000 0.004 0.006 0.000 0.000 0.000 0.000 0.033 0.001 0.005 0.000 [6,] 0.000 0.007 0.012 0.318 0.735 0.000 0.000 0.076 0.000 0.011 0.000 [7,] 0.054 0.000 0.118 0.000 9.808 4.168 0.000 0.009 0.590 0.000 0.000 [8,] 0.068 0.032 0.000 13.602 0.000 0.000 4.968 0.000 0.035 0.000 0.424 [9,] 0.000 0.143 0.183 7.697 2.912 0.000 0.000 0.000 0.000 0.000 0.573 [10,] 0.000 0.145 0.000 15.831 0.000 0.000 3.704 0.159 0.000 0.000 0.491 [11,] 0.000 0.221 0.000 37.052 0.000 0.000 7.682 0.000 0.000 0.199 0.169 [12,] 0.068 0.660 0.492 0.000 104.587 19.505 0.000 9.641 0.000 3.086 0.000 [13,] 0.000 0.145 0.166 19.729 8.275 11.341 0.000 10.485 0.719 0.000 0.907 [14,] 0.000 2.330 0.000 308.147 0.000 0.000 12.891 0.000 0.000 0.726 6.076 [,12] [,13] [,14] [1,] 0.000 0.000 0.000 [2,] 0.399 0.000 0.000 [3,] 0.000 0.000 0.377 [4,] 0.013 0.002 0.002 [5,] 0.006 0.000 0.000 [6,] 0.017 0.000 0.004 [7,] 0.046 0.164 0.025 [8,] 0.000 0.060 0.000 [9,] 0.119 0.000 0.013 [10,] 0.000 0.000 0.000 [11,] 0.000 0.000 0.000 [12,] 0.000 0.000 0.000 [13,] 1.336 0.000 0.599 [14,] 0.000 0.000 0.000 > print('Transitivity') [1] "Transitivity" > round(TR,3) [1] 0.667 0.267 0.500 0.244 0.267 0.167 0.143 0.300 1.000 0.333 0.600 0.300 [13] 0.500 0.500 > > © L. S. Barreto, 2018. The Analysis of CAS 77 7. The Portuguese Market of Electricity

Figure 7.1. Chromatc matrix of total efects of the Portuguese market of electricity

The graph of the network of total positve efects has nothing worthwhile any comment. Thus, it is omited.

7.4 Interpretation

The set of variables used afects the values of transitvity estmated. In table 7.1, column ‘Mean’, it can be verifed that the consumpton of electricity by in- dustry, and agriculture represents 50% of the total consumpton of electricity in Portugal. In column ‘TR’ the highest values of transitvity are the ones of the consumpton by in- dustry, and agriculture (1.000), and total consumpton (0.667). From these results we can infer a known economic statement: No demand, no market. If we eliminate the consumpton by industry, and agriculture, the greatest sensitvity of the new system is for the relatve price of electricity versus fuel oil. I am not an expert in the analysis of energy markets, partcularly the one of electricity, thus I can not go further in the comments about the other values on column PR, in table 7.1.

7.5 References

Carmona, N. M. R. P. S., 2006. Modelação Econométrica da Procura de Eletricidade em Portugal Contnental: uma Aplicação Empírica. Master thesis. Insttuto Superior de Economia e Gestão. University of Lisbon. Lisboa, Portugal. 78 © L. S. Barreto, 2018. The Analysis of CAS 7. The Portuguese Market of Electricity htp://bibliotecas.utl.pt/cgi-bin/koha/opac-detail.plv biblionumber=300263oshelfrowse_itemnumber=267233#shelfrowser © L. S. Barreto, 2018. The Analysis of CAS 79 8. Final Comments

8. Final Comments

8.1. The Nature of Complex Systems The concepts, method, models, and the analysis previously presented let me formulate three conjectures about CAS: • The emergence of TE is the main atribute of complex systems. TE can emerge in systems with at least three components highly connected. • Self-organizaton, and homeostasis or adaptveness of systems depend on the atributes of the components, actng laws, and the web of TE that emerges. • As stated in Hooker (2011a:8), “there is currently no coherent mathematcal framework for complex systems theory”. Given the high connectvity created by the matrix of TE, probably, MAR models are the more adequate to model CAS. In these models, components are simultaneously cause, and efect, as depicted by Pascal.

8.2 Epistemological aspects

In the history of science, there are examples of discoveries that brought simplicity to the complexity of several problems, some of them previously considered unrelated. Serres (1980: 242), says “a small number of simple things replaces a multtude of complex things”. Prigogine, and Stengers (1993: 98-102) give examples of this kind of situaton in physics, chemistry, and biology. In my understanding, the matrix of total efects is the hidden simplicity that eliminates many false complexites, and opens an opportunity for the acquisiton of new insights on CAS. Method SBCANAL sustains this asserton. I hope that the results presented in this book my bring some simplicity to what had been understood, in the last four decades, as complexity (Hooker, 2011). Let me approach this general issue from a diferent perspectve. In my understanding, Pascal created the stage where to set the study of real systems. As far as I can verify, I presume that, in this context, the next determinant advance to Pascal’s conceptualizaton is the model for a real system fguratvely described in fgure 2.2, and method SBCANAL. As already insinuated above, it is an open issue if the results presented in this book create an opportunity for the emergence of a new paradigm for the ontology of systems, and their study. I am not sure of the intellectual legitmacy, and fecundity of making lists of scientfc areas that contribute for something that does not exist: complexity theory. See htp://en.wikipedia.org/wiki/, File: Complex systems organizatonal map.jpg. This approach to complexity surprises me. Generally, to solve a problem, we start by eliminatng all superfuous aspects of the situaton, atemptng to isolate the core of the problematc issue we try to understand, and after we look for a soluton. This is the procedure I adopted in the beginning of secton 1.2, with the subsequent results after displayed. 80 © L. S. Barreto, 2018. The Analysis of CAS 8. Final Comments

8.3 References

Hooker, C., Editor, 2011. Philosophy of Complex Systems. Elsevier. Hooker, C., 2011a. Introducton to Philosophy of Complex Systems: A. In C. Hooker, Editor, Philosophy of Complex Systems, Elsevier. Pages 3-90. Prigogine, I, and I. Stengers, 1993. Simples/Complexo. In F. Gil, Editor, Enciclopédia Einaudi: 26 Sistemas. Imprensa Nacional-Casa da Moeda, Lisboa. Pages 98-111. Serres, L., 1980. Le Parasite. Grasset, Paris. As mentoned in Prigogine, and Stengers (1993). © L. S. Barreto, 2018. The Analysis of CAS 81 Epilogue

Epilogue

Epilogue

The reader my think that given the ubiquity of CAS, the illustratons presented are scarce. In abstract, this is true. But the omnipresence of CAS, in the present situaton, is its Achilles's heel. There are two main reasons for this paucity of case studies, sometmes occurring simultaneously: • I could not fnd the adequate data; • After the analysis concluded, I would not be qualifed to interpret the results. Nevertheless, I believe that the results here presented are enough persuasive to convince the reader to try the applicaton of method SBCANAL to the CAS occurring in her/his area of work. Thank you for your cooperaton.