Equations for residual sigmas [Two-Stage / GS Designs]
Hi experts,
The short version:
How do you derive equations such as the ones Potvin et al. gave for calculation of the residual variance from a normal linear model?
The long version (you definitely want to skip this):
I would like to go beyond Potvin's designs and explore a bit such as parallel, imbalance and that sorta of stuff. Set up some code in R, but it is very clear that simulating and evaluating a million trials with e.g. N1=30 takes forever on my computer and
1. I am not equipped with great patience
2. I do not have access to super-computers.
A faster way of getting to the residual sigma is necessary.
In my desperation I had a brilliant idea after googling a bit around. The normal linear model is y=Xb+e and the solution for the effects is b=(XtX)-1Xty and the SOS comes out simply through ete with e=Y-Xb. So I hardcoded a light-weight matrix library in C (only needed it to be able to do transpose, subtract, invert, multiply, so there is no need for the heavy stuff like GSL) to do the trick and it works perfectly. But... although it is a bit faster than R, it is just not fast at all and I can't optimise it further. So I am abandoning this idea now. Hence, I am on the prowl for simpler equations for the residual sigma.
Any ideas? Anyone able to tell a person with a walnut-sized brain how the equations from Potvin can be derived and extended to more complex scenarios?
Best regards,
EM.
PS: Any wise guy wanting to tell me I shouldn't find b through inversion but use a QR factorisation in stead?
The short version:
How do you derive equations such as the ones Potvin et al. gave for calculation of the residual variance from a normal linear model?
The long version (you definitely want to skip this):
I would like to go beyond Potvin's designs and explore a bit such as parallel, imbalance and that sorta of stuff. Set up some code in R, but it is very clear that simulating and evaluating a million trials with e.g. N1=30 takes forever on my computer and
1. I am not equipped with great patience
2. I do not have access to super-computers.
A faster way of getting to the residual sigma is necessary.
In my desperation I had a brilliant idea after googling a bit around. The normal linear model is y=Xb+e and the solution for the effects is b=(XtX)-1Xty and the SOS comes out simply through ete with e=Y-Xb. So I hardcoded a light-weight matrix library in C (only needed it to be able to do transpose, subtract, invert, multiply, so there is no need for the heavy stuff like GSL) to do the trick and it works perfectly. But... although it is a bit faster than R, it is just not fast at all and I can't optimise it further. So I am abandoning this idea now. Hence, I am on the prowl for simpler equations for the residual sigma.
Any ideas? Anyone able to tell a person with a walnut-sized brain how the equations from Potvin can be derived and extended to more complex scenarios?
Best regards,
EM.
PS: Any wise guy wanting to tell me I shouldn't find b through inversion but use a QR factorisation in stead?
Complete thread:
- Equations for residual sigmasElMaestro 2011-11-18 08:11
- When it comes to QR factorisation d_labes 2011-11-18 15:44
- Potentially solved it ElMaestro 2011-11-20 18:54
- When it comes to QR factorisation d_labes 2011-11-18 15:44