Chaouki Boufenar
email: boufenarc@gmail.com

Mohamed Batouche
email: mohamed.batouche@univ-constantine2.dz

Marc Schoenauer
email: marc.schoenauer@inria.fr

An Artificial Immune System for Offline Isolated Handwritten Arabic Character Recognition

Keywords: Isolated handwritten Arabic character, Offline recognition, Artificial Immune System, Preprocessing, Feature extraction, IFN/ENIT, Scikit Learn Library

Character recognition plays an important role in the modern world. In recent years, character recognition systems for different languages has gain importance. The recognition of Arabic writing is still an important challenge due to its cursive nature and great topological variability. The Artificial Immune System is a supervised learning technique that embodies the concepts of natural immunity to cope with complex classification problems. The objective of this research is to investigate the applicability of an Artificial Immune System in Offline Isolated Handwritten Arabic Characters. The developed system is composed of three main modules: preprocessing, feature extraction and recognition. The system was trained and tested with ten-fold cross-validation technique on an original realistic database that we built from the well-known IFN/ENIT benchmark. Parameter tuning was performed with a grid-search algorithm with leave-one-out cross-validation. The obtained results of the proposed system are promising with a classification rate of 93.25% and often outperform most well-known classifiers from Scikit Learn Library.

Introduction

Handwriting recognition has been one of the most fascinating and challenging research areas in the field of image processing and pattern recognition during the recent years [START_REF] Mori | Historical review of ocr research and development[END_REF]. Offline handwritten character recognition systems are very important for the creation of electronic libraries, mail sorting, checks verification, to mention a few examples. Arabic characters are used by several languages such as Persian, Shahmukhi, Urdu and Jawi. However, compared to Latin and Chinese handwritten character recognition, little research has been done on handwritten Arabic character (HAC) recognition.

Nature is an immense source of inspiration for solving hard and complex problems in computer science. Recently, bio-inspired algorithms have explored new areas of application and more opportunities in computing [START_REF] Tomin | Random forest based model for preventing large-scale emergencies in power systems[END_REF][START_REF] Zȃvoianu | Hybridization of multiobjective evolutionary algorithms and artificial neural networks for optimizing the performance of electrical drives[END_REF]. The vertebrate immune system (IS) is one of the most intricate bodily systems and its complexity is sometimes compared to that of the brain [START_REF] De Castro | Artificial immune systems: a novel paradigm to pattern recognition[END_REF]. A simplistic view of the immune system (IS) is that of an organ whose function is to detect and protect the organism from dangerous invaders called antigens.

Artificial Immune System (AIS) is inspired from the Natural Immune System (NIS), which uses antibodies (recognition cell or B-Cells) to recognize antigens. The term used to describe the degree of similarity between B-Cells and an antigen is called affinity. The adaptive ability of the IS is a process called affinity maturation. During an immune response, the recognition cell will perform clonal expansion; it will generate many clones of itself in an attempt to gain a better match next time the antigen will be found. A process called somatic hypermutation mutates the generated clones in proportion to the affinity [START_REF] Twycross | Information fusion in the immune system[END_REF].

Based on those principles, interesting artificial immune algorithms were developed. Among them, we note the resource limited AIS proposed by Timmis and Neal [START_REF] Timmis | A resource limited artificial immune system for data analysis[END_REF]. This algorithm introduced the concept of an artificial recognition ball (ARB), which has the same meaning as a B-cell.

In 2001, Watkins introduced the artificial immune recognition system (AIRS) which is a bio-inspired classification algorithm [START_REF] Watkins | Airs: A resource limited artificial immune classifier[END_REF]. An improvement denoted AIRS2 was made in 2004 by Watkins et al. [START_REF] Watkins | Artificial immune recognition system (airs): An immune-inspired supervised learning algorithm[END_REF].

The AIRS is a supervised learning technique that embodies the concepts of natural immunity to cope with complex classification problems. The AIRS is a resource limited algorithm that imitates immune metaphors such as antibody-antigen binding, affinity maturation, clonal selection process, resource competition and memory cell acquisition.

Many researchers try to apply several techniques for breaking through the complex problems of handwritten character recognition [52]. Compared to bio-inspired approaches such as artificial neural networks (ANN) [START_REF] Mathur | Offline handwriting recognition using genetic algorithm[END_REF], genetic algorithms [START_REF] Kala | Offline handwriting recognition using genetic algorithm[END_REF][START_REF] Mathur | Offline handwriting recognition using genetic algorithm[END_REF][START_REF] Patwardhan | Offline handwriting recognition using genetic algorithm[END_REF], AIS approaches remained less explored. There are some works on recognizing handwritten characters in English [START_REF] Liang | An english letter recognition algorithm based artificial immune[END_REF], Nepali [START_REF] Yang | Handwritten nepali character recognition based on wavelet packet transform and artificial immune system[END_REF], Armenian [START_REF] Yang | Handwritten armenian character recognition based on discrete cosine transform and artificial immune system[END_REF], Kannada [START_REF] Mamatha | Artificial immune system based recognition of handwritten kannada numerals[END_REF], Russian and Oriental scripts [START_REF] Yang | Application of artificial immune system in handwritten russian uppercase character recognition[END_REF]. However, there are only a few reports on Arabic script.

To the best of our knowledge, AIRS has not been used for offline isolated HAC recognition. It is believed that this is due to the lack of a standard benchmark database for comparing and validating emerging approaches in HAC research field. Motivated by these ideas, we are interested in applying an AIRS-based system to an original database for offline handwritten Arabic character recognition. For this purpose, we have set three different goals:

1. Providing an original dataset for isolated offline handwritten Arabic character recognition.

2. Investigating the applicability of AIRS to our new dataset.

3. Improving the performance of AIRS on this application by using a cross-validation grid-search parameter tuning.

The remaining of the paper is organized as follows. In the first section, we give a brief overview on some significant recent contributions to HAC recognition. Section 3 gives a state of the art regarding the use of AIS-based algorithm in handwritten recognition field. Section 4 presents the proposed system and Section 5 describes our new dataset used in this study. Section 6 describes the experiments conducted and compares their results with other leading work. Finally, Section 7 presents the conclusions and some future research directions.

Handwritten Arabic Character Recognition: Related works

In the last few decades, an increasing body of research have been conducted on Arabic character recognition. For more detailed overviews about Arabic character recognition, the readers may refer to reviews [START_REF] Lawgali | A survey on arabic character recognition[END_REF][START_REF] Shatnawi | Off-line handwritten arabic character recognition: A survey[END_REF].

Jannoud [START_REF] Jannoud | Automatic arabic hand written text recognition system[END_REF] proposed an Automatic Arabic Handwritten Text Recognition System. After the segmentation stage, discrete wavelet transform was used to extract the features of each character. A minimum distance classifier was used to classify the characters. This system achieved a 90% recognition rate of characters.

To recognize isolated HAC, Abandah et al. [START_REF] Abandah | Handwritten arabic character recognition using multiple classifiers based on letter form[END_REF] extracted a subset of 40 features from 95 features using principal component analysis. Classification was done by applying the following classifiers: Quadratic Discriminant Analysis (QDA), Linear Discriminat Analysis (LDA), Diagonal QDA (DQDA), Diagonal LDA (DLDA) and KNN (K-Nearest Neighbors). The experiments were conducted on their own database which contains 4992 characters. On average, accuracy of 87% was achieved in the best case. Aljuaid et al. [START_REF] Aljuaid | Arabic handwriting recognition using projection profile and genetic approach[END_REF] used a genetic approach to recognize HAC. Structural features of each character are extracted to distinguish the shape of the character. The system was tested and achieved an accuracy of approximately 87%. Al-Jawfi [START_REF] Al-Jawfi | Handwriting arabic character recognition lenet using neural network[END_REF] designed the structure of LeNet neural network, which recognizes the main and secondary components. The network configuration had more than three layers which increased the computation and complexity of the network. The mean square error averaged was 0.42 on test set. The database used to train and test the network consists of 750 segmented Arabic characters which is not enough to show the strengths of the ANN model.

El-Glaly and Quek [START_REF] El-Glaly | Isolated handwritten arabic character recognition using multilayer perceptron and k nearest neighbor classifiers[END_REF] extracted some statistical features depending on the number of vertical and horizontal transitions and the ratio between the height and width of the characters. KNN and ANN classifiers were compared in this work. Contrary to ANN, KNN had very low error rate in classifying new datasets, and its accuracy was 90%. However, the comparison between the two classifiers using few simple examples (280 samples) fails to show the strength of the classifiers.

Rashad et al. [START_REF] Rashad | Arabic character recognition using statistical and geometric moment features[END_REF] used a combination of statistical features and geometric moment features, which are independent of the font and size of the character. An ANN was trained 1000 times using 1000 samples of characters. The results showed that using only statistical features was less accurate than using a hybrid features systems. However, the execution time is high because their ANN architecture included more than two layers. An average recognition rate of 97% is achieved using six different fonts on 1000 samples. Sahlol and Suen [START_REF] Sahlol | A novel method for the recognition of isolated handwritten arabic characters[END_REF] introduced a new method for HAC recognition based on novel preprocessing operations and also different features. Their system was trained and tested by ANN on CENPRMI dataset. The proposed algorithm obtained good results as it was able to recognize 88% of their test set accurately.

Elzobi et al. [START_REF] Elzobi | Gabor wavelet recognition approach for off-line handwritten arabic using explicit segmentation[END_REF] extracted the mean and standard deviation of the Gabor wavelet transformed images. This method uses the Gabor wavelet which requires memory and high computation time. Classification was carried out by employing a Support Vectors Machine (SVM) algorithm where IESK-arDB and IFN/ENIT databases were respectively used for testing and evaluating the proposed approach. The average recognition rate reached 71%. Bahashwan et al. [START_REF] Bahashwan | Offline handwritten arabic character recognition using features extracted from curvelet and spatial domains[END_REF] proposed an efficient algorithm for HAC recognition. The algorithm combined features extracted from curvelet transform [START_REF] Candes | Curvelets: A surprisingly effective nonadaptive representation for objects with edges[END_REF] and spatial domains. The extracted feature vector was then trained using an ANN classifier. The evaluation was carried out on their own database which contains 5600 samples. An accuracy rate of 90.3% has been achieved.

In reviewing works on the recognition of HAC, the following limits were raised:

1. The SVM classifier has not been able to recognize the characters in IESK-arDB and IFN/ENIT databases, since the recognition rate was very low. It was not advantageous for HAC recognition.

2. The best results were found using the ANN, but these results are not significant, since the ANN was trained and tested on little data. Despite these efforts, most of the recognition rates obtained in private datasets are suboptimal and need to be improved.

Artificial Immune Systems for Handwritten Recognition

AIS approach is applied to several applications [START_REF] De Castro | Artificial immune systems: Part ii-a survey of applications[END_REF], it aims at solving complex computational or engineering problems such as pattern recognition [START_REF] De Castro | Artificial immune systems: a novel paradigm to pattern recognition[END_REF][START_REF] Djeddi | Artificial immune recognition system for arabic writer identification[END_REF][START_REF] Draman | Bio-inspired audio content-based retrieval framework (b-acrf)[END_REF][START_REF] Faraoun | Artificial immune systems for text-dependent speaker recognition[END_REF][START_REF] Isa | Application of the clonal selection algorithm in artificial immune systems for shape recognition[END_REF][START_REF] Kumar | An artificial immune system based approach for english grammar checking[END_REF][START_REF] Zhang | Multi-class text categorization based on immune algorithm[END_REF] computer virus detection and elimination [START_REF] Jim | A review of artificial immune system based security frameworks for manet[END_REF][START_REF] Yang | A survey of artificial immune system based intrusion detection[END_REF], and optimization [START_REF] Jordehi | A chaotic artificial immune system optimisation algorithm for solving global continuous optimisation problems[END_REF]. [START_REF] Kodaz | Medical application of information gain based artificial immune recognition system (airs): Diagnosis of thyroid disease[END_REF][START_REF] Polat | Automated identification of diseases related to lymph system from lymphography data using artificial immune recognition system with fuzzy resource allocation mechanism (fuzzy-airs)[END_REF][START_REF] Polat | Prediction of hepatitis disease based on principal component analysis and artificial immune recognition system[END_REF][START_REF] Polat | Principles component analysis, fuzzy weighting pre-processing and artificial immune recognition system based diagnostic system for diagnosis of lung cancer[END_REF][START_REF] Polat | Pairwise classifier approach to automated diagnosis of disorder degree of obstructive sleep apnea syndrome: combining of airs and one versus one (ovo-airs)[END_REF][START_REF] Polat | Automatic detection of heart disease using an artificial immune recognition system (airs) with fuzzy resource allocation mechanism and k-nn (nearest neighbour) based weighting preprocessing[END_REF]. It was also used for semantic documents classification in [START_REF] Greensmith | An artificial immune system approach to semantic document classification[END_REF], music genre classification in [START_REF] Golzari | A hybrid approach to traditional malay music genre classification: Combining feature selection and artificial immune recognition system[END_REF] and in [START_REF] Kaban | Genre and author detection in turkish texts using artificial immune recognition systems[END_REF] for genre and author detection in Turkish texts.

AIRS has been proposed to medical diagnosis problems in

Concerning handwritten recognition, Garain et al. [START_REF] Garain | Recognition of handwritten indic script using clonal selection algorithm[END_REF] proposed a classification approach based on CSA to recognize handwritten Indian digits. Two different datasets were used to evaluate the proposed classification approach. The training was conducted on samples from five partitions and classification was tested on the sixth partition. The experimental results reported the average recognition accuracy of about 96%.

Chmielewski and Wierzchoń [START_REF] Chmielewski | An immune approach to recognition of handwritten words[END_REF] proposed an immune-based approach to recognition of handwritten words. They employed the negative selection mechanism and incorporated two types of detectors : binary and real values. A dataset of few samples was used in their experiments. To evaluate the effectiveness of the algorithm, detection rate and false alarm rate were used. The results showed the efficiency of the proposed approach. Chenet al. [START_REF] Chen | A handwritten character recognition algorithm based on artificial immune[END_REF] proposed a handwritten character recognition algorithm based on AIS. The authors used the well-known character dataset provided by F. Prat from University of California at Irvine. The dataset were divided into two sets: 6500 samples for training and 1500 for testing. The average recognition accuracy of the algorithm was 94.41%. Yu Yang used AIS to recognize Russian uppercase character [START_REF] Yang | Application of artificial immune system in handwritten russian uppercase character recognition[END_REF], handwritten Icelandic character [START_REF] Yang | Handwritten icelandic character recognition based on artificial immune system[END_REF], handwritten Armenian character [START_REF] Yang | Handwritten armenian character recognition based on discrete cosine transform and artificial immune system[END_REF] and Nepali character [START_REF] Yang | Handwritten nepali character recognition based on wavelet packet transform and artificial immune system[END_REF]. They used in their study 1920 samples of 32 Icelandic characters and achieved an average accuracy of 83.2%, 81.2% and 80.7% respectively.

The contrast experiments were done using ANN and indicated that AIS has more advantages than ANN (75.1%) when applied to a small datasets.

In order to enhance the accuracy, a letter recognition algorithm based on AIS, referred to as LEBAI, was presented by Liang et al. [START_REF] Liang | An english letter recognition algorithm based artificial immune[END_REF]. The algorithm was tested by the well-known letter recognition dataset of UCI (University of California at Irvine) and achieved a recognition accuracy of 95.58%.

Huang et al. [START_REF] Huang | Licence plate character recognition using artificial immune technique[END_REF] presented a new Licence Plate Character Recognition (LPCR) algorithm based on clonal selection algorithm. Once memory cells are established, it will output the classification results using Fuzzy KNN approach. The performance of the algorithm was compared to the ANN in solving a LPCR problem and showed to be better by more than two percent in training and more than three percent in testing.

Utpal et al. [START_REF] Garain | Recognition of handwritten indic script using clonal selection algorithm[END_REF] presented an application of a 2-phase clonal selection algorithm for the recognition of handwritten Indic numerals. The proposed scheme achieved a recognition accuracy of about 96%.

Mamatha et al. [START_REF] Mamatha | Artificial immune system based recognition of handwritten kannada numerals[END_REF] used an AIS for training zonal extracted features of handwritten Kannada numerals. KNN classifier was used for classification. The performance of the proposed algorithm was investigated in detail on nearly 1250 samples of handwritten Kannada numerals and a recognition accuracy of 98.11% was achieved.

Nemmour and Chibani [START_REF] Nemmour | Artificial immune system for handwritten arabic word recognition[END_REF] examined the application of AIRS for solving handwritten Arabic word recognition system. The AIRS was tested on samples of the IFN/ENIT [START_REF] Pechwitz | Ifn/enit-database of handwritten arabic words[END_REF] dataset using ridgelet transform [START_REF] Candès | Ridgelets: A key to higher-dimensional intermittency?[END_REF] and grid features. The performance evaluation was carried out comparatively to SVM classifiers.

In recent time, Arit et al. [START_REF] Thammano | Recognition of archaic lanna handwritten manuscripts using a hybrid bio-inspired algorithm[END_REF] proposed a new character recognition system for archaic Lanna handwritten characters. The CSA of the AIS was hybridized with particle swarm optimization and used to build a recognition model. The experiments were conducted on printed Lanna character, Bangla numerals, Arabic numerals, Devanagari numerals, Telugu numerals and Latin ones.

Besides, Serdouk et al. [START_REF] Serdouk | An improved artificial immune recognition system for off-line handwritten signature verification[END_REF][START_REF] Serdouk | New off-line handwritten signature verification method based on artificial immune recognition system[END_REF] introduced an improved AIRS classification for solving automatic offline handwritten signature verification. The results showed that AIRS for handwritten signature verification has promising performance and outperforms the state of the art algorithms.

Based on the literature review of the AIRS classifier and compared with other languages, the following points are drawn:

1. The AIRS technique has not been used for offline isolated HAC recognition.

The tuning of AIRS parameters has not been mentioned.

We present in the following the methodology that we have adopted for developing our system. The proposed system is based on an artificial immune approach for recognizing isolated HAC.

The proposed character recognition system

The system that we propose is composed of three main modules: prepocessing module, feature extraction module and recognition module. We have developed the first and second modules with Matlab whereas we used Java and Weka to develop the third one. The programs can be accessed through this link: https://www.mediafire.com/folder/74kzyuevvb8jz/Documents. Fig. 1 shows the flowchart of the system.

Preprocessing module

We perform the following preprocessing steps:

Noise removal

The major objective of noise removal is to remove any unwanted pixel-patterns which do not have any significance in the output. We perform three operations:

1. Filling: fills isolated interior pixels, such as the center pixel in the pattern below (see Fig. 2(a)). 2. Cleaning: removes isolated pixels, such as the center pixel in the pattern below (see Fig. 2(b)).

3. Removing: removes isolated pixels (individual black pixels that are surrounded by white ones), such as the center pixel in the pattern below (see Fig. 2(c)).

Minimum Enclosing Bounding Box

It consists of computing the smaller rectangular frame (bounding box) enclosing the character. This operation is shown in Fig. 3(d).

Skeletonization

It is a morphological operation, somewhat related to erosion or opening. This module reduces all lines to have single pixel thickness. Such an operation allows recognizing the character image using relatively few patterns in the training set. Fig. 3(d) shows the resulting outline of Zhang and Suen thinning algorithm [START_REF] Zhang | A fast parallel algorithm for thinning digital patterns[END_REF] on isolated Dal( ) character.

Boundary extraction

It is another preprocessing stage in character recognition where the character outer contour is found.

Fig. 3(c) shows isolated Dal( ) after finding its boundary.

Secondary Component Removal

We use some features which are extracted from the main bodies skeleton and boundary of the character.

Thus, removing secondary component is done before starting the feature extraction process. Indeed, more than half the Arabic letters are composed of main body and secondary components. The secondary components are letter components that are disconnected from the main body. These letters can be detected by using the connected component labeling techniques [START_REF] Jain | Schunck. machine vision[END_REF][START_REF] Rosenfeld | Digital picture processing[END_REF].

Feature extraction module

Feature extraction

The process of getting useful information from the character image is called feature extraction. Choosing the most discriminant features might be the most important step for achieving a high recognition rate.

In general there are two categories of features extracted: structural features and statistical features. We have implemented seven types of features distributed as follow:

1) Structural information. number of connected components, closed loop and concavities.

2) Statistical information. zoning, accumulated chain code representation, area to perimeter ratio and transition features.

• Zoning

This technique imposes a grid of 4 × 4 on the bounding box of character image dividing the image into 16 equal zones. In each zone, we extract the density that represents the ratio of the number of black pixels forming the character on the total size of a zone [START_REF] Nebti | Handwritten characters recognition based on nature-inspired computing and neuro-evolution[END_REF]. In such a way , we will have a vector of 16 real values. In addition, we compute the horizontal, vertical, both diagonal and anti-diagonal histograms. However, we consider zones instead of pixels. Thus, the feature vector has 26 features (16 for densities and 10 for histograms). Fig. 4 illustrates zoning features.

0 ⁄ ⁄ ⁄ 0 0 ⁄ ⁄ ⁄ 0 0 ⁄ ⁄ ⁄ ⁄ ⁄
Fig. 4 Zoning Features.

(a) Image boundary. • Accumulated Chain Code Representation (ACCR)

Chain code representation of an input character image shown in Fig. 5(c) is obtained by using Freeman codes while tracing its contour as shown in Fig. 5(a). Accumulate representation shown in Fig. 5(d) consists of browsing the contour of the image pixel by pixel and accumulate the number of pixels in the same direction given by the 8-Freeman code as shown in Fig. 5(b). As we use 8-connectivity, we will have a feature vector composed of 8 components representing the accumulated numbers.

• Transition features

For each row and each column in the binary image, we compute the number of transitions between foreground pixels and background pixels ((1 to 0) or (0 to 1)). Then, the largest values in the two directions constitute the transition features vector. Thus, this features contribute with two components in the global features vector. A computation example is shown in Fig. 6.

• Concavity

Arabic characters have strokes concaved in different directions, e.g, up in Baa character ( ), right in Haa( ) character, left or up-left in Raa( ) character and down-left in Meem( ) character. This feature contributes with four components in the global feature vector. Fig. 8 shows five types of concavity.

• Closed loop

There are nine Arabic letters that are usually written with loop ( , , , , , , , and ). This makes the closed loop feature a prominent part in recognizing Arabic characters. We used the connected component labeling technique [START_REF] Jain | Schunck. machine vision[END_REF][START_REF] Rosenfeld | Digital picture processing[END_REF]to detect loops in an image. Thus, this feature contributes with one component in the global features vector.

• Area to perimeter ratio Since different people write the same characters in different sizes, the absolute area and perimeter are not suitable features for HAC. Therefore, the ratio (area/perimeter ratio) of the character is more appropriate. This feature participates with one real component in the global features vector.

• Number of connected components

The number of connected components is an important feature because it can be effective for distinguishing among most of Arabic characters like Baa( ) with one dot, Taa( ) with two dots, Thaa( ) with three dots and Alef Hamzah( ) containing Hamzah( ) as secondary component. There are im- portant variations in drawing the secondary components that can be confusing; mostly in drawing two dots and three dots. Calculating the size of component is the most suitable solution for this kind of confusion. Thus, this feature participates with one component in the global features vector. Fig. 7 shows variations in shapes of the same Arabic handwritten letter Thaa( ).

The global feature vector includes seven sets of features which are summarized in Table 1.

Feature selection

To select the most relevant features and reduce the dimension of a feature vector, we apply a deterministic feature selection technique. In fact, in this work we have selected the categories of features but not the elements in the category. Let S = {f i } be the set of these categories of features, i ∈ {2, 3, 4, 5, 6, 7} (see Table 1). We consider a combination C m n in S, where m ∈ {2, 3, 4, 5, 6, 7} and n = 7.

Recognition: AIRS

The function of the AIRS algorithm is to prepare a pool of recognition or memory cells (data exemplars) which are representative of the training data that the model is exposed to, and is suitable for classifying unseen data. In this study, antibodies are character samples which have been trained and antigens are unseen characters which will be recognized (input samples).

Before exposing the learning and classification algorithms relative to the AIRS technique, it is interesting to show the relationship between NIS and AIRS. Table 2 summarizes the mapping from IS to AIRS [START_REF] Watkins | Artificial immune recognition system (airs): An immune-inspired supervised learning algorithm[END_REF].

The AIRS algorithm is basically composed of two phases: the learning reduction phase and the classification phase. Fig. 9 shows the life cycle of the AIRS system.

The learning reduction phase

The learning reduction phase represents the main step of the algorithm. It consists of four main stages.

In AIRS, there are two different populations: Artificial Recognition Balls (ARBs) and Memory Cells (MC).

In AIRS, the ARB corresponds to the feature vector of a training sample in addition to its class and its number of resources. We assume the AB as the ARBs population: AB = {ab 1 , ab 2 , ..., ab r } and M C = {mc 1 , mc 2 , ..., mc m } as memory cell pool containing m memory cells.

• Initialization

This step of the algorithm consists of preparing the data for use in the training process. The training data is normalized so that the affinity of each pair (ag i , ag j ) in the training set is in the range[0, 1]. The Euclidean distance is used as affinity measure between two cells or antigens:

af f inity(ag i , ag j ) = na k=1 (ag i (k) -ag j (k)) 2 .
where (ag i , ag j ) is a pair of antigens (instances) and na represents the number of attributes. After normalization, the affinity threshold is calculated. The Affinity Threshold (AT ) is the average affinity value over all training data. The affinity threshold is calculated as follows:

Af f inityT hreshold(AT ) = n i=1 n j=i+1 af f inity(ag i , ag j )

n×(n-1) 2
.

Where n is the number of training instances (antigens) in question. Finally, the M C is seeded by randomly adding training instances. Once initialization is complete, the following three steps will repeat for each antigen in the training base.

• Step 1: Memory cell identification and ARB generation

This step models the principle of affinity maturation and takes place for each new antigen introduced. Given a specific training antigen ag, find the memory cell, mc match , that has the highest stimulation with ag. mc match = argmax mc∈M C Stimulation(ag, mc).

where stimulation(ag, mc) is defined as follow:

Stimulation(ag, mc) = 1 -af f inity(ag, mc).
This sub-step is called Clonal Expansion. Once mc match is selected, it will be used to generate new ARBs to be placed into the population of (possibly) preexisting ARBs pool AB. The number of mutated clones to be added is proportional to the affinity between mc match and ag. This number is calculated by: numClones = Stimulation(ag, mc) × HypermutationRate × ClonalRate.

Note that HR and CR are values set by the user. Features of new clones can be mutated with probability mutationRate which is also a userdefined constant in range[0,1].

The classification phase

Once the training of all antigens is completed, the evolved M C pool can be used for classifying test samples. Specifically, classification is accomplished by majority vote of the k-nearest memory cell to the presented test antigen (k is user parameter).

DataBase

Large databases of HAC and words are confidential and not publicly available for non-commercial research when compared to Latin languages. Many papers in HAC recognition have used their own small datasets such as Lawgali et al. [START_REF] Lawgali | Hacdb: Handwritten arabic characters database for automatic character recognition[END_REF], Al-Badr and Mahmoud [START_REF] Al-Badr | Survey and bibliography of arabic optical text recognition[END_REF], Khedher et al. [START_REF] Khedher | Optimizing feature selection for recognizing handwritten arabic characters[END_REF], Mozaffari et al. [START_REF] Mozaffari | A comprehensive isolated farsi/arabic character database for handwritten ocr research[END_REF], Bahashwan et al. [START_REF] Bahashwan | A database of arabic handwritten characters[END_REF] and recently Jawad H Alkhateeb [START_REF] Alkhateeb | A database for arabic handwritten character recognition[END_REF]. Most cited databases are confidential and not freely available. The few available ones, are small and the characters are not evenly distributed over all classes.

In this study, we have constructed our local database that contains 5600 isolated letters from the wellknown IFN/ENIT benchmark [START_REF] Pechwitz | Comparison of two different feature sets for offline recognition of handwritten arabic words[END_REF].

The process operates as follows:

-First, we have considered the first three sets in IFN/ENIT database (set a, set b and set c).

-Secondly, we have picked up a word in a current set, and we have cropped it manually in letters using the paint software.

-Finally, we have kept only isolated letters which we will be recognized.

We summarize by saying that we have provided a new local dataset that includes 5600 isolated black and white letters of 128 × 128 pixels. The images are evenly divided into 28 classes, the variability is quite important as we can assess from the dataset mosaic shown on Fig. 10. At first glance, the dataset seems similar to MNIST dataset [START_REF] Deng | The mnist database of handwritten digit images for machine learning research[END_REF] in terms of learning complexity. The provided dataset can be downloaded through this link: https://www.mediafire.com/folder/74kzyuevvb8jz/Documents

Experiments and discussions

The evaluation of the AIRS model was performed in three steps: feature selection step, parameter tuning

Feature selection step

We have considered for the experiment the seven sets of features described in section 4.2. Selecting the most relevant features has been done by running AIRS with default values over 120 combinations of seven sets of features and with leave-one-out ten-cross-validation. We have obtained the highest accuracy with combination (f 3 , f 4 , f 5 , f 6 , f 7 ) that corresponds to zoning, number of connected components, transition features, area to perimeter ratio and closed loop.

Parameter tuning step

Parameters tuning is a final step in the process of applied machine learning before presenting results.

Algorithm tuning has been recently addressed in some research works on different applications [START_REF] Precup | Fuzzy logic-based adaptive gravitational search algorithm for optimal tuning of fuzzy-controlled servo systems[END_REF][START_REF] Valdez | An improved evolutionary method with fuzzy logic for combining particle swarm optimization and genetic algorithms[END_REF].

In fact, the classification performance of the AIRS2 algorithm depends on eight user defined parameters: Seed, Affinity Threshold Scalar (ATS), Clonal Rate (CR), Hypermutation Rate (HR), Total Resources (TR), ST, Memory Initial Pool Size (MIPS), number of nearest neighbors in KNN(K). Investigating individually the effects of parameters allows one to reduce the number of parameters which were varied within grid-search algorithm. For tuning parameters we considered three levels:

A) Global Investigation Level.
At this level we have examined the impact of all parameters in large ranges. Fig. 11 shows how the accuracy is affected by alternating parameters.

-Varying a number of seed cells (Seed) and MIPS between one and 100 affects the classification performance. Here it can be noted that increasing the Seed and MIPS has a very little influence on the performance of AIRS algorithm. Thus, these two parameters were kept constant with the following values: Seed=1 and MIPS=1.

-Varying ATS between 0.05 and one with step=0.05 showed that the accuracy decreases from the first value. This needs to examine deeply the effect of this parameter between 10 -2 and 10 -1 with step=10 -2 .

-How CR parameter affects classification performance is shown in Fig. 11. When we have varied CR between one and 100 with step =5, a little impact on accuracy has been observed between one and 10. Over CR=10, the accuracy keeps its highest value which is close to 91% until CR=50.

When the CR value exceeds 50, the performance of AIRS begins to degrade until CR=85 when we have shown a serious decrease in accuracy which reaches its bad values. Consequently, CR value has been more explored between 10 and 40 using a smaller step (step =0.5).

-Changing HR between one and 100 with step=5 has shown an improvement beyond HR=10.

Better value has been reached from HR=5, and accuracy remains unaffected by variation in HR parameter until 100 value. This parameter has been more investigated in the vicinity of five using steps of 10 -1 .

-TR parameter when varied between one and 10 3 with step=25 accuracy drops significantly from 63.05% for TR=1 to 89.67% for TR=75. However, beyond TR=75 classification accuracy has not exceeded 89.9% which has been the highest value. More exploration has been needed in the range [75,200] with step=5 to better tune this parameter.

-Varying the ST parameter between 10 -1 and one with step=0.15 has shown that the accuracy benefits slightly from higher threshold. Over ST=0.6 the accuracy becomes almost constant between 89% and 89.5%. Therefore, a deeper exploration has been conducted in the range [0.6, 0.98] using 10 -2 as step.

-Varying the number of the nearest neighbor (k) between one and 50 has shown a continued deterioration in the performance of the algorithm. The first value of k gives the best accuracy.

Thus, k has been fixed to value one, and will not be varied in the next step.

B) Local Investigation Level

The purpose of this step is to further reduce the number of parameters to be varied in the next step.

We will make an exploration more precise than that shown in the previous step. Table 3 and Fig. 12 summarize the variations of parameter values in local ranges.

• TR and ST : For both two parameters the accuracy was stagnating at 89% for all values looked into. They have a very little impact on the performance of the model when they deviate from their default values (0.9 and 150, respectively). Therefore, TR and ST will maintain their default values and they will not be among the parameters to which we apply the grid-search algorithm.

• ATS and HR: in the overall investigated intervals the accuracy is close to 91%. Thus, these two parameters can improve accuracy when they are correlated.

• CR: investigation of this parameter in the range [START_REF] De Castro | Artificial immune systems: a novel paradigm to pattern recognition[END_REF][START_REF] Mozaffari | A comprehensive isolated farsi/arabic character database for handwritten ocr research[END_REF] has allowed us to observe that:

-The accuracy does not drop below 91% on all values of CR examined in the interval [START_REF] De Castro | Artificial immune systems: a novel paradigm to pattern recognition[END_REF][START_REF] Mozaffari | A comprehensive isolated farsi/arabic character database for handwritten ocr research[END_REF];

-The best predictions (∼ 92%) are obtained for the values close to CR=40;

The three last parameters (ATS, HR and CR) will undergo a grid-search to show the effect of correlating them.

C) Grid-Search Tuning Level.

At this level we have applied the grid-search algorithm with ten leave-one-out cross-validation in order to find the optimal combination of parameters values of ATS, CR and HR, such that the best classification accuracy on our dataset can be achieved. The search range for these parameters was [10 -2 ,10 -1 ], [START_REF] Kala | Offline handwriting recognition using genetic algorithm[END_REF][START_REF] Mozaffari | A comprehensive isolated farsi/arabic character database for handwritten ocr research[END_REF] and [START_REF] Bahashwan | A database of arabic handwritten characters[END_REF][START_REF] Djeddi | Artificial immune recognition system for arabic writer identification[END_REF], respectively. For both parameters, the grid-search has been performed

with steps on a logarithmic scale. Table 4 shows the grid-search parameter optimization details while Table 5 illustrates the recognition results by character class.

We show in Table 5 that AIRS gives a recognition rate exceeding 90% for almost all letters although we get 100% success rate for some letters.

The worst six recognized letters are: ( ), ( ), ( ), ( ), ( ), ( ). The first five are always drawn with concavities. There are subtle similarities among the three first and the only difference between them is the presence of secondary components (points in this case) and their positions with respect to the main component. It has been observed from Table 5 that most of the ambiguities in recognizing occur between the characters with very similar shapes. Examples of some incorrectly recognized characters are the following:

-Character Khaa( ) is confused with character Ghayn( ), especially when the little right cavity of character Ghayn( ) is omitted.

-The only character that can be confused with Zay( ) character is the Dhal( ) character; but Raa( ) character can be confused with three characters that are: Lam( ), Dal( ), and Waw( ) notably when it is written without loop. For this reason we find that the accuracy of character Zay is 100%, while the accuracy of character Raa( ) is 93.5% and the difference between these two characters is only the dot over Zay.

-Character Taa( ) is very confused with character Thaa( ) when the three dots above the latter are written as two dots. This is observed in the third entry in Table 5.

According to the obtained results in Table 5, we think that the model accuracy can be improved by introducing new features that:

-Detect the position of secondary components.

-Find the number of cavities and their directions.

Comparative Analysis

This section briefly touches on some comparisons in two ways, first between our system and recent state of the art recognition systems, and second with the well-known classifiers from Scikit Learn Library. In order to carry out these comparisons, we have developed a Python class that can be accessed through this link: https://www.mediafire.com/folder/74kzyuevvb8jz/Documents Table 6 shows the recognition results of recent published systems and our system. For each work, the table shows its publication year, the used classifier, the database used for evaluation and its accuracy.

We compare our work to that of Abandah et al. [START_REF] Abandah | Handwritten arabic character recognition using multiple classifiers based on letter form[END_REF] and Elzobi et al. [START_REF] Elzobi | Gabor wavelet recognition approach for off-line handwritten arabic using explicit segmentation[END_REF] which segment the word into characters and then recognize it. The former applies multiple classifiers to a local database of 4992 samples, and the latter uses SVM classifier on IESK-arDB database. In addition, our system is compared to those of Al-Jawfi [START_REF] Al-Jawfi | Handwriting arabic character recognition lenet using neural network[END_REF] and El-Glaly and Quek [START_REF] El-Glaly | Isolated handwritten arabic character recognition using multilayer perceptron and k nearest neighbor classifiers[END_REF] which obtain a better accuracy with KNN classifier but on very few examples (758 and 280, respectively). We also compare our work with Sahlol and Suen [START_REF] Sahlol | A novel method for the recognition of isolated handwritten arabic characters[END_REF] and Bahashwan et al. [START_REF] Bahashwan | Offline handwritten arabic character recognition using features extracted from curvelet and spatial domains[END_REF] which use ANN classifier to recognize handwritten Arabic characters. Unlike the former, the latter uses a local database of the same size as ours.

Table 6 shows that the proposed system is well situated among the best recently published works with an accuracy of 93.25%, which can be considered as a highly promising result.

CONCLUSION AND FUTURE WORK

In this paper, the use of AIRS in the field of offline HAC recognition has been investigated and discussed.

We have proposed a novel system composed of three main phases: preprocessing, feature extraction and classification.

At first, we have performed some preprocessing operations like noise removal, skeletonization, boundary extraction and secondary component removal. At the second phase, some structural and statistical features have been extracted and feature selection step has been performed to retain the most relevant features. At the last phase, we have used the AIRS model as a classifier.

We have provided an original database for isolated offline handwritten Arabic character recognition to evaluate our system. This database includes 5600 characters built from the well-known IFN/ENIT benchmark. The images in our new database are cropped and resized in 128 × 128 pixels.

We have experimented our approach on the novel database and under the default parameters of the AIRS model. The first results of experiments were very promising and an accuracy of 89.39% was achieved.

In order to improve accuracy, we have addressed the potential problem of the large number of optimized parameters for the AIRS model. The optimization of parameters with cross-validation grid-search increased significantly the classification accuracy from 89.39% to 93.25%.

To allow an equivalent comparison, a set of classifiers from the well-known Scikit learn library has also undergone a parameters optimization step using a grid-search technique over range, steps and scale attributes. The AIRS model outperforms almost all classifiers using hand-crafted features, and showed a great efficiency.

This study offers a good contribution to the literature. It presents an efficient model in comparison with some recently published works in the state of the art. We see the following promising avenues for future work:

1. Look into the strength of AIRS on a large dataset of HAC.

2. Tune the parameters automatically using a parameter tuning algorithm.

Fig. 2

 2 Fig. 2 Morphological noise removal.

Fig. 3

 3 Fig. 3 Preprocessing operations.

  Freeman Chain Code Sequence.[START_REF] Deng | The mnist database of handwritten digit images for machine learning research[END_REF][START_REF] Candes | Curvelets: A surprisingly effective nonadaptive representation for objects with edges[END_REF][START_REF] Candès | Ridgelets: A key to higher-dimensional intermittency?[END_REF][START_REF] Alkhateeb | A database for arabic handwritten character recognition[END_REF][START_REF] Chmielewski | An immune approach to recognition of handwritten words[END_REF][START_REF] Chen | A handwritten character recognition algorithm based on artificial immune[END_REF][START_REF] Bahashwan | A database of arabic handwritten characters[END_REF][START_REF] Alkhateeb | A database for arabic handwritten character recognition[END_REF] (d) Accumulated representation.

Fig. 5

 5 Fig. 5 Accumulated Freeman Chain Code Representation.

Fig. 6

 6 Fig. 6 Transition Features.

Fig. 7

 7 Fig. 7 Variations in Arabic handwritten secondary components.

Fig. 8

 8 Fig. 8 Types of Concavities.

Fig. 9

 9 Fig.9Life cycle of the AIRS system.

  step and comparison step. At first, we run AIRS with default parameter values : (Seed = 1, AT S = 0.2, CR = 10, HR = 2.0, T R = 150, ST = 0.9, M IP S = 1, k neighbor = 3).

Fig. 10

 10 Fig. 10 Partial view of the dataset (each line represents a class).

Fig. 11

 11 Fig. 11 The effect of altering parameter values on classification accuracy: global investigation.

1 Fig. 12

 112 Fig. 12 The effect of altering parameter values on classification accuracy: local investigation.

3 .

 3 Investigate the combination of AIRS model with other classification techniques.4. Compare the AIRS to deep learning techniques such as Convolutional Neural Networks and Deep Belief Neural Networks when the features are automatically computed by the network.

Table 1

 1 Feature Vector.

	N. •	Feature	Size
	f1	Accumulated chain code representation	8
	f2	Concavity	4
	f3	Zoning	26
	f4	Number of connected components	1
	f5	Transition features	2
	f6	Area to Perimeter Ratio	1
	f7	Closed loop	1

Table 2

 2 Mapping between the Immune System and AIRS.

	Immune System	AIRS
	Antibody	Attribute (feature) vector
	Recognition ball	Combination of feature vector and vector class
	Antigens	Training instances
	Clonal expansion	Reproduction of ARBs (Artificial Recognition Balls) that are well matched with antigens
	Affinity maturation Random mutation of ARBs and removal of the least stimulated ARBs
	Immune memory	Memory set of mutated ARBs

  Calculate Stimulation Value (StimV ) depending on whether it belongs or not to antigen class. 2. Calculate the number of resources (N bR) to allocate based on StimV : N bR(ab) = StimV (ab) × ClonalRate. 3. The resources are split across all ARBs as follows: 50% on those belonging to the same class of antigen and the remaining half on the rest of ARBs. 4. After attribution of resources, those ARBs left with zero rewards are removed from the pool of ARBs (AB). 5. At this level, a new ARBs pool will appear. All surviving ARBs of a class are cloned, mutate and placed back in AB. The number of clones is obtained by the following formula: N bClones = StimV × ClonalRate. 6. Stopping condition : The process stops when the mean StimV over all remaining ARBs (those with StimV different to zero value) of a class is above a threshold value, namely, the Stimulation Threshold (ST) which is set by the user. • Step 3: mc candidate selectionSelect the ARB with highest stimulation in the antigen class. This ARB is the candidate memory cell(mc candidate ). If the mc candidate is more stimulated by ag than mc match , it will be added to the pool. Moreover, if the affinity between mc candidate and mc match is less than Affinity Threshold (AT: calculated in the initialization stage) times the ATS (user defined parameter), then mc match is removed and replaced by mc candidate . Finally, the ARB pool is reset to zero after each antigenic pattern.

• Step 2: Competition for limited resources and development of a candidate memory cell

The goal of this stage is to determinate a candidate memory cell (mc candidate ). This is determined as follows: For each ab ∈ AB 1.

Table 3

 3 Parameter values variation in local ranges.

	Parameter Value
	Seed	1
	MIPS	1
	ATS	Explored in [10 -2 , 10 -1 ] , step=10 -2

Table 4

 4 Grid-search parameter optimization details.

	Classifier Parameter	Range [M in, M ax]	Steps Scale	Optimized parameter	Accuracy
		ATS	[10 -2 , 10 -1 ]	3	Logarithmic	10 -2
	AIRS	CR	[30, 40]	6	Logarithmic	35.652	93.25%
		HR	[6, 15]	6	Logarithmic	12.488

Table 6

 6 Comparison with state of the art.

	Authors	Year Database(Samples)	Classifier	Accuracy
	Adandah et al. [1]	2008	Local database(4992)	QDA, DQDA, LQDA, LDA, KNN 84%
	Al-Jawfi [3]	2009	Local database(758)	KNN	99.08%
	El-Glaly and Quek [17] 2012	Local database(280)	ANN	60%
				KNN	90%
	Rashad et al. [54]	2012	not mentioned	ANN	97%
	Sahlol and Suen [56]	2014	CENPRMI(11620)	ANN	88%
	Elzobi et al. [18]	2014	IESK-arDB	SVM	71%
	Bahashwan et al. [7]	2015	Local database(5600)	ANN	90.3%
	Our work	2016	Local database (5600) AIRS	93.25%

Table 7

 7 The classifiers and their optimized parameters are listed. The grid-search attributes (Range, Steps and Scale) are shown for each parameter.

	Classifier	Parameter	Range [M in, M ax]	Steps Scale	Optimized parameter
	Random Forest	n-estimators [1, 20]	1	Linear	18
	Linear SVM	C	[10 -3 , 10 3 ]	40	Logarithmic	1193776 × 10 -6
	Rbf SVM	C	[10 -3 , 10 10 ]	15	Logarithmic	22758459 × 10 -2
		γ	[10 -9 , 10 5 ]	15	Logarithmic	10 -8
	K-Nearest Neighbor	K	[1, 20]	1	Linear	9

Table 8

 8 Comparison with Scikit Learn Library classifiers on the same dataset and over the optimized parameters.

	Classifier	Recognition Rate (%)
	Random Forest (n estimators)	95.60
	AIRS (Optimized parameter)	93.25
	Rbf SVM(C,γ)	92.81
	LDA()	92.61
	Linear SVM(C)	92.31
	Decision Tree()	91.66
	Naïve Bayes ()	90.67
	AIRS(default parameter values)	89.39
	QDA()	89.12
	KNN (K) (without reduction learning phase) 76.91

1 1 1 1

In order to compare AIRS with other methods on the same database, we have considered eight classifiers from the well-known Scikit Learn Library [START_REF] Pedregosa | Scikit-learn: Machine learning in python[END_REF]. We have run these classifiers using ten-fold crossvalidation and GridSearchCV () as grid-search meta classifier for parameters optimization. A detailed list of the optimized parameters is provided in Table 7.

Table 8 shows that except for Random Forest classifier, optimized AIRS outperforms all optimized classifiers and is able to recognize with an interesting accuracy rate of 93.25%. For more transparency, we have compared AIRS with SVM classifier. The comparison results have illustrated that AIRS model has better accuracy than SVM classifier with linear kernel (92.31%) and rbf kernel (92.81%). We learn from this table that the AIRS model parameters affect its performance. We observe although that our parameters optimization strategy has allowed to improve the accuracy from 89.39% to 93.25%.

Comparison with KNN shows well the importance of the learning-reduction step of AIRS model where the recognition rate was at 76.91%.


Yi-Fang Liu

Vitting Jørgen

 Philippe Andersen

June De Peretti

Onset of financial instability studied via agent-based models

The mere complexity of scenarios which could lead tothe onset of financial market instability seems to demand new tools, in particular concerning the role of human decision-making during crises. Here we present agent-based models that could provide new insights into the wayperiods of market turmoil unfold.

We illustrate the method through a well-controlled setup in a series of experiments. We are thereby able to:i) validate the impact of model parameters and test their relevance by predicting the average outcome of an experiment; andii) consider each individual experiment and predict outcomes through a scenario analysis. These illustrations should show the appeal of the method in applications to real market situations.

Risk-taking in general, and in financial markets in particular, iswell known to be gender dependent [START_REF] Coates | Endogenous steroids and financial risk taking on a London trading floor[END_REF][START_REF] Coates | Second-to-fourth digit ratio predicts success among high-frequency financial traders[END_REF][START_REF] Coates | A note on trader Sharpe Ratios[END_REF][START_REF] Barber | Boys will be boys: Gender, overconfidence, and common stock investment[END_REF]van Staveren, 2014). In a financial context, it was shown in [START_REF] Coates | A note on trader Sharpe Ratios[END_REF] how the level of testosterone predicted the financial return, and cortisol the risk-taking, in a group of traders on a London trading floor. However, as shown in other studies [START_REF] Kirman | Epidemics of opinion and speculative bubbles in financial markets[END_REF], the higher financial returnsby certaintraders only came aboutby higher risk-taking. Whereas the incentives for risk-taking at the individual level arewell understood [START_REF] Markowitz | Portfolio selection: efficient diversification of investments[END_REF], very little is known about the causes and pathways which lead to risk at the system level, that is,risks affectingthe entire financial system, called systemic risks.

In order to study the onset of speculative behavior in general, and the impact of gender in particular, we therefore devised a series of experiments at LEEP ("Laboratory of Experimental Economics in Paris"), using groups with differentmale/female composition, as well as groups with different compositionsof individual risk profile. Before introducing the participants to the financial market experiments, we first obtained their individual risk profiles from a lottery-choice experiment, as introduced by Holt &Laury (2002). The idea is first to understand the composition of the group with respect to the individual risk profiles of itsmembers, in order later to assess the outcome of the financial market experiment. Our methodology builds on tools taken from socio-finance, see also [START_REF] Andersen | An Introduction to Socio-Finance[END_REF]. It is of particular interest to understand under which circumstances participants create excessive risk-taking at the market level and to find out how this depends on the composition of the individual risk profiles in a given group.As a tool to understand the mechanism behind excessive risk-taking,we use the so-called $-Game (see below). In general, we are thereby able to calculate the probability of excessive risk-taking given the parameters of the model. Experiments withgroups of either males or females were performed as a way to obtain groups with differentrisk profilecompositions. As will be seen, some of the financial market experiments showed fundamental value behaviorby the participants,while excessive risk-taking was observedin other experiments. One of the specific purposes of this study is to introduce the $-Game as a tool for calculating the probability of excessive risk-taking for given parameters and risk profiles.

Our study can be separated into three parts:

1. Experimental design.

The aim is to identify and understand deviations in human decision-making from rational expectation theory which can lead to excessive risk-taking, relevant in the early stages of systemic failure. The main ideahere is to use experiments close to real market situations.

Microscopic analysis.

The aim is to use game theory and computer simulations as a theoretical framework for understanding excessive risk-taking via price formation in the experiments. The output from the experiments is a price time series which is used as input to game-theoretical models simulated on a computer. This analysis gives us a microscopic understanding of the trading strategies used by the participants in each specific experiment.

Macroscopic analysis.

The aim is to get a broader theoretical understanding of human decisionmaking in situations where rational expectation theory no longer holds. A theoretical framework is developed to understand the general outcome of the experiments. This is contrastswiththe microscopic analysis mentioned above which aims to understand each specific experiment. The general theoretical framework gives a broad insight intothe experiments.

ExperimentalApproach

The experiments werecarried out at the Laboratory of Experimental Economics in Paris (LEEP, http://leep.univ-paris1.fr/accueil.htm). Each experiment had two parts: i) participants took part in alottery-choice experiment,described in Section2.2,and ii) participants tradedin a financial market,discussed in Section2.3. The lottery-choice experiment was introduced to assess the risk profile of the participants. A screenshot of the setup for the financial market experiment is shown in figure 1.

Figure 1. Screenshot of the setup for the financial market trading experiment.

2.1.Participants

The experiments took place at the experimental economics laboratory at the Centre d'Economie de la Sorbonne. All experiments were carried outwith students who had doneat least 4 years of economics at the Université Paris 1 Pantheon -Sorbonne. Each participant was only allowed to take part in one experiment.

The total gain of the students included 3 parts:

(i)
5 eurosjust for attending the experiments.

(ii) Any gains from the lottery-choice experiments.

(iii) Any gains from investing in the financial market experiments.

It should be noted that losses were not allowed in either (i) or (ii), i.e., the worst case scenario for a student would the 5 euros obtained by just taking part in the experiments.

Lottery-choice experiment

The aim of thelottery-choice experiment was to calculate the risk profile of the participants in each group. The idea behind these experiments was originally proposed by [START_REF] Holt | Risk aversion and incentive effects[END_REF]. The payoff of the lottery-choice experiment is shown in Table 1. The lottery-choice experiment was carried out as follows. First, each participant made a choice between Option A or Option B for each line in the decision table . The system would then randomly pick one of the decision lines (from decision 1 to 10) for each participant. Given the chosen decision line, a lottery would be performed according to the participant'schoice for that line (i.e., either A or B) and the participant would be awarded the outcome of that lottery.

Trading in a financial market

Whenall students have finished the lottery-choice, their risk profile is known (see section 4.1). They then proceedto the financial market experiment, which is the most important of the two experiments.

The number of participants in each experiment was fixed at10. There was only one asset in our financial market which the participants could either buy or sell, shortselling being allowed(see figure 1). The initial price of the asset was fixed at5

euroswith an expectation of a 10 cent dividend payout at the end of the 60 time periods. Each of the 60 time periods lasted 15 seconds. In each time period, the participants were presented brief statements of economic news and they could either buy or sell ONE asset or do nothing. The participants were told that the asset was correctly priced according to rational expectations [START_REF] Muth | Rational expectations and the theory of price movements[END_REF], that is, the price of the asset was supposed to correctly reflect all future discounted cash flow accrued to the asset. The participants could, at zerointerest rate, borrow money to buy shares, and short-selling was allowed. The parameters in each experiment are shown in Table 2.

Budget forone experiment

The general financial information was taken from real financial news items obtained on Bloomberg over a two week time period. Students were told the asset represented a portfolio of assets like an ETF or an index. They were all simultaneously presented with the same information, meant to reflect general financial news, e.g. good or bad US employment figures, commodity price changes, etc. The news items were the same in all experiments and were chosen without positive or negative bias.

At the end of each time period, the participants'orders were gathered and a new market price calculated (using Eq. (3.3)inSection 3.1), based on the order imbalance (with sign and magnitude determining the direction andsize of the price movement).This was thenshown to the participants graphically on their computer screen. Throughout the experiment the participants had a continuous update of the number of shares held and their gains/losses.

At the end of each experiment, a pool of 200euro was distributed pro rata among the participants who had a positive excess gain.

Simulation Approach

The simulation method used was the so-called "$-Game", a multi-agent based modeling approach (Vitting- [START_REF] Vitting Andersen | The $-game[END_REF], in which each individualagent makes his/her investment decisions with the aim of maximizing their profit payoff function. The objective was to detect the speculative and fundamental states in the experimental market data.The $-Game was inspired by the Minority Game (MG), introduced in 1997 by Yi-Cheng Zhang and Damien Challet [START_REF] Challet | Emergence of cooperation and organization in an evolutionary game[END_REF][START_REF] Challet | On the minority game: Analytical and numerical studies[END_REF] as an agent-based model to study market price dynamics [START_REF] Zhang | Modeling market mechanism with evolutionary games[END_REF][START_REF] Johnson | Crowd effects and volatility in markets with competing agents[END_REF][START_REF] Lamper | Predictability of large future changes in a competitive evolving population[END_REF]. The basic MG scheme consists ofa repeated game where the players choose to buy or sell at each time step on the basis of past information, and the winning partyis the one that selects the minority part. Like the Minority Game, the $-Game should be considered as a "minimal" model of a financial market.

The $-Game

The mathematical scenario of the $-Game model includes N agents that simultaneously take part in a one-asset financial market over a time horizon of p T periods. In each time period t , with p tT  , each agent i chooses an action

    1,0,1 i at
, where the action 1  is a "sell" order, the action 1 is a "buy" order, and the action 0 is a "hold" order, which means neither "buy" nor "sell". Players are assumed to be bounded rational, in the sense of using only a limited information set to make their decisions, with no short-sale constraints. In the version of the $-Game presented in this study, the agents use two different types of investment strategies: (i)

technical analysis strategies and (ii) fundamental analysis strategies.

Technical analysis strategies

Concerning decision-making based on technical analysis, each player observes the history of past price movements, which is limited to the size of their memory, m . Therefore, m denotes the size of the agent's memory. Each agent has a fixed number of strategiess. These s strategies are chosen randomly among the total pool of strategies (see below) and are assigned at the beginning of the game. A specific strategy j tells whether to buy, sell, or hold an equity depending on the past price history of up moves, represented as "1", and down moves, represented as " 0 ".

In each time period t , the i th agent uses his/herbest strategy to take an action

  * i at of buying   * 1 i at , or selling   * 1 i at , or simply doing nothing   * 0 i at .
The superscript* is used to mark   i at is the optimal strategy at time t. Table 2Example of a strategy.

History,   ht  Action,   j i at 000 1  001 1  010 1  011 1  100 -1 101 1  110 1  111 0
A strategy tells an agent what to do given the past market behavior. Table 2 shows an example of a strategy for 3 m 

. For all possible histories of up and down market moves over the last m time steps, the strategy suggests a specific action to take at time t , namely

    1,0, 1 j i a h t     with     0,1 m ht  .
For instance, if the market went down over the last 3 days, the strategy in Table 2 suggests buying the stock ( 000 1 

). If instead the market first went up, then down and finally up, the same strategy suggests selling(101  -1). Notethat, since the price has 2 possible moves (up or down), the number of possible price paths equals 28 m  bit sequences of 0's and 1's, each corresponding to a specific action   1,0, 1  suggested by the j strategy. This meansthat the space of all possible strategies is given by 2 3 6561 m  .

Agents keep a record of the overall payoff for each strategy over the entire market history (i.e., not limited to m past periods) using a rolling window of size m , and use this record to update which strategy is the most profitable at a given time t. This renders the game highly non-linear: as the price behavior of the market changes, the best strategy of a given agent changes,and this canthen lead to furtherchanges in the price dynamics.

The original $-Game payoff function  of the i th agent's j th strategy

  j i at in period t is determined by       1 jj ii a t a t r t       (3.1)
where   rt denotes the return of the market between time 1 t  and t .

The payoff in the $-Game therefore describes the gain/loss obtained by an investment strategy executed at time 1 t  depending on the market return in the following time step t . As shown byChordia, Roll, and Subrahmanyam (2001) and Chordia, and Subrahmanyam (2004), the actions of traders significantly impact price returns and liquidity through a positive autocorrelation in equilibrium. Imbalances in the order book thereby reflect a positive relation between imbalances and future returns. The price return   rt from 1 t  to t can therefore be assumed to be proportional to the order imbalance, leading to

            ln ln 1 At r t p t p t      (3.2)
wherep(t) denotes the price of the stock at time t. Given a certain order imbalance, the market price   pt can be calculated as

      1 At p t p t e     (3.3)
where  

At indicates the global order imbalance (see Eq.(3.4)) and  is a parameter describing the liquidity of the market, with N   . The price goes in the direction of the sign of the order imbalance (Holthausen, Leftwich, and Mayer, 1987;Plerou, Gopikrishnan, Gabaix, and Stanley, 2002) and

    * 1 N k k A t a t    (3.4)
Therefore, the payoff function in Eq.(3.1) can be re-expressed in terms of the return function in Eq.(3.2) as

          * 1 11 N k j j j k i i i at At a t a t a t             (3.5)
To summarize, in the $-Game technical analysis, trading strategies are based on a reward scheme for strategies whichat time 1 t  predicted the rightdirection forthe return of the market   rt in the next time step t . The larger the marketmovement, the more the loss or gain depends on whether the strategy correctlyor incorrectlypredicted the market movement.

In order to understand the findings of our experiments, we then extended the $game to include that fact that people are risk averse. Rather than being concernedsolely about absolute gains or losses, investors also pay attention to the risk involved in obtaining a certain level of profit. In finance, the Sharpe ratio is one way to examine the performance of an investment strategy by adjusting for its risk. We thus rewrite the original $-Game payoff function to include a "Sharpe Ratio", i.e.,

          1 jj ii rt a t a t rt        (3.6)
where

    rt 
is the standard deviation of the return   rt from the beginning of the game to time t . Specifically, if there are two ways to obtain a certain return, Eq. (3.6) ensuresthat investors will pick up the strategy which involves the least risk.

Furthermore, it should be noted that people are loss averse [START_REF] Kahneman | Prospect theory: an analysis of decision-making under risk[END_REF]). We therefore divide

    rt  intoa gain part, denoted by     rt   ,
and aloss part, denoted by

    rt   . The payoff function becomes               1 jj ii rt a t a t r t r t                      (3.7) Here     rt  
is the standard deviation of positive   rt  from the beginning of the game up totime t ,while

    rt  
is the standard deviation of negative returns   rt  from the beginning to time t .  and  take into account the asymmetry of gains versus losses. The special case of 0   corresponds to the standard $-game.

Fundamental analysis strategies

In addition to technical analysis strategies that seekto profit from price changes, we also consider strategies that seekto profit from information aboutthe fundamental value of an asset   f pt . Each player estimates   f pt by discounting future estimated cash flow (dividends) accrued to the asset. In order to limit the sell orders in the case

of extreme price deviations     f p t p t  or     f p t p t 
, we assume a vanishing use of the fundamental strategy according to a Poisson process of the form:

      , f p t p t e with Dt      (3.8)
This assumption provides a maximum probability bychoosing the fundamental strategy in correspondence with a price variation from its fundamental value that is almost equivalent to the dividend yield. Thismakes sense, given that the fundamental price is the expectation of future dividends.

Market dynamics

The formulation of the decision-making process using the $-Game leads to a financial market model based on the 9 parameters shown in Table 3.

Table 3 Parameters of the financial market model based on the$-Game. ii) Given the actual history of the market, i.e.,   ht 

Symbol Description

, each agent chooses the best performing strategy from the set of s available strategies. iii) Then the best strategy is used to decide whether to buy, hold, or sell an asset and place an order. iv) After each agent places its order, all orders are gathered together. v) This leads to a new price movement of the market: up if a majority choose to buy, and down if a majority choose to sell.

Once again, we see from Figure 2 that,as the market changes, the best strategies of the agents change too, and as the strategies of the agents change, they thereby change the market.

Figure 2. Representation of the price dynamics in the $-Game. Agents first update scores of all their s strategies depending on their ability to predict the market movement. After scores have been updated, each agent chooses the strategy which now has the highest score. Depending on what the price history happens to be at that moment, this strategy determines which action a given agent will take. Finally, the sum of the actions of all agents determines the next price move: if positive, the price moves up, if negative, the price moves down.

Decoupling and synchronization

Under certainspecific market conditions, it is possible that,regardless ofthe future states of the market, the investor's strategy will always recommend a given decision.

In such situations, the decision is independent of what will happen next. An investor is no longer influenced by the incoming information because all information will drive them to the same conclusion, making the market predictable. [START_REF] Andersen | A mechanism for pockets of predictability in complex adaptive systems[END_REF].

The strategy shown in Table 2 is one-time-step decoupled when conditioned on the price history

    010 m ht 
at time t . This holds because, no matter what price movementoccurs at time 1 t  (up/down), the strategy will always recommend to sell at time 2 t  (see Figure 3). 2 in the case of a price history of (010).One-time-step decoupling means that, no matter what price movement occurs at time 1 t  (0 or 1), the strategy will recommend the"sell" action at time 2 t  .

This means that so long as we see an occurrence of the price history where the market first went down (0), then up (1), then down (0), we know for sure this strategy will recommend "sell" (-1) two time steps ahead. In a hypothetical game with only one agent and only the one strategy presented in Table 2, given the price history (010), we would therefore know with certainty what the agent would do two time steps ahead.

So far we have showed how an analysis of the agents' strategies could lead to momentary predictability of their future actions. But knowing for sure what one, or even several agents will do, does not guarantee being able to predict what will happen at the level of the market. To know how the market will behave, we need to encounter a situation in which, not only are a majority of agents decoupled, but they need to be decoupled in the same direction. At any time t , the actions of agents can be thought of as coming from either coupled or decoupled strategies. The order imbalance can be rewritten as

      h t h t h t coupled decoupled A A A     (0.1)
The condition for certain predictability of what will happen one time step ahead is

    2 2 ht decoupled N At   (0.2)
The sign of the price movement at time 2 t  will be determined by the sign of

    2 ht decoupled
At   for a given price history at time t . decoupled A  is used to record the decoupled strategies with actions 1  , while decoupled A  is used to record the decoupled strategies with actions 1  .

Decoupling of a strategy means that different patterns of market history lead to the same decision (i.e., buy or sell), regardless of whether the market went up or down in the time step preceding the one in which the decision is to be made. The most interestingpoint about the decoupling mechanism is that it gives a handle to predict biased price behavior before it can be seen in the price data.

ExperimentalResults

Experimental design

We performed a series of 10 experiments, as listed in Table 4. The parameters of each experiment can be found in Table 2, Section 2.

Each experiment included10participants.,In experiments 1 to 8, the participants were either men orwomen. Experiments 9 and 10 weredone differently. First, agroup of 20 participants, men and women, were tested for their risk preferences. The group of 20 was then divided into two groups according to their risk preference. The participants in H0606 were greater risk-takersthan the participants in L0606.

Table 4. A list of experiments performed in our study.

No.

Gender Description

B0404 Male

The 10 experiments were grouped into a series of 8 experiments each with 10 participants, 4

of the experiments with male and 4 with female participants and 2 experiments where an initial group of 20 participants (female and male) was divided into two groups of10 participants according to their risk preference.

Lottery-choice results

In order to ascertain therisk profile of the trader population, we did alotterychoice experiment before the financial market experiment. The lottery-choice payoff is based on ten choices between the paired lotteries in Table 1. As mentioned before, the options B are riskier than the options A. Let's focus for a moment on the first decision in the lottery-choice table. The expected return of option A, i.e.,   1 6.56 Ten lottery-choice experiments were carried outin our study, each involving 10 participants, giving in total the risk profiles of 100 participants. We found that only 2 of the participants were extremely risk-loving,one in experiment B0404 and the other in experiment H0606. Interestingly, the 2 extreme risk seekers were male. On the other hand, we found 7 of the 100 participants to be extremely risk averse. Comparing Figures 456, the women in our experiments were clearly more risk averse than the men. In all the experiments with women, the first decision choices (1 and 2) were always A, whereas this was not the case with the groups containing men. Two of the groups of men had a probability of only 0.9 of choosingA for decision number 1. In addition, for men, the probability of choosing Option A declined faster versus the decision number. That is, male traders crossed over to Option B earlier than female traders. Women seek a higher payoff only if the probability of earning a higher payoff is large enough. In order to quantify risk profile by gender, we calculated the median of the probability of choosing option A(see Table 6 below).

Financial market results

Each group of participants performed 60 periods of trading in the financial market system introduced in Section 2. One notes an extraordinary price growth in some cases. In others, however, the market price merely fluctuated around the fundamental value. In order to identify the market behavior, three typical market states: "speculative state", "fundamental state", and "other state" were defined (see where the final market price exceeded the initial fundamental value by a factor of 20. This experiment was performed with a group of male traders. It was also the most risk-seeking group, with a medianof 4.5 to choose option A, the smallest median in all the experiments.

In order to understand and quantify the risk-taking behavior of the participants in the market experiments, we then turned our attention to the probability distribution for the gain/loss ΔW incurred during one trading period in the market experiment.We therefore calculated the full width at half maximum (FWHM) of the gain/loss probability distribution.

Figure 8 shows how to get the FWHM from a given distribution. The FWHM consists of FWHM+ and FWHM-, which are also illustrated in Figure 8: 9 lists the FWHM of the probability distribution of W  for all 10 experiments. In most instances, the FWHM values for thewomen's groups were smaller than those forthe men's groups. This illustrates the observation that women seemed more "cautious" than men when they were trading. It is also onereason why the price movements in the women's experiments seem less extreme.

    FWHM FWHM FWHM     (4.1) W  can be obtained from     1 ii W W t W t     (4.2)
However, a surprising thing was that two groups of female traders who were individually risk averse(as seen from the FWHM) created excessive risk-takingcollectively (G0409 and G0523). Comparing the FWHM values with male groups, the female groups took fewer risks.

This means that female tradersmanaged to createexcessive risk at the market level justby taking only small individual risks. 5 Simulation Results

Macroscopic simulation analysis

In order to understand the experiments, Monte Carlo (MC) simulations with various parameters were carried out. The MC simulations were used to calculate the probability ofexcessive risk-taking.

We (5.1)

First, we note that the qualitative behavior of a trading experiment can be predicted if we are given the market temperature T for fixed memory length m . This means that, no matter how many market participants N there are, and how many strategies s there are for each participant, if the market temperature T and memory length m are fixed, the macro behavior will be similar. Second, the memory length seems to play a major role in moving the system between the two states of speculative and fundamental behavior. The larger the value of m , for the same temperature, the more fundamental the behavior. From Figure 10, one can see that the probability of creating a speculative state decays with T. One notes that, for each m (2, 3, 4, or 6), the probability of creating a speculative state is highest when the market temperature T is lowest. Second, the greater the length of memory m, the smaller the probability of creating a speculative state. Third, the smaller the value of m, the faster the probability of creating a bubble decreaseswith T.

Microscopic simulation analysis

We then used game theory and computer simulations as a theoretical framework to understanding excessive risk-taking via the price formation in eachof the experiments performed. Having carried outthe trading experiments with human subjects, the outputs from the experiments in terms of a price time series wereused as input to agent-based Monte Carlo (MC) simulations of the $-Game.

The MC simulations were performed with fixed p T and N corresponding to the experiments. The memory length m was selected randomly from 2 to 5. The number of strategies s was selected randomly from 2 to 10, with random initial realization of each of the s strategies. Table 10 shows the parameters used in MC simulations. We used the price data generated from experiment B0404 as input price data, and 100 randomly generated MC realizations were then used to make an average estimate of Figure 11 shows decoupled A  (solid lines) and decoupled A  (dashed lines) over time.

decoupled A  indicates the optimal strategies in the MC simulation decoupled along the direction of the price increase, whereas decoupled A  indicates the optimal strategies against the direction of the price increase. Before the market price in experimentB0404 began to increase rapidly, we observe a split between the decoupled A  strategies and the decoupled A  strategies. Although decoupled A  was not over /2 N , the trend in theprice movement formed when the split became stable. This is one illustration of how speculative behavior can be detected (via the decoupling parameters) before it is seen in the price dynamics.

Figure 12 shows the microscopic MC simulations applied to experiment G0530. Again there appears to be a small but constant split between the decoupled A  strategies and the decoupled A  strategies, which is the signature of a speculative state.

Conclusion

Financial market experimentswere performed usinggroups of either men or women, as well as groups having a different composition of risk profile. The risk profile of participants was obtained from a lottery-choice experiment prior to the financial market experiment. In the financial market experiment, both fundamental value behavior and speculative behavior were observed. The main question we have tried to answer in this paper is this: given the same financial news announcements, how come one observes fundamental value behavior in some experiments, and speculative behavior in others. This study introduced a variant of the$-Game to understand the origins ofexcessive risk-taking as formedin collective decision-making.

Froma macro perspective, the probability of speculative behavior was shownto depend on the market temperatureT , the memory length m , and therisk profile. The probability of creating a speculative state is higherwhen the market temperature is lower. The greaterthe memory length, the smaller the probability of creating a speculative state.From a micro perspective, the trend in theprice movement formed (speculative state) when the split between the decoupled A  strategies and the decoupled A  strategies became stable. This means that the spilt betweenthese strategies can be used to predict the market state before it is observed in the price dynamics.

Figure 2

 2 Figure2illustrates the price dynamics of the $-Game: i) At each time step, the agents update the score of their different strategies according to the payoff function.

Figure 3 .

 3 Figure 3. Illustration of one-time-step decoupling for the strategy shown in Table2 in

  much bigger than the expected return of option B, i.e., choose option A, except for extreme risk seekers, who would choose option B. In contrast, if we focus on the ninth decision, most people would chose option B, except for an extreme risk-averse person, who would choose option A. When the probability of ahigh payoff outcome increases sufficiently, a participant should switch from option A to option B. In the three right-hand columns of Table 5, three different risk profiles are shown. A risk-neutral person would choose A fordecisions 1 to 4 and then switch to B. Notice that even the most risk-averse person should switch to B by decision 10, since option B gives a sureprofit of 15.4 euros.

Figure 4 .Figure 5 .

 45 Figure 4. Probability of choosing option A for each of the ten decisions.

Figure 6 .

 6 Figure 6.Four experiments performed with women.

  Figures 7 a)-d) showthe market prices generated by the 10 groups.The horizontal axis shows the time period and the vertical axis the market price. The solid line shows the experiments with male traders (B0404, B0523, B0530, and B0606) and the solid line with circles the experiments with female traders (G0409, G0523, G0530, and G0606). The dashed line presents the last 2 experiments where an initial group of 20 participants (female and male) wasdivided into two groups according to their risk preference.

Figure 7 a

 7 Figure 7 a) Market prices generated from all 10 experiments.

Figure 7 b

 7 Figure 7 b) Fourexperiments with male traders.

Figure 8 .

 8 Figure 8.An illustration of FWHM, FWHM+, FWHM-.

Figure 9

 9 Figure 9 a) Probability distribution of ΔW for the experiment B0404.

Figure 9 b

 9 Figure 9 b) Probability distribution of ΔW for the experiment G0409

Figure 10

 10 Figure 10 Probability of creating a speculative state as a function of market temperature T for 2,3, 4,6 m  .

Table 1Payoff

 1Payoff in the lottery-choice experiment. For each line,the student chose between Option A and Option B.

	Decision	Option A	Option B
	1	1/10 to gain 8 euros,	1/10 to gain 16.4 Euros,
		and 9/10 to gain 6.4 Euros	and 9/10 to gain 0.4 Euros
	2	2/10 to gain 8 Euros,	2/10 to gain 16.4 Euros,
		and 8/10 to gain 6.4 Euros	and 8/10 to gain 0.4 Euros
	3	3/10 to gain 8 Euros,	3/10 to gain 16.4 Euros,
		and 7/10 to gain 6.4 Euros	and 7/10 to gain 0.4 Euros
	4	4/10 to gain 8 Euros,	4/10 to gain 16.4 Euros,
		and 6/10 to gain 6.4 Euros	and 6/10 to gain 0.4 Euros
	5	5/10 to gain 8 Euros,	5/10 to gain 16.4 Euros,
		and 5/10 to gain 6.4 Euros	and 5/10 to gain 0.4 Euros
	6	6/10 to gain 8 Euros,	6/10 to gain 16.4 Euros,
		and 4/10 to gain 6.4 Euros	and 4/10 to gain 0.4 Euros
	7	7/10 to gain 8 Euros,	7/10 to gain 16.4 Euros,
		and 3/10 to gain 6.4 Euros	and 3/10 togain 0.4 Euros
	8	8/10 to gain 8 Euros,	8/10 to gain 16.4 Euros,
		and 2/10 to gain 6.4 Euros	and 2/10 to gain 0.4 Euros
	9	9/10 to gain 8 Euros,	9/10 to gain 16.4 Euros,
		and 1/10 to gain 6.4 Euros	and 1/10 to gain 0.4 Euros
	10	10/10 to gain 8 Euros,	10/10 to gain 16.4 Euros,
		and 0/10 to gain 6.4 Euros	and 0/10 to gain 0.4 Euros

Table 2 .

 2 Parameters for each experiment.

	Symbol	Description

ep C

Table 5 .

 5 Expected return onten paired lottery-choice decisions and 3 examples of choices for risk-loving, risk-neutral, and risk-averse players.

	Decision	Expected onOption A, e A r	return	Expected onOption B, e B r	return	Difference between e e e d r r  e A r and e B r ,	Risk averse	Risk neutral	Risk loving
						AB
	1	6.56 euro		1.9 Euro		+4.66 Euro	A	A	B
	2	6.72 Euro		3.4 Euro		+3.32 Euro	A	A	B
	3	6.88 Euro		4.9 Euro		+1.98 Euro	A	A	B
	4	7.04 Euro		6.4 Euro		+0.64 Euro	A	A	B
	5	7.20 Euro		7.9 Euro		-0.07 Euro	A	B	B
	6	7.36 Euro		9.4 Euro		-2.04 Euro	A	B	B
	7	7.52 Euro		10.9 Euro		-3.38 Euro	A	B	B
	8	7.68 Euro		12.4 Euro		-4.72 Euro	A	B	B
	9	7.84 Euro		13.9 Euro		-6.06 Euro	A	B	B
	10	8.00 Euro		15.4 Euro		-7.40 Euro	B	B	B

Table 6 .

 6 The median probability of choosing option A for each experiment.

	Gender	Median

Table 7

 7

	). A speculative state is determined by prices exceeding a 200
	percent range with respect tothe fundamental value. A fundamental state is characterized by
	price fluctuations within a 50 percent range of the fundamental value. "Other state" means
	neither speculative nor fundamental.

Table 7 .

 7 Definition of market behavior.

	State	Description
	Speculative state	  2 f pp 
	Fundamental state	0.5	p	ff   1.5 p p   
	Other state	Neither speculative nor fundamental

Table 8 .

 8 Market behavior ineach experiment.

		Gender	State
	B0404	Male	Speculative
	G0409	Female	Speculative
	G0523	Female	Speculative
	B0523	Male	Other
	B0530	Male	Fundamental
	G0530	Female	Fundamental
	G0606	Female	Fundamental
	B0606	Male	Fundamental
	H0616	Mixed	Fundamental
	L0616	Mixed	Fundamental
	Three of the ten experiments created "bubbles", six fluctuated around the fundamental
	value the whole time, and only one belongs neither to the speculative nor to the fundamental
	state. The result of oneexperiment, B0404, was quite particular. It was a "super bull" case

Table 9 .

 9 The FWHM of each experiment

		Gender	FWHM+	FWHM-	FWHM
	B0404	Male	24.8459	-8.0755	32.9214
	G0409	Female	0.2098	-0.9460	1.1558
	G0523	Female	0.1223	-0.2349	0.3572
	B0523	Male	1.6767	-1.4597	3.1364
	B0530	Male	1.9224	-1.8255	3.7479
	G0530	Female	0.1830	-0.2667	0.4497
	G0606	Female	0.5702	-0.9265	1.4967
	B0606	Male	0.5458	-0.3983	0.9441
	H0616	Mixed	0.1967	-0.2398	0.4365
	L0616	Mixed	0.8771	-0.5569	1.4340

  first introduce a "temperature" to analyze the experiments and set up a general theoretical framework giving a broad insight into the experiments. The "temperature"T wasintroduced by Savona, Soumare, and Vitting Andersen (Savona R, Soumare M, and Andersen JV (2015)). It can be related to Ginzburg-Landau theory (GL theory). One of the main implications of the GL theory is the existence of a nontrivial transition from a high "temperature" disordered state in the trading experiments, where traders do not create a trend over time, to a low "temperature" state characterized by trend following. Asin(Savona,

	Soumare, and Vitting-Andersen),we defineT by
	T		21 m Ns  

Acknowledgments

The research leading to these results has received funding from the European Union SeventhFramework Programme (FP7-SSH/2007-2013) under grant agreement no. 320270 SYRTO. This work was carried out in the context ofthe Laboratory of Excellence on Financial Regulation (Labex ReFi) supported by PRESheSam under the reference ANR-10-LABX-0095. It benefitted from French government supportmanaged by the National Research Agency (ANR) as part ofthe project Investissements d'AvenirParis Nouveaux Mondes (invesiments for the future, Paris-New Worlds) under the reference ANR-11-IDEX-0006-02.