The Payload for Antimatter Matter Exploration and Light Nuclei Astrophysics (PAMELA) apparatus is in orbit since June 2006 on the Russian satellite Resurs-DK1. One of the main scientific goals of the experiment is the precise
measurement of the positrons energy spectra. Robust particle identification and an accurate background extimation are required. To achieve this goal a new simulation program, which describes the entire PAMELA apparatus, based on GEANT4 was optimized and tested. This simulation is used in a multivariate analysis to extract
the positron signal from a vast background of cosmic-ray protons