search for: varbeta

Displaying 2 results from an estimated 2 matches for "varbeta".

2003 Mar 17
1
Using .Call function to do matrix calculation
...matrix a(J*K) and b(K*J)), where J is too big to allocate enough memory for it. In order to get those diagonals, I tried .Call function to do that. Here is c program for .Call. #include <R.h> #include <Rinternals.h> SEXP var(SEXP a,SEXP b){ int i,J=nrows(a),j,K=nrows(b),k; SEXP varbeta; PROTECT(varbeta=allocVector(REALSXP,J)); for(j=0;j<J;j++){ for(k=0;k<J;k++){ if(j==k){ for(i=0;i<K;i++) REAL(varbeta)[j]+=REAL(a)[j+i*J]*REAL(b)[i+k*K];} } } UNPROTECT(1); return (varbeta); } This function did not work at all. The warning messages is the segmen...
2006 Apr 08
1
add lines to a plot with a loop without erase the last one
.... Here my program: alpha<-5 beta<-10 var<-0.5 s<-runif(1000,0,50) m<-length(s) variancealpha<-0.002 variancebeta<-0.051 variancevar<-0.001 alphachap<-vector() betachap<-vector() varchap<-vector() epsilon<-vector() b<-vector() u<-vector() varbeta<-vector() varalpha<-vector() biaisbeta<-vector() biaisalpha<-vector() biaisvar<-vector() data<-matrix(99,length(s),n) # III) Je g?n?re les erreurs suivant une loi normale centr?e sur 0 et de variance sigma? d?j? fix?e. d<-c(5,10,20,100,200,400,450,500,800) for (k in 1...