search for: bmat

Displaying 18 results from an estimated 18 matches for "bmat".

Did you mean: bat
2017 Dec 29
3
winbuilder warning message wrt function pointers
...s internal routines from the bdsmatrix package.? (It is in fact mentioned as an example of this in the Extensions manual.) The call connections are a blocks like this, one for each of the 9 called C routines. void bdsmatrix_prod4(int nrow,??? int nblock,?? int *bsize, ??????????????????? double *bmat, double *rmat, ??????????????????? int nfrail,?? double *y) { ??? static void (*fun)() = NULL; ??? if (fun==NULL) ??? fun = (void (*)) R_GetCCallable("bdsmatrix", "bdsmatrix_prod4"); ??? fun(nrow, nblock, bsize, bmat, rmat, nfrail, y); ??? } .. The winbuilder run is flag...
2017 Dec 29
1
winbuilder warning message wrt function pointers
And remove the cast on the return value of R_GETCCallable. And check that your function is found before using it. #include <R.h> #include <Rinternals.h> #include <R_ext/Rdynload.h> void bdsmatrix_prod4(int nrow, int nblock, int *bsize, double *bmat, double *rmat, int nfrail, double *y) { DL_FUNC fun = NULL; if (fun==NULL) { fun = R_GetCCallable("bdsmatrix", "bdsmatrix_prod4"); } if (fun==NULL) { Rf_error("Cannot find C function 'bdsmatrix_prod4' in library...
2008 Aug 05
1
Fix for nls bug???
...elfStart function with an 'initial' attribute, but that doesn't change things. Myfunc<-function(x, aMat, Coeffs) { # # result = quadratic response in x with # terms selected by aMat # aMat[aMat!=0] <- Coeffs rowSums((x%*%aMat)%*%t(x)) } If aMat is passed in by name (e.g. aMat = bMat) nls fails. e.g. # # data frame with some noise DF <- data.frame(x1 = runif(20, 1, 20), x2=runif(20, 1, 20)) DF$y <- 1 +DF$x1 +DF$x2 +DF$x1*DF$x2 +DF$x1^2 + DF$x2^2 + rnorm(20) # # matrix to pass in as aMat bMat <- matrix(c(1,1,0,0), 2, 2) # # and nls fails nls(y ~ Myfunc(cbind(x1, x2), bM...
2008 Jul 29
1
tensor product of equi-spaced B-splines in the unit square
...n(x) t(bspline(x[1]))%*%bspline(x[2]) # numebr of points to plot ng = 51 # create vectors for plotting xgr = seq(-1,1,length=ng) xgr2 = expand.grid(xgr,xgr) # generate random coef. of linear combination bet = rnorm(M) # create matrix for contour-type plot Bx = apply(xgr2,1,btens) Bmat = matrix(t(Bx)%*%bet,ng) # plot the result contour(xgr,xgr,Bmat) persp(xgr,xgr,Bmat,theta=15) any of you have a better idea (ie more efficient)? Thanks in advance, Patrizio Frederic +------------------------------------------------- | Patrizio Frederic | Research associate in Statistics, | De...
2007 Jun 23
1
Creating different matrices in a loop
Hello, I have a big matrix of size (20,5) -bmat . I have to loop though the rows in the matrix and create DIFFERENT matrices each time I go through the loop. counts=c(4,6,10); p=1; for (i in 1:length(counts)) { smat=bmat[p:p+i-1,]; p=p+i; } The problem is smat overwrites itself each time inside the loop. I would like to have smat1, s...
2009 Mar 05
3
methods package
...more there, but can't find it. Perchance there is something obvious that I am missing? 2. The changes are small but numerous. The current one that has me puzzled is a method for addition: setMethod(Ops, signature=c('numeric', 'bdsmatrix'), .... Let xmat be ordinary and bmat be a bdsmatrix. In the old code "xmat + bmat" fell to this method (which knows what to do), in the current R I get failure due to no method found. is.numeric(xmat) is TRUE. What is the fix? 3. In the green book the examples used .Dim and .Dimnames slots, the Matrix library uses Dim...
2017 Dec 29
0
winbuilder warning message wrt function pointers
...eturn value of R_GETCCallable. And check > that your function is found before using it. > > #include <R.h> > #include <Rinternals.h> > #include <R_ext/Rdynload.h> > > void bdsmatrix_prod4(int nrow, int nblock, int *bsize, > double *bmat, double *rmat, > int nfrail, double *y) { > DL_FUNC fun = NULL; > if (fun==NULL) { > fun = R_GetCCallable("bdsmatrix", "bdsmatrix_prod4"); > } > if (fun==NULL) { > Rf_error("Cannot find C function ...
2012 Jul 12
1
SVAR Restriction on AB-model
Hello! I'm doing a svar and when I make the estimation the next error message appears: In SVAR(x, Amat = amat, Bmat = bmat, start = NULL, max.iter = 1000, : The AB-model is just identified. No test possible. Could you help me to interpret it please. Also I have the identification assumption that one of my shocks is exogenous relative to the contemporaneous values of the other variables in the SVAR, could yo...
2012 Oct 19
1
Optimization in R similar to MS Excel Solver
Dear Colleagues, I am attempting to develop an optimization routine for a river suspended sediment mixing model. I have Calcium and Magnesium concentrations (%) for sediments from 4 potential source areas (Topsoil, Channel Banks, Roads, Drains) and I want to work out, based on the suspended sediment calcium and magnesium concentrations, what are the optimal contributions from each source area to
2017 Dec 29
0
winbuilder warning message wrt function pointers
...e bdsmatrix package. (It is in fact mentioned as an example of this > in the Extensions manual.) > The call connections are a blocks like this, one for each of the 9 called > C routines. > > void bdsmatrix_prod4(int nrow, int nblock, int *bsize, > double *bmat, double *rmat, > int nfrail, double *y) { > static void (*fun)() = NULL; > if (fun==NULL) > fun = (void (*)) R_GetCCallable("bdsmatrix", "bdsmatrix_prod4"); > fun(nrow, nblock, bsize, bmat, rmat, nfrail, y); > } > &g...
2009 Oct 12
1
Help Error
...ram even though there is an error comment? var=VAR(Canada,p=3,type="const") for (j in 1:nrow(com)) { mat=ma { for (i in 1:ncol(com)) { y=which(mat==com[j,i]) mat[y]=NA } z=which(mat!=0) mat[z]=0 hitt=SVAR(var , estmethod = "scoring", Amat = mat, Bmat = NULL,max.iter = 100, maxls = 1000, conv.crit = 1.0e-8) hit[j]=hitt$LR$statistic } } There will be an error comment,e.g. : Error in solve.default(BinvA) : Lapack routine dgesv: system is exactly singular" But I still want to continue to compute the SVAR.. How can I do it? Thank...
2003 Mar 18
1
Getting Compile errors
...unning Samba would be unsafe configure: error: summary failure. Aborting config The server is currently running Mandrake 7.2 with 2.4.17 kernel. Any suggestions? Thanks -- Bob Matckie Computer Support Specialist College of Design Construction and Planning University of Florida 392-4836 ext 317 bmat@dcp.ufl.edu
2012 Apr 23
0
Solve an ordinary or generalized eigenvalue problem in R
...py/reference/linalg.html >> > >> > Some of these are already implemented, but clearly not all of them. > Package CCA has package fda as dependency. > And package fda defines a function geigen. > The first 14 lines of this function are > > geigen<- function(Amat, Bmat, Cmat) > { > # solve the generalized eigenanalysis problem > # > # max {tr L'AM / sqrt[tr L'BL tr M'CM] w.r.t. L and M > # > # Arguments: > # AMAT ... p by q matrix > # BMAT ... order p symmetric positive definite matrix > # CMA...
2011 Jun 26
2
Ordering a matrix based on cluster no
Hi All I have a symmetric matrix of genes ( 100x100 matrix). I also have a matrix (100x2) of two columns where column 1 has the gene names and column 2 has the cluster it belongs to (they are sorted and grouped based on the cluster no). I would like to order the rows and columns of the 100x 100 matrix such that the first n genes correspond to cluster 1 and next n genes correspond to cluster 2
2003 Mar 18
1
compile errors
...unning Samba would be unsafe configure: error: summary failure. Aborting config The server is currently running Mandrake 7.2 with 2.4.17 kernel. Any suggestions? Thanks -- Bob Matckie Computer Support Specialist College of Design Construction and Planning University of Florida 392-4836 ext 317 bmat@dcp.ufl.edu
2014 Jun 19
1
Restrict a SVAR A-Model on Matrix A and Variance-Covariance-Matrix
...x within R and {vars}. My Code so far is: # Prediction SVAR - A-Model (B-Matrix = NULL) # restrictions: # 1) Amat = A_Matrix # 2) ???? VAR.est <- VAR(data.ts, p = 4, type = "none") SVAR.A.est <- SVAR(x=VAR.est, estmethod = "direct", Amat = A_Matrix , Bmat = NULL, hessian = TRUE, lrtest = TRUE) #-------------------------------------------------------------------- I know, that {vars} restrict the Variance-Covariance-Matrix by default to an identity-matrix but I wondered if I can't restrict it by myself since the way I need (!) to do that is quit...
2002 Oct 25
4
points on a sphere
Not an R question directly, but has anyone got a method for placing a moderately large number of (near) equi-spaced points on a sphere? I have a nasty feeling platonic solids are needed for exact solutions and I'm thinking of samplings involving around 200 - 1000 regularly-spaced points, Thanks, Richard Rowe Richard Rowe Senior Lecturer Department of Zoology and Tropical Ecology, James
2011 Mar 31
3
choosing best 'match' for given factor
Folks, I have a 'matching' matrix between variables A, X, L, O: > a <- structure(c(1, 0.41, 0.58, 0.75, 0.41, 1, 0.6, 0.86, 0.58, 0.6, 1, 0.83, 0.75, 0.86, 0.83, 1), .Dim = c(4L, 4L), .Dimnames = list( c("A", "X", "L", "O"), c("A", "X", "L", "O"))) > a A X L O A 1.00 0.41