search for: 3x1

Displaying 12 results from an estimated 12 matches for "3x1".

Did you mean: 31
2006 Jul 27
2
Vector extracted from a matrix. How can I specify dimensions in as.matrix?
...line (vector) of a matrix in a loop. In the model, I need to transpose those vectors that are extracted from a matrix. Using simple vectors (no matrix involved) the transpose function works fine: simplevector <-matrix(1:3,3,1) tsimplevector <-t(simplevector) #transposed dim(simplevector) #3x1 matrix (vector) dim(tsimplevector)#1x3 PROBLEM: However, when the vector is extracted from a matrix, its dimension is NULL. In this case the transposed dimension is correct, but you'll see the next example, that if a row was extracted, the dimension would be wrong: initialmatrix <- matr...
2012 Oct 26
3
summation sign
Hi all, I have a very quick question on how to use the summation sign in R for the function. Here?s a basic example: the function is sum(i=1 to 5)log(1-xi^2) Id be grateful if someone knows how to do this without writing it out 5 times - I am looking sth along the lines of the following: computeR <- function(x) { return (-sum(log(1-x^2)) }^ thank you vm in advance! -- View this
2009 Apr 23
6
Stuck using constrOptim
...rying to use constrOptim to minimize the sum of squared deviations. I put the objective function in as: sum((x %*% Y - Z)^2) so i'm trying to get values for x to minimize the sum of the squared deviations between the product of x and Y and Z. Anyways i have no problem using this when x is a 3x1 test variable. it works great with the constraints and everything. when i actually use it on my data x is 3x900 or so and it wont optimize it just gives me back my initial guess....this is the output i'm getting: $value [1] 22.7438 $counts function gradient 906 NA $convergence...
2003 Oct 24
1
NLS estimation: Starting values
Dear All, I am trying to fit to the data a nonlinear function, say z(tau;b) where tau is the independent variable and b is 3x1 vector of parameters. Following previous suggestions from the list, I am trying to find some "optimal" starting values for the three parameters by using the command 'optim' and then feed these values to nls for estimation. Does anybody know hot to use 'optim' for this...
2006 Mar 10
1
what's wrong with my "cov"?
Hi all, Why cov(y, y) only gives one value, and cov(t(y), t(y)) gives 3x3 NA matrix? Here my y is listed below and it is a 3x1 matrix. I am expecting that if I have a random vector y=[y1 y2 y3]', here " ' " denotes a transposition so that y is a column vector, where y1, y2, y3 are independent random variables... then cov(y, y) should be E[ y * y' ] - E[y] * E[y] ', and it should generate an 3...
2006 Feb 21
1
I need your help
Hi, Dear R users I have problem with the following code. The matrix result must be a matrix (3x3). But I have obtained a matrix(3x1) and I don't know why. So, I need your help Best regards ##################################################################### taille <- function (delta, t, prob = 0.2) { niv.conf <- c(0.90, 0.95, 0.99) if(niv.conf <- 0.90) { t <- 1.645 } else { if(niv.conf <- 0.95) {...
2005 Mar 17
1
Optimization of constrained linear least-squares problem
...R-ians, I want to perform an linear unmixing of image pixels in fractions of pure endmembers. Therefore I need to perform a constrained linear least-squares problem that looks like : min || Cx - d || ? where sum(x) = 1. I have a 3x3 matrix C, containing the values for endmembers and I have a 3x1 column vector d (for every pixel in the image). In theory my x values should all be in the (0,1) interval but I don't want to force them so I can check the validity of my solution. I just want to calculate the x values. Can anyone help me with this problem? I've been checking the optim,...
2008 Jan 08
1
using lapply()
useR's, I am trying to find a quick way to change some values in a list that are subject to a condition to be NA. Consider the 3x1 matrix: delta <- matrix(c(2.5,2.5,1), nrow = 1) And consider the list named v that has 3 elements > v v[[1]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 4.25 3.25 2.25 1.25 0.25 0.75 1.75 2.75 3.75 4.25 3.25 2.25 1.25 0.25 [2,] 1.25 0....
2003 Oct 08
1
Contrast specified with C() - R vs S-Plus problem
Hi, For a n-level factor, I'd like to specify the first contrast and have the remaining n-2 constructed automatically so that the set is orthogonal. I then test the contrasts with summary.lm(anova-object). In S-Plus, the following works: >y.anova <- aov( y ~ C(CO2,c(1,0,-1)) ) >summary.lm(y.anova) In R, it fails with the following error: >levels(CO2) [1]
2007 Mar 05
4
about find the solution
If I want to find out the soltion of X1,X2 that min(3X1+2X2+X1X2) subject to 20<=X1+3X2<=50 10<=X1 which function or package can I use? Thanks.
2024 Feb 28
2
converting MATLAB -> R | element-wise operation
On Tue, 27 Feb 2024 13:51:25 -0800 Jeff Newmiller via R-help <r-help at r-project.org> wrote: > The fundamental data type in Matlab is a matrix... they don't have > vectors, they have Nx1 matrices and 1xM matrices. Also known as column vectors and row vectors. :) > Vectors don't have any concept of "row" vs. "column". They do in (numerical) linear
2008 Jun 30
4
Rebuild of kernel 2.6.9-67.0.20.EL failure
Hello list. I'm trying to rebuild the 2.6.9.67.0.20.EL kernel, but it fails even without modifications. How did I try it? Created a (non-root) build environment (not a mock ) Installed the kernel.scr.rpm and did a rpmbuild -ba --target=`uname -m` kernel-2.6.spec 2> prep-err.log | tee prep-out.log The build failed at the end: Processing files: kernel-xenU-devel-2.6.9-67.0.20.EL Checking