The nls() function has a well documented (and discussed) different behavior compared to the lm()’s. Specifically you can’t just put an indexed column from a data frame as an input or output of the model. > nls(data[,2] ~ c + expFct(data[,4],beta), data = time.data, + start = start.list) Error in parse(text = x) : unexpected [...]
A quicky..
by M. Parzakonis on February 23, 2010
If you’re (and you should) interested in principal components then take a good look at this. The linked post will take you by hand to do everything from scratch. If you’re not in the mood then the dollowing R functions will help you. An example. # Generates sample matrix of five discrete clusters that have [...]
The truncated Poisson
by M. Parzakonis on February 22, 2010
A common model for counts data is the Poisson. There are cases however that we only record positive counts, ie there is a truncation of 0. This is the truncated Poisson model. To study this model we only need the total counts and the sample size. This comes from the sufficient statistic principle as the [...]
Uh!
by M. Parzakonis on February 21, 2010
Didn’t know this…
a data
0 2 4 7+
25 34 12 5
It’s becoming clear that I have learned R in the most unstructured way…I always do it in two stages :ashamed:
lme4 stands 4 Linear mixed-effects…
by M. Parzakonis on February 20, 2010
There is a certain hype about mixed (and random) effects among statistician and analysts. You can show some love to Douglas Bates and Martin Maechler for maintaing the lme4 package for our cupid, R I copy the entity of the information of the projects page. Doxygen documentation of the underlying C functions is here. The [...]
May the rule be with you ;)
by M. Parzakonis on January 25, 2010
Actuaries are not famous for their sense of humour. Sometimes, they exhibit a remarkable sense of it though! A second year undergrad student is familiar with the following formula, $$ EX=\int_{0}^{\infty }{\left( 1-F(x) \right)dx},$$ where X is a random variable satisfying $$ X\ge 0$$ with probability 1. Most call $$ 1-F(x)\,$$ the right tail and [...]
[Paul E Pfeiffer] Applied Probability
by M. Parzakonis on January 18, 2010
I must admit that I have a pretty complete electronic library from the giant publishing acts. Yet, from time to time, course notes are better to skim through as they tenf to get more practical (or cookbok if you want to!). The trend nowasays is to supplement everything with code or software packages. this is [...]
Damn those businesses!
by M. Parzakonis on December 27, 2009
So many times you’ve in a situation where Excel is your god-sent tool. Yeap, I’m talking about statistics & excel, the 8th sin! I found myself tutoring a couple of days ago and I found myself stuck with Excel. How to perform a stepwise procedure overcoming the burden of VB (which I know nothing about [...]
Web analytics revisited : The Mathematica way!
by M. Parzakonis on December 12, 2009
I found out something really interesting. Men do it with keyboards (not clicks!) and so does Patrick Collison using Mathematica to analyse web data he got from Google Analytics. See : Hacking for fun and profit with Mathematica and the Google Analytics API [link]
R> if (done=TRUE) tweet me!
by M. Parzakonis on December 11, 2009
Let’s say that you’re fitting a cumbersome model so time is not to waste over a PC staring at the screen half anxious-half bored… Then, you can always leave and go on with meetings and all your daily routine and have R notify you the results! How? We will illustrate the situation above using some [...]
LinkedIn
Facebook
Youtube
Twitter