I have a situation in which I have to give a formula as input to the nls()
function.
I have data which is between time and variance. For example:
Time Variance
1 0.15
2 0.23
3 0.67
4 0.85
Now I am using the formula Vt = ((1-e^kt)/kt)) (q^2)/2k, where Vt is the variance at time t. I have the two variables (k,q) in the above equation. I have to determine k(hat) and q(hat). Can I define the above formula as a user-defined formula and give it as an argument to the nls()
function?