search for: tensor

Displaying 20 results from an estimated 90 matches for "tensor".

Did you mean: sensor
2001 Apr 27
1
INSTALL Problems
Dear All, I have tried to install the tensor package (from: http://cran.r-project.org/src/contrib/PACKAGES.html#tensor ), using the comand: " shell("Rcmd INSTALL tensor") " then I got the following mensage: ---------------------------------------------------------------------------------- make: Entering directory `/d/bin/...
2001 Oct 08
1
Package Install Problem under Win98
Hi, I have tried to install 'tensor' as a new package in these phases: 1. via 'Install package from local Zip-File' in Rgui/Windows98: install.packages("D:/R/_Pakets12MB/tensor.zip", .lib.loc[1], CRAN = NULL) 2. Looking at the library folder, there was now a new entry 'tensor' including some files e.g...
1999 Jul 20
2
tensor() function and sets
Hi Everyone, To complete the outer() and kronecker() functions in the base, may I suggest the following tensor() function, which allows the multiplication of arrays through sets of conformable dimensions. I am happy to write a help page if required. The code also needs a setdiff() function which prompts me to ask: what about simple set functions? I expect many of us have written our own (Brian has a set...
2008 Jul 29
1
tensor product of equi-spaced B-splines in the unit square
Dear all, I need to compute tensor product of B-spline defined over equi-spaced break-points. I wrote my own program (it works in a 2-dimensional setting) library(splines) # set the break-points Knots = seq(-1,1,length=10) # number of splines M = (length(Knots)-4)^2 # short cut to splineDesign function bspline = function(x)...
2012 Jul 17
2
Problem creation tensor
...3 3 ? id user 3 2 ? 3 2 id user 4 ? ? ? 4 ... So user 1 don't like item 1 but he likes so much item 4, for item 2 and 3 he hasn't expressed a rating, etc. I need to construct a tensor with n users, m items and 21 occupations. After I have construct the tensor I want apply Parafac. I read data from a CSV file and build each matrix for each occupation. Didier Leibovici (author of PTAk package) suggested to me: ok that's bit clearer you have 21 matrices ( 1 for each occupatio...
2006 Nov 07
1
gamm(): nested tensor product smooths
...quot; parts, this would be: y=X%*%beta+ Z_1%*%b_1+ Z_2%*%b_2 vs y=X%*%beta+ Z_1%*%b_1+ Z_2%*%b_2 + Z_12 %*% b_12 where b are random effect vectors and the hypothesis to be tested is H_0: Var(b_12)=0 (<=> b_12_i == 0 for all i) the problem: gamm() does not seem to support the use of nested tensor product splines, does anybody know how to work around this? example code: (you'll need to source the P-spline constructor from ?p.spline beforehand) ########### test1<-function(x,z,sx=0.3,sz=0.4) { (pi**sx*sz)*(1.2*exp(-(x-0.2)^2/sx^2-(z-0.3)^2/sz^2)+ 0.8*exp(-(x-0.7)^2/sx^2-(...
2009 Mar 11
1
matrix multiplication, tensor product, block-diagonal and fast computation
...e "best" way to compute a series of n matrix multiplications between each matrix (mXm) in an array (mXmXn), and each column of a matrix (mXn). Please find below an example with four possible solutions. The first is a simple for-loop which one might avoid; the second solution employs the tensor product but then manually selects the right outcomes. The third solution uses too many (and too time-consuming) functions in order to profit of mapply. The last solution creates a block-diagonal from the array and multiply such matrix by the vectorized version of the first matrix. Here, often, the...
2012 Apr 02
1
gamm: tensor product and interaction
...I'm working with gamm models of this sort, using Simon Wood's mgcv library: gm<- gamm(Z~te(x,y),data=DATA,random=list(Group=~1)) gm1<-gamm(Z~te(x,y,by=Factor)+Factor,data=DATA,random=list(Group=~1)) with a dataset of about 70000 rows and 110 levels for Group in order to test whether tensor product smooths vary across factor levels. I was wondering if comparing those two models would be enough to conclude? I saw a preceding post on similar issues http://r.789695.n4.nabble.com/Comparing-and-Interpreting-GAMMs-td2234209.html but that example used simple s() smooths instead of tensor pro...
2013 Aug 23
1
Setting up 3D tensor product interactions in mgcv
...hing model where there are three dimensions over which I can smooth (x,y,z). I expect interactions between some, or all, of these terms, and so I have set up my model as mdl <- gam(PA ~ s(x) + s(y) + s(z) + te(x,y) + te(x,z) + te(y,z) + te(x,y,z),...) I have recently read about the ti(), "tensor product interaction smoother", which takes care of these interaction terms elegantly and does the nesting properly. The help file says "This is much better than attempting the same thing with ?s?or ?te? terms representing the interactions (although mgcv does not forbid it)." There is...
2012 Jul 30
2
mgcv 1.7-19, vis.gam(): "invalid 'z' limits'
Hi everyone, I ran a binomial GAM consisting of a tensor product of two continuous variables, a continuous parametric term and crossed random intercepts on a data set with 13,042 rows. When trying to plot the tensor product with vis.gam(), I get the following error message: Error in persp.default(m1, m2, z, col = col, zlim = c(min.z, max.z), xlab = view...
2011 Sep 20
2
Multivariate spline regression and predicted values
...estimate a multivariate regression of Y on X with regression splines. Y is (nx1), and X is (nxd), with d>1. I assume the data is generated by some unknown regression function f(X), as in Y = f(X) + u, where u is some well-behaved regression error. I want to estimate f(X) via regression splines (tensor product splines). Then, I want to get the predicted values for some new points W. To be concrete, here is an example of what I want: #dimensions of the model d=2 n=1000 #some random data X <- matrix(runif(d*n,-2,2),n,d) U <- rnorm(n) Y <- X[,1] + X[,2] + U # a new point for prediction W...
2008 Dec 03
1
Taking slices with tensorA
I've set up a simple tensor with indices 'a' and 'b'. > ftable(B) b u v w x y a a1 0.001868954 0.403345197 0.030088185 0.137252368 0.142634612 a2 0.396935972 0.945219795 0.068828465 0.314180585 0.446338719 a3 0.752412200 0.748810918 0.125532631 0.4...
2012 Dec 28
4
efficiently multiply different matrices in 3-d array with different vectors?
Hello, I have been wondering of an efficient way to do this: I have an n x m x p array Z and a p x n matrix Y. I want to multiply each of the n matrices with the corresponding column vector of Y. In other words, I am wanting to matrix multiply: Z[i, ,] %*% Y[, i] which will give me a (two-dimensional) array or matrix of dimension n x p with the i'th row storing the above. Any pointers
2005 Jun 14
0
Plotting quiver vector tensor arrows 2d field data
Hi All, I'd like to plot something like http://www.nawcwpns.navy.mil/~weather/mugu/mesodata/analysis.html Looking through the galleries at http://addictedtor.free.fr/graphiques/allgraph.php http://r-spatial.sourceforge.net/gallery/ http://fawn.unibw-hamburg.de/cgi-bin/Rwiki.pl?GraphGallery demo(graphics) I did not find a function to plot a 2d field on a matrix. I did find mention of a
2010 Jul 02
4
Some questions about R's modelling algebra
...so far is the section in "An Introduction to R" (http://cran.r-project.org/doc/manuals/R-intro.html#Formulae-for-statistical-models). Does anyone have any other suggestions? I have a few questions about the definitions given in "An Introduction to R": * "M_1 : M_2 - The tensor product of M_1 and M_2. If both terms are factors, then the ?subclasses? factor." From my reading, the usual interpretation of a tensor product when x and y are vectors is the outer product. I don't see how that would work here - how does a matrix work as an predictor in a linear mode...
2011 Jun 07
2
gam() (in mgcv) with multiple interactions
...so I'm doing a binomial fit with gam(). I have five independent variables, all continuous, all uniformly distributed in [0, 1]. (This dataset is the result of a simulation model.) Let's call them a,b,c,d,e for simplicity. I'm interested in interactions such as a*b, so I'm using tensor product smooths such as te(a,b). So far so good. But I'm also interested in, let's say, a*d. So ok, I put te(a,d) in as well. Both of these have a as a marginal basis (if I'm using the right terminology; all I mean is, both interactions involve a), and I would have expected them to...
2023 Aug 06
1
Stacking matrix columns
Avi, I was not trying to provide the most economical solution. I was trying to anticipate that people (either the OP or others searching for how to stack columns of a matrix) might be motivated by calculations in multilinear algebra, in which case they might be interested in the rTensor package. On Sun, Aug 6, 2023 at 6:16?PM <avi.e.gross at gmail.com> wrote: > > Eric, > > I am not sure your solution is particularly economical albeit it works for arbitrary arrays of any dimension, presumably. But it seems to involve converting a matrix to a tensor just to undo...
2001 Apr 24
1
New Package Released: PTAk
PTAk_1.1-1 ( Principal Tensor Analysis on k modes) has been released on CRAN A multiway method to decompose a tensor (array) of any order, as a generalisation of SVD also supporting non-identity metrics and penalisations. 2-way SVD with these extensions is also available. The package includ...
2001 Apr 24
1
New Package Released: PTAk
PTAk_1.1-1 ( Principal Tensor Analysis on k modes) has been released on CRAN A multiway method to decompose a tensor (array) of any order, as a generalisation of SVD also supporting non-identity metrics and penalisations. 2-way SVD with these extensions is also available. The package includ...
2006 Feb 27
3
how to use the basis matrix of "ns" in R? really confused by multi-dim spline filtering?
...the output matrix, and how to use the output matrix to "filter" data? Books mention about basis matrix, design matrix, model matrix, data matrix, etc. I got lost. I presume the output of the "ns" function in R is "basis matrix", but then how do I use it? How to form tensor-product? I don't understand it at all. Please help me! Thank you very much! [[alternative HTML version deleted]]