[R] Steepest Ascent Algorithm

2013-03-10 Thread Ricky Corp
I am trying to code a steepest ascent algorithm to optimize parameters used in a survivor function type problem. My unknown parameters (alpha, Beta0, and Beta1) for which I have been able to optimize using Newton's method. I keep getting an error because my alpha becomes negative and I can't calcul

[R] Finding the percentage of points in a designated vector

2012-11-09 Thread Ricky Corp
I am new to R and learned to program 10 years ago in C++. I am currently working a project that looks at the distribution of randomly generated beta values. I take 20 random beta values find their sum, repeat 10 times. Here is my code that it took me 4 hours to get s=numeric(length=10) fo