Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

With this post, I want to introduce the new ‘propagate’ package on CRAN.
It has one single purpose: propagation of uncertainties (“error propagation”). There is already one package on CRAN available for this task, named ‘metRology’ (http://cran.r-project.org/web/packages/metRology/index.html).
‘propagate’ has some additional functionality that some may find useful. The most important functions are:

* propagate: A general function for the calculation of uncertainty propagation by first-/second-order Taylor expansion and Monte Carlo simulation including covariances. Input data can be any symbolic/numeric differentiable expression and data based on replicates, summaries (mean & s.d.) or sampled from a distribution. Uncertainty propagation is based completely on matrix calculus accounting for full covariance structure. Monte Carlo simulation is conducted using multivariate normal or t-distributions with covariance structure. The second-order Taylor approximation is the new aspect, because it is not based on the assumption of linearity around $f(x)$ but uses a second-order polynomial to account for nonlinearities, making heavy use of numerical or symbolical Hessian matrices. Interestingly, the second-order approximation gives results quite similar to the MC simulations!
* plot.propagate: Graphing error propagation with the histograms of the MC simulations and MC/Taylor-based confidence intervals.
* predictNLS: The propagate function is used to calculate the propagated error to the fitted values of a nonlinear model of type nls or nlsLM. Please refer to my post here: http://rmazing.wordpress.com/2013/08/26/predictnls-part-2-taylor-approximation-confidence-intervals-for-nls-models/.
* makeGrad, makeHess, numGrad, numHess are functions to create symbolical or numerical gradient and Hessian matrices from an expression containing first/second-order partial derivatives. These can then be evaluated in an environment with evalDerivs.
* fitDistr: This function fits 21 different continuous distributions by (weighted) NLS to the histogram or kernel density of the Monte Carlo simulation results as obtained by propagate or any other vector containing large-scale observations. Finally, the fits are sorted by ascending AIC.
* random samplers for 15 continuous distributions under one hood, some of them previously unavailable:
Skewed-normal distribution, Generalized normal distributionm, Scaled and shifted t-distribution, Gumbel distribution, Johnson SU distribution, Johnson SB distribution, 3P Weibull distribution, 4P Beta distribution, Triangular distribution, Trapezoidal distribution, Curvilinear Trapezoidal distribution, Generalized trapezoidal distribution, Laplacian distribution, Arcsine distribution, von Mises distribution.
Most of them sample from the inverse cumulative distribution function, but 11, 12 and 15 use a vectorized version of “Rejection Sampling” giving roughly 100000 random numbers/s.

An example (without covariance for simplicity): $\mu_a = 5, \sigma_a = 0.1, \mu_b = 10, \sigma_b = 0.1, \mu_x = 1, \sigma_x = 0.1$
$f(x) = a^{bx}$:
 >DAT <- data.frame(a = c(5, 0.1), b = c(10, 0.1), x = c(1, 0.1)) >EXPR <- expression(a^b*x) >res <- propagate(EXPR, DAT) Results from error propagation: Mean.1 Mean.2 sd.1 sd.2 2.5% 97.5% 9765625 10067885 2690477 2739850 4677411 15414333 Results from Monte Carlo simulation: Mean sd Median MAD 2.5% 97.5% 10072640 2826027 9713207 2657217 5635222 16594123 

The plot reveals the resulting distribution obtained from Monte Carlo simulation:
 >plot(res) 

Seems like a skewed distributions. We can now use fitDistr to find out which comes closest:
 > fitDistr(res$resSIM) Fitting Normal distribution...Done. Fitting Skewed-normal distribution...Done. Fitting Generalized normal distribution...Done. Fitting Log-normal distribution...Done. Fitting Scaled/shifted t- distribution...Done. Fitting Logistic distribution...Done. Fitting Uniform distribution...Done. Fitting Triangular distribution...Done. Fitting Trapezoidal distribution...Done. Fitting Curvilinear Trapezoidal distribution...Done. Fitting Generalized Trapezoidal distribution...Done. Fitting Gamma distribution...Done. Fitting Cauchy distribution...Done. Fitting Laplace distribution...Done. Fitting Gumbel distribution...Done. Fitting Johnson SU distribution...........10.........20.........30.........40.........50 .........60.........70.........80.Done. Fitting Johnson SB distribution...........10.........20.........30.........40.........50 .........60.........70.........80.Done. Fitting 3P Weibull distribution...........10.........20.......Done. Fitting 4P Beta distribution...Done. Fitting Arcsine distribution...Done. Fitting von Mises distribution...Done.$aic Distribution AIC 4 Log-normal -4917.823 16 Johnson SU -4861.960 15 Gumbel -4595.917 19 4P Beta -4509.716 12 Gamma -4469.780 9 Trapezoidal -4340.195 1 Normal -4284.706 5 Scaled/shifted t- -4283.070 6 Logistic -4266.171 3 Generalized normal -4264.102 14 Laplace -4144.870 13 Cauchy -4099.405 2 Skewed-normal -4060.936 11 Generalized Trapezoidal -4032.484 10 Curvilinear Trapezoidal -3996.495 8 Triangular -3970.993 7 Uniform -3933.513 20 Arcsine -3793.793 18 3P Weibull -3783.041 21 von Mises -3715.034 17 Johnson SB -3711.034

 Log-normal wins, which makes perfect sense after using an exponentiation function... Have fun with the package. Comments welcome! Cheers, Andrej Filed under: General, R Internals Tagged: confidence interval, first-order, fitting, Monte Carlo, nls, nonlinear, predict, second-order, Taylor approximation var vglnk = {key: '949efb41171ac6ec1bf7f206d57e90b8'}; (function(d, t) { var s = d.createElement(t); s.type = 'text/javascript'; s.async = true; // s.defer = true; // s.src = '//cdn.viglink.com/api/vglnk.js'; s.src = 'https://www.r-bloggers.com/wp-content/uploads/2020/08/vglnk.js'; var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script')); Related ShareTweet To leave a comment for the author, please follow the link and comment on their blog: Rmazing. R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job. Want to share your content on R-bloggers? click here if you have a blog, or here if you don't. 
 
 
 function init() { var vidDefer = document.getElementsByTagName('iframe'); for (var i=0; i<vidDefer.length; i++) { if(vidDefer[i].getAttribute('data-src')) { vidDefer[i].setAttribute('src',vidDefer[i].getAttribute('data-src')); } } } window.onload = init; R bloggers Facebook page Most viewed posts (weekly) R Shiny in Life Sciences – Top 7 Dashboard Examples How I analyze 100+ ggplots at once 5 Ways to Subset a Data Frame in R February 2022: "Top 40" New CRAN Packages R – Sorting a data frame by the contents of a column Calculate Confidence Intervals in R Date Formats in R Sponsors // https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-my-script-s-in-Automatic-Mode- // this must be placed higher. Otherwise it doesn't work. // data-cfasync="false" is for making sure cloudflares' rocketcache doesn't interfeare with this // in this case it only works because it was used at the original script in the text widget function createCookie(name,value,days) { var expires = ""; if (days) { var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + value + expires + "; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } // no longer use async because of google // async async function readTextFile(file) { // Helps people browse between pages without the need to keep downloading the same // ads txt page everytime. This way, it allows them to use their browser's cache. var random_number = readCookie("ad_random_number_cookie"); if(random_number == null) { var random_number = Math.floor(Math.random()*100*(new Date().getTime()/10000000000)); createCookie("ad_random_number_cookie",random_number,1) } file += '?t='+random_number; var rawFile = new XMLHttpRequest(); rawFile.onreadystatechange = function () { if(rawFile.readyState === 4) { if(rawFile.status === 200 || rawFile.status == 0) { // var allText = rawFile.responseText; // document.write(allText); document.write(rawFile.responseText); } } } rawFile.open("GET", file, false); rawFile.send(null); } // readTextFile('https://raw.githubusercontent.com/Raynos/file-store/master/temp.txt'); readTextFile("https://www.r-bloggers.com/wp-content/uploads/text-widget_anti-cache.txt"); Recent Posts New features in R 4.2.0 RStudio Community Monthly Events Roundup – April 2022 New(ish) paper: Share the code, not just the data: A case study of the reproducibility of JML articles published under the open data policy What is a horizon chart? New R package yfR How I analyze 100+ ggplots at once Track Shiny App User Activity With the RStudio Connect Server API COVID-19 Data Hub Paper Published in Nature Scientific Data R Shiny in Life Sciences – Top 7 Dashboard Examples Search through your ecological data with the ‘grep()’ function Using R to detect the pressure wave from the 2022 Hunga Tonga eruption in personal weather station data Recreating the Storytelling with Data look with ggplot How to download Kobotoolbox data in R scikit-learn models in R with reticulate rsnps 0.5.0: New ncbi_snp_query() Features Jobs for R-usersJunior Data Scientist / Quantitative economistSenior Quantitative AnalystR programmerData Scientist – CGIAR Excellence in Agronomy (Ref No: DDG-R4D/DS/1/CG/EA/06/20)Data Analytics Auditor, Future of Audit Lead @ London or Newcastle python-bloggers.com (python/data-science news)How to launch Jupyter notebooks from WindowsPython Exceptions – What, Why, and How?How to Use R and Python Together? Try These 2 PackagesPython List Print – 7 Different Ways to Print a List You Must KnowHow to get the most and least Volatile CryptocurrenciesFiring Up FirestoreHow to Get Cryptocurrency Data from Kraken API in Python Full list of contributing R-bloggers Archives Archives Select Month April 2022  (1) March 2022  (129) February 2022  (157) January 2022  (162) December 2021  (174) November 2021  (145) October 2021  (199) September 2021  (204) August 2021  (153) July 2021  (173) June 2021  (195) May 2021  (197) April 2021  (183) March 2021  (224) February 2021  (227) January 2021  (252) December 2020  (295) November 2020  (267) October 2020  (276) September 2020  (249) August 2020  (227) July 2020  (269) June 2020  (231) May 2020  (334) April 2020  (326) March 2020  (279) February 2020  (259) January 2020  (250) December 2019  (241) November 2019  (214) October 2019  (230) September 2019  (227) August 2019  (270) July 2019  (258) June 2019  (242) May 2019  (272) April 2019  (289) March 2019  (302) February 2019  (259) January 2019  (282) December 2018  (257) November 2018  (285) October 2018  (298) September 2018  (285) August 2018  (266) July 2018  (327) June 2018  (296) May 2018  (315) April 2018  (296) March 2018  (287) February 2018  (239) January 2018  (328) December 2017  (260) November 2017  (265) October 2017  (287) September 2017  (287) August 2017  (328) July 2017  (279) June 2017  (312) May 2017  (341) April 2017  (319) March 2017  (364) February 2017  (312) January 2017  (364) December 2016  (345) November 2016  (288) October 2016  (298) September 2016  (249) August 2016  (280) July 2016  (322) June 2016  (259) May 2016  (288) April 2016  (258) March 2016  (295) February 2016  (261) January 2016  (334) December 2015  (300) November 2015  (234) October 2015  (255) September 2015  (232) August 2015  (261) July 2015  (240) June 2015  (205) May 2015  (228) April 2015  (203) March 2015  (256) February 2015  (207) January 2015  (237) December 2014  (230) November 2014  (219) October 2014  (212) September 2014  (253) August 2014  (214) July 2014  (226) June 2014  (234) May 2014  (238) April 2014  (256) March 2014  (286) February 2014  (266) January 2014  (260) December 2013  (261) November 2013  (237) October 2013  (233) September 2013  (214) August 2013  (223) July 2013  (254) June 2013  (271) May 2013  (260) April 2013  (278) March 2013  (277) February 2013  (293) January 2013  (340) December 2012  (306) November 2012  (274) October 2012  (304) September 2012  (268) August 2012  (262) July 2012  (247) June 2012  (297) May 2012  (283) April 2012  (295) March 2012  (304) February 2012  (264) January 2012  (278) December 2011  (251) November 2011  (261) October 2011  (280) September 2011  (187) August 2011  (258) July 2011  (219) June 2011  (224) May 2011  (239) April 2011  (267) March 2011  (249) February 2011  (203) January 2011  (209) December 2010  (188) November 2010  (172) October 2010  (219) September 2010  (185) August 2010  (203) July 2010  (175) June 2010  (167) May 2010  (164) April 2010  (152) March 2010  (165) February 2010  (135) January 2010  (121) December 2009  (126) November 2009  (66) October 2009  (87) September 2009  (65) August 2009  (56) July 2009  (64) June 2009  (54) May 2009  (35) April 2009  (38) March 2009  (40) February 2009  (33) January 2009  (42) December 2008  (16) November 2008  (14) October 2008  (10) September 2008  (8) August 2008  (11) July 2008  (7) June 2008  (8) May 2008  (8) April 2008  (4) March 2008  (5) February 2008  (6) January 2008  (10) December 2007  (3) November 2007  (5) October 2007  (9) September 2007  (7) August 2007  (21) July 2007  (9) June 2007  (3) May 2007  (3) April 2007  (1) March 2007  (5) February 2007  (4) November 2006  (1) October 2006  (2) August 2006  (3) July 2006  (1) June 2006  (1) May 2006  (3) April 2006  (1) March 2006  (1) February 2006  (5) January 2006  (1) October 2005  (1) September 2005  (3) May 2005  (1) /* <![CDATA[ */ (function() { var dropdown = document.getElementById( "archives-dropdown-3" ); function onSelectChange() { if ( dropdown.options[ dropdown.selectedIndex ].value !== '' ) { document.location.href = this.options[ this.selectedIndex ].value; } } dropdown.onchange = onSelectChange; })(); /* ]]> */ Other sites Jobs for R-users SAS blogs 
 
 Copyright © 2022 | MH Corporate basic by MH Themes 
 View Mobile Site [{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.r-bloggers.com#Organization","name":"R-bloggers","url":"https:\/\/www.r-bloggers.com","sameAs":[],"logo":{"@type":"ImageObject","url":"http:\/\/www.r-bloggers.com\/wp-content\/uploads\/2021\/05\/R_blogger_logo1_large.png","width":"1285","height":"369"},"contactPoint":{"@type":"ContactPoint","contactType":"technical support","telephone":"","url":"https:\/\/www.r-bloggers.com\/contact-us\/"}},{"@type":"WebSite","@id":"https:\/\/www.r-bloggers.com#website","headline":"R-bloggers","name":"R-bloggers","description":"R news and tutorials contributed by hundreds of R bloggers","url":"https:\/\/www.r-bloggers.com","potentialAction":{"@type":"SearchAction","target":"https:\/\/www.r-bloggers.com\/?s={search_term_string}","query-input":"required name=search_term_string"},"publisher":{"@id":"https:\/\/www.r-bloggers.com#Organization"}},{"@context":"https:\/\/schema.org","@type":"WebPage","@id":"https:\/\/www.r-bloggers.com\/2013\/08\/introducing-propagate\/#webpage","name":"Introducing \u2018propagate\u2019","url":"https:\/\/www.r-bloggers.com\/2013\/08\/introducing-propagate\/","lastReviewed":"2013-08-31T14:19:00-06:00","dateCreated":"2013-08-31T14:19:00-06:00","inLanguage":"en-US","description":"With this post, I want to introduce the new &lsquo;propagate&rsquo; package on CRAN. It has one single purpose: propagation of uncertainties (&ldquo;error propagation&rdquo;). There is already one package on CRAN available for this task, named &lsquo;metRology&rsquo; (http:\/\/cran.r-project.org\/web\/packages\/metRology\/index.html). &lsquo;propagate&rsquo; has some additional functionality that some may find useful. The most important functions are: * propagate: A ","reviewedBy":{"@type":"Organization","name":"R-bloggers","url":"https:\/\/www.r-bloggers.com","logo":{"@type":"ImageObject","url":"http:\/\/www.r-bloggers.com\/wp-content\/uploads\/2021\/05\/R_blogger_logo1_large.png","width":"1285","height":"369"}},"primaryImageOfPage":{"@id":"https:\/\/www.r-bloggers.com\/2013\/08\/introducing-propagate\/#primaryimage"},"mainContentOfPage":[[{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Home","url":"https:\/\/www.r-bloggers.com"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"About","url":"http:\/\/www.r-bloggers.com\/about\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"RSS","url":"https:\/\/feeds.feedburner.com\/RBloggers"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"add your blog!","url":"http:\/\/www.r-bloggers.com\/add-your-blog\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Learn R","url":"https:\/\/www.r-bloggers.com\/2015\/12\/how-to-learn-r-2\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"R jobs","url":"https:\/\/www.r-users.com\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Submit a new job (it's free)","url":"https:\/\/www.r-users.com\/submit-job\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Browse latest jobs (also free)","url":"https:\/\/www.r-users.com\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Contact us","url":"http:\/\/www.r-bloggers.com\/contact-us\/"}]],"isPartOf":{"@id":"https:\/\/www.r-bloggers.com#website"},"breadcrumb":{"@id":"https:\/\/www.r-bloggers.com\/2013\/08\/introducing-propagate\/#breadcrumb"}},{"@type":"BreadcrumbList","@id":"https:\/\/www.r-bloggers.com\/2013\/08\/introducing-propagate\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https:\/\/www.r-bloggers.com","name":"R-bloggers"}},{"@type":"ListItem","position":2,"item":{"@id":"https:\/\/www.r-bloggers.com\/category\/r-bloggers\/","name":"R bloggers"}},{"@type":"ListItem","position":3,"item":{"@id":"https:\/\/www.r-bloggers.com\/2013\/08\/introducing-propagate\/","name":"Introducing \u2018propagate\u2019"}}]},{"@type":"Article","@id":"https:\/\/www.r-bloggers.com\/2013\/08\/introducing-propagate\/#Article","url":"https:\/\/www.r-bloggers.com\/2013\/08\/introducing-propagate\/","inLanguage":"en-US","mainEntityOfPage":"https:\/\/www.r-bloggers.com\/2013\/08\/introducing-propagate\/#webpage","headline":"Introducing \u2018propagate\u2019","description":"With this post, I want to introduce the new &lsquo;propagate&rsquo; package on CRAN. It has one single purpose: propagation of uncertainties (&ldquo;error propagation&rdquo;). There is already one package on CRAN available for this task, named &lsquo;metRology&rsquo; (http:\/\/cran.r-project.org\/web\/packages\/metRology\/index.html). &lsquo;propagate&rsquo; has some additional functionality that some may find useful. The most important functions are: * propagate: A ","articleBody":"With this post, I want to introduce the new &#8216;propagate&#8217; package on CRAN. It has one single purpose: propagation of uncertainties (&#8220;error propagation&#8221;). There is already one package on CRAN available for this task, named &#8216;metRology&#8217; (http:\/\/cran.r-project.org\/web\/packages\/metRology\/index.html). &#8216;propagate&#8217; has some additional functionality that some may find useful. The most important functions are: * propagate: A general function for the calculation of uncertainty propagation by first-\/second-order Taylor expansion and Monte Carlo simulation including covariances. Input data can be any symbolic\/numeric differentiable expression and data based on replicates, summaries (mean &amp; s.d.) or sampled from a distribution. Uncertainty propagation is based completely on matrix calculus accounting for full covariance structure. Monte Carlo simulation is conducted using multivariate normal or t-distributions with covariance structure. The second-order Taylor approximation is the new aspect, because it is not based on the assumption of linearity around but uses a second-order polynomial to account for nonlinearities, making heavy use of numerical or symbolical Hessian matrices. Interestingly, the second-order approximation gives results quite similar to the MC simulations! * plot.propagate: Graphing error propagation with the histograms of the MC simulations and MC\/Taylor-based confidence intervals. * predictNLS: The propagate function is used to calculate the propagated error to the fitted values of a nonlinear model of type nls or nlsLM. Please refer to my post here: http:\/\/rmazing.wordpress.com\/2013\/08\/26\/predictnls-part-2-taylor-approximation-confidence-intervals-for-nls-models\/. * makeGrad, makeHess, numGrad, numHess are functions to create symbolical or numerical gradient and Hessian matrices from an expression containing first\/second-order partial derivatives. These can then be evaluated in an environment with evalDerivs. * fitDistr: This function fits 21 different continuous distributions by (weighted) NLS to the histogram or kernel density of the Monte Carlo simulation results as obtained by propagate or any other vector containing large-scale observations. Finally, the fits are sorted by ascending AIC. * random samplers for 15 continuous distributions under one hood, some of them previously unavailable: Skewed-normal distribution, Generalized normal distributionm, Scaled and shifted t-distribution, Gumbel distribution, Johnson SU distribution, Johnson SB distribution, 3P Weibull distribution, 4P Beta distribution, Triangular distribution, Trapezoidal distribution, Curvilinear Trapezoidal distribution, Generalized trapezoidal distribution, Laplacian distribution, Arcsine distribution, von Mises distribution. Most of them sample from the inverse cumulative distribution function, but 11, 12 and 15 use a vectorized version of &#8220;Rejection Sampling&#8221; giving roughly 100000 random numbers\/s. An example (without covariance for simplicity): : &gt;DAT &lt;- data.frame(a c(5, 0.1), b c(10, 0.1), x c(1, 0.1)) &gt;EXPR &lt;- expression(a^b*x) &gt;res &lt;- propagate(EXPR, DAT) Results from error propagation: Mean.1 Mean.2 sd.1 sd.2 2.5% 97.5% 9765625 10067885 2690477 2739850 4677411 15414333 Results from Monte Carlo simulation: Mean sd Median MAD 2.5% 97.5% 10072640 2826027 9713207 2657217 5635222 16594123 The plot reveals the resulting distribution obtained from Monte Carlo simulation: &gt;plot(res) Seems like a skewed distributions. We can now use fitDistr to find out which comes closest: &gt; fitDistr(res$resSIM) Fitting Normal distribution...Done. Fitting Skewed-normal distribution...Done. Fitting Generalized normal distribution...Done. Fitting Log-normal distribution...Done. Fitting Scaled\/shifted t- distribution...Done. Fitting Logistic distribution...Done. Fitting Uniform distribution...Done. Fitting Triangular distribution...Done. Fitting Trapezoidal distribution...Done. Fitting Curvilinear Trapezoidal distribution...Done. Fitting Generalized Trapezoidal distribution...Done. Fitting Gamma distribution...Done. Fitting Cauchy distribution...Done. Fitting Laplace distribution...Done. Fitting Gumbel distribution...Done. Fitting Johnson SU distribution...........10.........20.........30.........40.........50 .........60.........70.........80.Done. Fitting Johnson SB distribution...........10.........20.........30.........40.........50 .........60.........70.........80.Done. Fitting 3P Weibull distribution...........10.........20.......Done. Fitting 4P Beta distribution...Done. Fitting Arcsine distribution...Done. Fitting von Mises distribution...Done.$aic Distribution AIC 4 Log-normal -4917.823 16 Johnson SU -4861.960 15 Gumbel -4595.917 19 4P Beta -4509.716 12 Gamma -4469.780 9 Trapezoidal -4340.195 1 Normal -4284.706 5 Scaled\/shifted t- -4283.070 6 Logistic -4266.171 3 Generalized normal -4264.102 14 Laplace -4144.870 13 Cauchy -4099.405 2 Skewed-normal -4060.936 11 Generalized Trapezoidal -4032.484 10 Curvilinear Trapezoidal -3996.495 8 Triangular -3970.993 7 Uniform -3933.513 20 Arcsine -3793.793 18 3P Weibull -3783.041 21 von Mises -3715.034 17 Johnson SB -3711.034 Log-normal wins, which makes perfect sense after using an exponentiation function... Have fun with the package. Comments welcome! Cheers, Andrej Filed under: General, R Internals Tagged: confidence interval, first-order, fitting, Monte Carlo, nls, nonlinear, predict, second-order, Taylor approximation","keywords":"","datePublished":"2013-08-31T14:19:00-06:00","dateModified":"2013-08-31T14:19:00-06:00","author":{"@type":"Person","name":"anspiess","description":"","url":"https:\/\/www.r-bloggers.com\/author\/anspiess\/","sameAs":["http:\/\/rmazing.wordpress.com"],"image":{"@type":"ImageObject","url":"https:\/\/secure.gravatar.com\/avatar\/0fff5d2ff29de48af18dda596704ac92?s=96&d=mm&r=g","height":96,"width":96}},"editor":{"@type":"Person","name":"anspiess","description":"","url":"https:\/\/www.r-bloggers.com\/author\/anspiess\/","sameAs":["http:\/\/rmazing.wordpress.com"],"image":{"@type":"ImageObject","url":"https:\/\/secure.gravatar.com\/avatar\/0fff5d2ff29de48af18dda596704ac92?s=96&d=mm&r=g","height":96,"width":96}},"publisher":{"@id":"https:\/\/www.r-bloggers.com#Organization"},"image":[{"@type":"ImageObject","url":"http:\/\/rmazing.files.wordpress.com\/2013\/08\/propagate.jpeg?w=300&#038;h=247","width":300,"height":247,"@id":"https:\/\/www.r-bloggers.com\/2013\/08\/introducing-propagate\/#primaryimage"},{"@type":"ImageObject","url":"https:\/\/feeds.wordpress.com\/1.0\/comments\/rmazing.wordpress.com\/407\/","width":0,"height":0},{"@type":"ImageObject","url":"http:\/\/stats.wordpress.com\/b.gif?host=rmazing.wordpress.com&#038;blog=37379885&#038;%23038;post=407&#038;%23038;subd=rmazing&#038;%23038;ref=&#038;%23038;feed=1","width":1,"height":1}],"isPartOf":{"@id":"https:\/\/www.r-bloggers.com\/2013\/08\/introducing-propagate\/#webpage"}}]}] var snp_f = []; var snp_hostname = new RegExp(location.host); var snp_http = new RegExp("^(http|https)://", "i"); var snp_cookie_prefix = ''; var snp_separate_cookies = false; var snp_ajax_url = 'https://www.r-bloggers.com/wp-admin/admin-ajax.php'; var snp_ajax_nonce = '0baefc4f8a'; var snp_ignore_cookies = false; var snp_enable_analytics_events = true; var snp_enable_mobile = false; var snp_use_in_all = false; var snp_excluded_urls = []; Never miss an update! Subscribe to R-bloggers to receive e-mails with the latest R posts. (You will not see this message again.) Click here to close (This popup will not appear again) .snp-pop-109583 .snp-theme6 { max-width: 700px;} .snp-pop-109583 .snp-theme6 h1 {font-size: 17px;} .snp-pop-109583 .snp-theme6 { color: #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field ::-webkit-input-placeholder { color: #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field :-moz-placeholder { color: #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field :-ms-input-placeholder { color: #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field input { border: 1px solid #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field { color: #000000;} .snp-pop-109583 .snp-theme6 { background: #f2f2f2;} jQuery(document).ready(function() { }); var CaptchaCallback = function() { jQuery('.g-recaptcha').each(function(index, el) { grecaptcha.render(el, { 'sitekey' : '' }); }); }; /* <![CDATA[ */!function(e,n){var r={"selectors":{"block":"pre","inline":"code"},"options":{"indent":4,"ampersandCleanup":true,"linehover":true,"rawcodeDbclick":false,"textOverflow":"scroll","linenumbers":false,"theme":"enlighter","language":"r","retainCssClasses":false,"collapse":false,"toolbarOuter":"","toolbarTop":"{BTN_RAW}{BTN_COPY}{BTN_WINDOW}{BTN_WEBSITE}","toolbarBottom":""},"resources":["https:\/\/www.r-bloggers.com\/wp-content\/plugins\/enlighter\/cache\/enlighterjs.min.css?4WJrVky+dDEQ83W","https:\/\/www.r-bloggers.com\/wp-content\/plugins\/enlighter\/resources\/enlighterjs\/enlighterjs.min.js"]},o=document.getElementsByTagName("head")[0],t=n&&(n.error||n.log)||function(){};e.EnlighterJSINIT=function(){!function(e,n){var r=0,l=null;function c(o){l=o,++r==e.length&&(!0,n(l))}e.forEach(function(e){switch(e.match(/\.([a-z]+)(?:[#?].*)?$/)[1]){case"js":var n=document.createElement("script");n.onload=function(){c(null)},n.onerror=c,n.src=e,n.async=!0,o.appendChild(n);break;case"css":var r=document.createElement("link");r.onload=function(){c(null)},r.onerror=c,r.rel="stylesheet",r.type="text/css",r.href=e,r.media="all",o.appendChild(r);break;default:t("Error: invalid file extension",e)}})}(r.resources,function(e){e?t("Error: failed to dynamically load EnlighterJS resources!",e):"undefined"!=typeof EnlighterJS?EnlighterJS.init(r.selectors.block,r.selectors.inline,r.options):t("Error: EnlighterJS resources not loaded yet!")})},(document.querySelector(r.selectors.block)||document.querySelector(r.selectors.inline))&&e.EnlighterJSINIT()}(window,console); /* ]]> */ window.FPConfig= { delay: 0, ignoreKeywords: ["\/wp-admin","\/wp-login.php","\/cart","add-to-cart","logout","#","?",".png",".jpeg",".jpg",".gif",".svg"], maxRPS: 3, hoverDelay: 50 }; _stq = window._stq || []; _stq.push([ 'view', {v:'ext',j:'1:7.3.3',blog:'11524731',post:'73983',tz:'-6',srv:'www.r-bloggers.com'} ]); _stq.push([ 'clickTrackerInit', '11524731', '73983' ]); jQuery(document).ready(function ($) { for (let i = 0; i < document.forms.length; ++i) { let form = document.forms[i]; if ($(form).attr("method") != "get") {$(form).append('<input type="hidden" name="bIDiEKaSr" value="[NwX]avgpyM" />'); } if ($(form).attr("method") != "get") {$(form).append('<input type="hidden" name="JtlBfjh" value="JlitU.M3" />'); } if ($(form).attr("method") != "get") {$(form).append('<input type="hidden" name="BNXYvMTtg" value="m6Py@WO3Y0u" />'); } } $(document).on('submit', 'form', function () { if ($(this).attr("method") != "get") { $(this).append('<input type="hidden" name="bIDiEKaSr" value="[NwX]avgpyM" />'); } if ($(this).attr("method") != "get") { $(this).append('<input type="hidden" name="JtlBfjh" value="JlitU.M3" />'); } if ($(this).attr("method") != "get") { \$(this).append('<input type="hidden" name="BNXYvMTtg" value="m6Py@WO3Y0u" />'); } return true; }); jQuery.ajaxSetup({ beforeSend: function (e, data) { if (data.type !== 'POST') return; if (typeof data.data === 'object' && data.data !== null) { data.data.append("bIDiEKaSr", "[NwX]avgpyM"); data.data.append("JtlBfjh", "JlitU.M3"); data.data.append("BNXYvMTtg", "m6Py@WO3Y0u"); } else { data.data = data.data + '&bIDiEKaSr=[NwX]avgpyM&JtlBfjh=JlitU.M3&BNXYvMTtg=m6Py@WO3Y0u'; } } }); });