Le 16/11/12 11:49, Meli Massimiliano a écrit :
Hello All,

i would fit my data with a function like this :

y = a0 + a1 * exp(-x/a2) + a3 * exp(-x/a4) + a5 * exp(-x/a6) + a7 * exp(-x/a8) + a9 * exp(-x/a10)

plus i have to impose that

a1 + a3 + a5 + a7 + a9 = 1

a1 , a3 , a5 , a7 , a9 >= 0

Then I conclude that 0<=a1, a3, a5, a7, a9<=1 and a1 + a3 + a5 + a7 + a9 = 1.

To ensure that a1 + a3 + a5 + a7 + a9 = 1, your need to fit a1, a3, a5 and a7 but for a9, just impose a9=1-(a1+ a3+ a5+ a7).

To ensure 0<=a1 <=1, it is simpler to fit b1 as a real and to use it as
a1=1/(1+exp(b1))

Then a1 will be always as 0<=a1 <=1
(to be exact, it is 0<a1 <1 rather. Often it is sufficient)

Hope it help

--
__________________________________________________________
Marc Girondot, Pr

Laboratoire Ecologie, Systématique et Evolution
Equipe de Conservation des Populations et des Communautés
CNRS, AgroParisTech et Université Paris-Sud 11 , UMR 8079
Bâtiment 362
91405 Orsay Cedex, France

Tel:  33 1 (0)1.69.15.72.30   Fax: 33 1 (0)1.69.15.73.53
e-mail: marc.giron...@u-psud.fr
Web: http://www.ese.u-psud.fr/epc/conservation/Marc.html
Skype: girondot

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
  • [R] fitting Meli Massimiliano
    • Re: [R] fitting Marc Girondot

Reply via email to