Dear all, I tried to use nls, but I got the following error Error in numericDeriv(form[[3L]], names(ind), env) : Missing value or an infinity produced when evaluating the model Any suggestion? Thanks, Paola. The code I wrote is Data_pp2_mrna <- data.frame( p1 = protein_1, p6 = protein_6, pp2_mrna = protein_2_mrna, slope_pp2_mrna = stinemanSlopes(times, protein_2_mrna) ) fm_pp2_mrna <- nls(slope_pp2_mrna ~ ( (k1 * v2_Kd *p1^v2_h) / ( (v2_Kd^v2_h) + p1^v2_h ) ) * ( 1/(1 + (p6/v5_Kd)^v5_h) ) - pp2_mrna, data = Data_pp2_mrna, start = list(k1 = 1, v2_Kd = 1, v2_h = 1, v5_Kd = 1, v5_h = 1 )) The data are as follows> Data_pp2_mrnap1 p6 pp2_mrna slope_pp2_mrna 1 1.006 1.234 0.0000000 1.0183976996 2 2.235 0.693 0.5565718 1.2167043185 3 3.744 0.451 1.2300000 1.6962541888 4 4.222 0.441 2.6200000 2.7800000000 5 9.022 0.523 4.0100000 0.1298238635 6 11.326 0.845 3.9179535 -0.2048280861 7 6.899 0.674 3.8050000 -0.4595669210 8 10.709 1.369 3.3860000 -0.8380000000 9 14.084 1.646 2.9670000 -0.5032137310 10 14.922 2.561 2.8220000 -0.2900000000 11 14.340 2.265 2.6770000 -0.3555500152 12 13.066 4.832 2.4634792 -0.4859794757 13 17.553 5.651 2.1880000 -0.7700435122 14 14.803 6.418 1.6045000 -1.1670000000 15 11.945 10.343 1.0210000 -0.3160241819 16 11.427 9.415 1.0435000 0.0450000000 17 11.556 12.610 1.0660000 -0.1700195282 18 20.107 16.171 0.8545000 -0.4230000000 19 15.999 13.189 0.6430000 -0.1721421868 20 16.094 17.022 0.6635000 0.0410000000 21 11.752 14.723 0.6840000 -0.0911220974 22 15.841 15.887 0.5690000 -0.2300000000 23 12.601 15.604 0.4540000 -0.0022539547 24 13.598 18.202 0.5665000 0.2250000000 25 13.879 20.821 0.6790000 -0.0155566571 26 16.270 18.040 0.5490000 -0.2600000000 27 17.176 16.015 0.4190000 -0.1195632728 28 12.332 18.429 0.4250000 0.0120000000 29 12.373 17.723 0.4310000 -0.1118527520 30 14.781 23.100 0.3095000 -0.2430000000 31 17.578 15.396 0.1880000 0.0004440266 32 18.865 21.408 0.3100000 0.2440000000 33 14.735 14.518 0.4320000 0.0473462057 34 16.160 21.351 0.3610000 -0.1420000000 35 13.416 16.689 0.2900000 0.0424156026 36 13.864 17.015 0.4065000 0.2330000000 37 16.219 21.776 0.5230000 0.1567965535 38 13.249 17.371 0.5650035 0.0498847737 39 14.445 19.218 0.5730000 -0.0435396634 40 13.210 21.309 0.5211514 -0.1713939796 41 12.358 24.966 0.4000000 -0.3132118164 -- *Paola Lecca, PhD* *The Microsoft Research - University of Trento* *Centre for Computational and Systems Biology* *Piazza Manci 17 38123 Povo/Trento, Italy* *Phome: +39 0461282843* *Fax: +39 0461282814* [[alternative HTML version deleted]]
Suggestion: read the posting guide and tell us enough information to interpret your problem. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Paola Lecca <pllcc023@gmail.com> wrote: Dear all, I tried to use nls, but I got the following error Error in numericDeriv(form[[3L]], names(ind), env) : Missing value or an infinity produced when evaluating the model Any suggestion? Thanks, Paola. The code I wrote is Data_pp2_mrna <- data.frame( p1 = protein_1, p6 = protein_6, pp2_mrna = protein_2_mrna, slope_pp2_mrna = stinemanSlopes(times, protein_2_mrna) ) fm_pp2_mrna <- nls(slope_pp2_mrna ~ ( (k1 * v2_Kd *p1^v2_h) / ( (v2_Kd^v2_h) + p1^v2_h ) ) * ( 1/(1 + (p6/v5_Kd)^v5_h) ) - pp2_mrna, data = Data_pp2_mrna, start = list(k1 = 1, v2_Kd = 1, v2_h = 1, v5_Kd = 1, v5_h = 1 )) The data are as follows> Data_pp2_mrnap1 p6 pp2_mrna slope_pp2_mrna 1 1.006 1.234 0.0000000 1.0183976996 2 2.235 0.693 0.5565718 1.2167043185 3 3.744 0.451 1.2300000 1.6962541888 4 4.222 0.441 2.6200000 2.7800000000 5 9.022 0.523 4.0100000 0.1298238635 6 11.326 0.845 3.9179535 -0.2048280861 7 6.899 0.674 3.8050000 -0.4595669210 8 10.709 1.369 3.3860000 -0.8380000000 9 14.084 1.646 2.9670000 -0.5032137310 10 14.922 2.561 2.8220000 -0.2900000000 11 14.340 2.265 2.6770000 -0.3555500152 12 13.066 4.832 2.4634792 -0.4859794757 13 17.553 5.651 2.1880000 -0.7700435122 14 14.803 6.418 1.6045000 -1.1670000000 15 11.945 10.343 1.0210000 -0.3160241819 16 11.427 9.415 1.0435000 0.0450000000 17 11.556 12.610 1.0660000 -0.1700195282 18 20.107 16.171 0.8545000 -0.4230000000 19 15.999 13.189 0.6430000 -0.1721421868 20 16.094 17.022 0.6635000 0.0410000000 21 11.752 14.723 0.6840000 -0.0911220974 22 15.841 15.887 0.5690000 -0.2300000000 23 12.601 15.604 0.4540000 -0.0022539547 24 13.598 18.202 0.5665000 0.2250000000 25 13.879 20.821 0.6790000 -0.0155566571 26 16.270 18.040 0.5490000 -0.2600000000 27 17.176 16.015 0.4190000 -0.1195632728 28 12.332 18.429 0.4250000 0.0120000000 29 12.373 17.723 0.4310000 -0.1118527520 30 14.781 23.100 0.3095000 -0.2430000000 31 17.578 15.396 0.1880000 0.0004440266 32 18.865 21.408 0.3100000 0.2440000000 33 14.735 14.518 0.4320000 0.0473462057 34 16.160 21.351 0.3610000 -0.1420000000 35 13.416 16.689 0.2900000 0.0424156026 36 13.864 17.015 0.4065000 0.2330000000 37 16.219 21.776 0.5230000 0.1567965535 38 13.249 17.371 0.5650035 0.0498847737 39 14.445 19.218 0.5730000 -0.0435396634 40 13.210 21.309 0.5211514 -0.1713939796 41 12.358 24.966 0.4000000 -0.3132118164 -- *Paola Lecca, PhD* *The Microsoft Research - University of Trento* *Centre for Computational and Systems Biology* *Piazza Manci 17 38123 Povo/Trento, Italy* *Phome: +39 0461282843* *Fax: +39 0461282814* [[alternative HTML version deleted]] _____________________________________________ 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. [[alternative HTML version deleted]]
Paola, It sounds like one or both of your exponents (v2_h and v5_h) are getting too large. I tried fitting the model without those exponents, then I used the estimates from that simpler model as starting parameters for the full model, and it worked. nov2hv5h <- nls(slope_pp2_mrna ~ ( (k1*v2_Kd*p1) / (v2_Kd + p1) ) * ( 1/(1 + (p6/v5_Kd)) ) - pp2_mrna, data=Data_pp2_mrna, start=list(k1=1, v2_Kd=1, v5_Kd=1)) summary(nov2hv5h) fm_pp2_mrna <- nls(slope_pp2_mrna ~ ( (k1*v2_Kd*p1^v2_h) / (v2_Kd^v2_h + p1^v2_h) ) * ( 1/(1 + (p6/v5_Kd)^v5_h) ) - pp2_mrna, data=Data_pp2_mrna, start=list(k1=3.3, v2_Kd=2.4, v2_h=1, v5_Kd=1.2, v5_h=1)) summary(fm_pp2_mrna) Jean `·.,, ><(((º> `·.,, ><(((º> `·.,, ><(((º> Jean V. Adams Statistician U.S. Geological Survey Great Lakes Science Center 223 East Steinfest Road Antigo, WI 54409 USA From: Paola Lecca <pllcc023@gmail.com> To: r-help@r-project.org Date: 08/05/2011 09:44 AM Subject: [R] problemsn in using nls Sent by: r-help-bounces@r-project.org Dear all, I tried to use nls, but I got the following error Error in numericDeriv(form[[3L]], names(ind), env) : Missing value or an infinity produced when evaluating the model Any suggestion? Thanks, Paola. The code I wrote is Data_pp2_mrna <- data.frame( p1 = protein_1, p6 = protein_6, pp2_mrna = protein_2_mrna, slope_pp2_mrna = stinemanSlopes(times, protein_2_mrna) ) fm_pp2_mrna <- nls(slope_pp2_mrna ~ ( (k1 * v2_Kd *p1^v2_h) / ( (v2_Kd^v2_h) + p1^v2_h ) ) * ( 1/(1 + (p6/v5_Kd)^v5_h) ) - pp2_mrna, data = Data_pp2_mrna, start = list(k1 = 1, v2_Kd = 1, v2_h = 1, v5_Kd = 1, v5_h = 1 )) The data are as follows> Data_pp2_mrnap1 p6 pp2_mrna slope_pp2_mrna 1 1.006 1.234 0.0000000 1.0183976996 2 2.235 0.693 0.5565718 1.2167043185 3 3.744 0.451 1.2300000 1.6962541888 4 4.222 0.441 2.6200000 2.7800000000 5 9.022 0.523 4.0100000 0.1298238635 6 11.326 0.845 3.9179535 -0.2048280861 7 6.899 0.674 3.8050000 -0.4595669210 8 10.709 1.369 3.3860000 -0.8380000000 9 14.084 1.646 2.9670000 -0.5032137310 10 14.922 2.561 2.8220000 -0.2900000000 11 14.340 2.265 2.6770000 -0.3555500152 12 13.066 4.832 2.4634792 -0.4859794757 13 17.553 5.651 2.1880000 -0.7700435122 14 14.803 6.418 1.6045000 -1.1670000000 15 11.945 10.343 1.0210000 -0.3160241819 16 11.427 9.415 1.0435000 0.0450000000 17 11.556 12.610 1.0660000 -0.1700195282 18 20.107 16.171 0.8545000 -0.4230000000 19 15.999 13.189 0.6430000 -0.1721421868 20 16.094 17.022 0.6635000 0.0410000000 21 11.752 14.723 0.6840000 -0.0911220974 22 15.841 15.887 0.5690000 -0.2300000000 23 12.601 15.604 0.4540000 -0.0022539547 24 13.598 18.202 0.5665000 0.2250000000 25 13.879 20.821 0.6790000 -0.0155566571 26 16.270 18.040 0.5490000 -0.2600000000 27 17.176 16.015 0.4190000 -0.1195632728 28 12.332 18.429 0.4250000 0.0120000000 29 12.373 17.723 0.4310000 -0.1118527520 30 14.781 23.100 0.3095000 -0.2430000000 31 17.578 15.396 0.1880000 0.0004440266 32 18.865 21.408 0.3100000 0.2440000000 33 14.735 14.518 0.4320000 0.0473462057 34 16.160 21.351 0.3610000 -0.1420000000 35 13.416 16.689 0.2900000 0.0424156026 36 13.864 17.015 0.4065000 0.2330000000 37 16.219 21.776 0.5230000 0.1567965535 38 13.249 17.371 0.5650035 0.0498847737 39 14.445 19.218 0.5730000 -0.0435396634 40 13.210 21.309 0.5211514 -0.1713939796 41 12.358 24.966 0.4000000 -0.3132118164 -- *Paola Lecca, PhD* *The Microsoft Research - University of Trento* *Centre for Computational and Systems Biology* *Piazza Manci 17 38123 Povo/Trento, Italy* *Phome: +39 0461282843* *Fax: +39 0461282814* [[alternative HTML version deleted]] ______________________________________________ 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. [[alternative HTML version deleted]]