Blog Archives

Error propagation based on interval arithmetics

September 27, 2014
By
Error propagation based on interval arithmetics

I added an interval function to my ‘propagate’ package (now on CRAN) that conducts error propagation based on interval arithmetics. It calculates the uncertainty of a model by using interval arithmetics based on (what I call) a “combinatorial sequence grid evaluation” approach, thereby avoiding the classical dependency problem that often inflates the result interval. This

Read more »

I’ll take my NLS with weights, please…

January 13, 2014
By
I’ll take my NLS with weights, please…

Today I want to advocate weighted nonlinear regression. Why so? Minimum-variance estimation of the adjustable parameters in linear and non-linear least squares requires that the data be weighted inversely as their variances . Only then is the BLUE (Best Linear Unbiased Estimator) for linear regression and nonlinear regression with small errors (http://en.wikipedia.org/wiki/Weighted_least_squares#Weighted_least_squares), an important fact

Read more »

Introducing ‘propagate’

August 31, 2013
By
Introducing ‘propagate’

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

Read more »

predictNLS (Part 2, Taylor approximation): confidence intervals for ‘nls’ models

August 26, 2013
By
predictNLS (Part 2, Taylor approximation): confidence intervals for ‘nls’ models

Initial Remark: Reload this page if formulas don’t display well! As promised, here is the second part on how to obtain confidence intervals for fitted values obtained from nonlinear regression via nls or nlsLM (package ‘minpack.lm’). I covered a Monte Carlo approach in http://rmazing.wordpress.com/2013/08/14/predictnls-part-1-monte-carlo-simulation-confidence-intervals-for-nls-models/, but here we will take a different approach: First- and second-order

Read more »

predictNLS (Part 1, Monte Carlo simulation): confidence intervals for ‘nls’ models

August 14, 2013
By
predictNLS (Part 1, Monte Carlo simulation): confidence intervals for ‘nls’ models

Those that do a lot of nonlinear fitting with the nls function may have noticed that predict.nls does not have a way to calculate a confidence interval for the fitted value. Using confint you can obtain the error of the fit parameters, but how about the error in fitted values? ?predict.nls says: “At present se.fit

Read more »

Trivial, but useful: sequences with defined mean/s.d.

July 31, 2013
By
Trivial, but useful: sequences with defined mean/s.d.

O.k., the following post may be (mathematically) trivial, but could be somewhat useful for people that do simulations/testing of statistical methods. Let’s say we want to test the dependence of p-values derived from a t-test to a) the ratio of means between two groups, b) the standard deviation or c) the sample size(s) of the

Read more »

wapply: A faster (but less functional) ‘rollapply’ for vector setups

April 23, 2013
By
wapply: A faster (but less functional) ‘rollapply’ for vector setups

For some cryptic reason I needed a function that calculates function values on sliding windows of a vector. Googling around soon brought me to ‘rollapply’, which when I tested it seems to be a very versatile function. However, I wanted to code my own version just for vector purposes in the hope that it may

Read more »

bigcor: Large correlation matrices in R

February 22, 2013
By
bigcor: Large correlation matrices in R

As I am working with large gene expression matrices (microarray data) in my job, it is sometimes important to look at the correlation in gene expression of different genes. It has been shown that by calculating the Pearson correlation between genes, one can identify (by high values, i.e. > 0.9) genes that share a common

Read more »

The magic empty bracket

January 30, 2013
By
The magic empty bracket

I have been working with R for some time now, but once in a while, basic functions catch my eye that I was not aware of… For some project I wanted to transform a correlation matrix into a covariance matrix. Now, since cor2cov does not exist, I thought about “reversing” the cov2cor function (stats:::cov2cor). Inside

Read more »

Peer-reviewed R packages?

November 22, 2012
By
Peer-reviewed R packages?

Dear R-Users, a question: I am the author of the ‘qpcR’ package. Within this, there is a function ‘propagate’ that does error propagation based on Monte Carlo Simulation, permutation-based confidence intervals and Taylor expansion. For the latter I recently implemented a second-order Taylor expansion term that can correct for nonlinearity. The formulas are quite complex

Read more »