Displaying 2 results from an estimated 2 matches for "xminus".
Did you mean:
minus
2004 Jun 23
1
Fitting function with if-clause (nls; e.g. heaviside)
Hallo!
I want to fit a function. The function is e.g.:
y = c+m1*x if x<0, c+m2*x if x>=0
where m1, m2 and c is a parameter and x, y are
variables of a data frame.
I think using nls is appropriate. But I do not know,
how to type this formula in nls. Can anybody help?
(If there is a possibility to use a Heaviside-function
this would be enough.)
Karl
2007 Nov 15
1
Nested SEXP functions
...ts.
Here is what I am essentially trying to accomplish when looking at the
Gaussian kernel:
l(beta) = (y-X*beta)^T V^{-1} (y-X*beta)
Now in order to accomplish this, I wrote various linear algebra
subroutines to handle the R objects, we'll call this:
SEXP XtimesY(SEXP X,SEXP Y); // X*Y
SEXP XminusY(SEXP X,SEXP Y); // X-Y
SEXP tX(SEXP X); // X^T
SEXP mycholinv(SEXP V); // Use cholesky decomposition for inverse
Now, what I'm noticing is that if I call each routine individually
such as:
pt1=XtimesY(X,beta); // X*beta
pt2=Xminus(Y,pt1); // Y-X*beta
pt3=tX(pt2); // (Y-X*beta)^T
pt4=mycholin...