similar to: Is there an easy way to generate linearly independent vectors

Displaying 20 results from an estimated 8000 matches similar to: "Is there an easy way to generate linearly independent vectors"

2004 Jun 18
1
Is there an easy way to generate linearly independent vec tors
I believe eigen(), svd() and qr() can all do it. Andy > From: Jonathan Baron > > On 06/17/04 19:04, Fred wrote: > >Dear R-listers: > > > >I am trying to test an algorithm on a set of linearly > independent vectors > >{x1,x2,...,xn}. > > Well, here's an idea, for 10 vectors of length 10, > as columns of a matrix m1. The 11th seems to be needed.
2008 Apr 21
1
How can we predict the value of dependent variable using independent variable
hi , i am trying to predict the value of dependent variable using the independent variable using R . like y is dependent and x1,x2,x3 ...,xn are independent variables so how can predict the value of y using x1,x2,x3 ...,xn . y x1 x2 x3 x4 x5 x6 6 0 1 2 3 1 2 5 1 3 4 5 6 8 8 4 6 9 0 0 1 3 5 7 2 1 0 3 4 5 6 7 8 2
2004 Apr 07
1
eigenvalues for a sparse matrix
Hi, I have the following problem. It has two parts. 1. I need to calculate the stationary probabilities of a Markov chain, eg if the transition matrix is P, I need x such that xP = x in other words, the left eigenvectors of P which have an eigenvalue of one. Currently I am using eigen(t(P)) and then pick out the vectors I need. However, this seems to be an overkill (I only need a single
2004 Sep 29
2
Approximate a f(x,y)
Hi all, Running simulations, I'm generating market response to 2 factors X&Y.. There is no closed form for the market response.. The results are store in a matrix Z(X <- seq(.02,.98,.02), Y <- seq(.01,.19,.01)).. For optmization purpose I need to approximate the values for any factor X in 0,02-0,98 and Y in 0,01-0,19 How can I do it ? For one factor : Xn-1 < x <= Xn
2006 Mar 24
1
Multiple error bar plots
Dear R-lister I have a question about how to create multiple error bar plots. I found that I can use an "errbar" function from Hmisc package to create one error bar plot in which there are multiple data points (x, y) with the error bars. Thus, I know that I can get "one" error bar plot which consists of many data points. However, I did not find a way to put
2011 Mar 25
4
read.xls -> rotate data.frame
Hi to all, how could I to rotate automatically a data sheet which was imported by read.xls? x1 x2 x3 .... xn y1 1 4 7 ... xn/y1 y2 2 5 8 .... xn/y2 y3 3 6 9 ....xn/y2 yn ... ... ... Xn/Yn to y1 y2 y3 .... yn x1 1 2 3 ..... Yn/x1 x2 4 5 6 .... Yn/x2 x3 7 8 9 .... Yn/x2 xn ... ... ... ..... Yn/xn Kind regards Knut
2004 Nov 03
3
fold right - recursive list (vector) operators
The programming language mosml comes with foldr that 'accumulates' a function f over a list [x1,x2,...,xn] with initial value b as follows foldr f b [x1,x2,...,xn] = f(x1,...,f(xn-1,f(xn,b))...) Observe that "list" should have same elements so in R terminology it would perhaps be appropriate to say that the accumulation takes place over a 'vector'. I wonder if R
2012 Apr 16
1
eval a SYMSXP from C
Can someone offer some advice on how to properly evaluate a SYMSXP from a .Call ? I have the following in R: variable xn, with an attribute "mu" which references the variable mu in the global environment. I know "references" is a loose term; mu was defined in this fashion as a way to implement deferred binding: foo <- function(x,mu) { attr(x,"mu") <-
2017 Dec 03
5
Rcpp, dyn.load and C++ problems
Hi, I have written a small C++ function and compile it. However in R I can't see the function I have defined in C++. I have read some web-pages about Rcpp and C++ but it is a bit confusion for me. Anyway, This is the C++-code: #include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] List compute_values_cpp(int totalPoints = 1e5, double angle_increment = 0.01, int radius =
2015 Jul 28
2
all.equal: possible mismatch between behaviour and documentation
Dear all, The documentation for `all.equal.numeric` says Numerical comparisons for ?scale = NULL? (the default) are done by first computing the mean absolute difference of the two numerical vectors. If this is smaller than ?tolerance? or not finite, absolute differences are used, otherwise relative differences scaled by the mean absolute difference. But the actual behaviour
2009 Mar 27
1
constraint optimization: solving large scale general nonlinear problems
Hi I need advice regarding constraint optimization with large number of variables. I need to solve the following problem max f(x1,...,xn) x1,..xn x1=g1(x1,...,xn) . . xn=gn(x1,...,xn) I am using Rdonlp2 package which works well until 40 variables in my case. I need to solve this problem with over 300 variables. In this case Rdonlp2 is very very slowly. I know
2012 Jul 03
1
integral with error:non-finite function value
Hi guys, I'm trying to use the the integral function to estimate the area under a PDF and a crossing curve. first I stated the function with several vectors in it: fn=function(a,b,F,mu,alpha,xi) { x<-vector() fs<-function(x) { c <- (mu+(alpha*(1-(1-F)^xi)/xi)) tmp <- (1 + (xi * (x - mu))/alpha) ((as.numeric(tmp > 0) * (tmp^(-1/xi - 1) *
2017 Dec 03
0
Rcpp, dyn.load and C++ problems
.Call("compute_values_cpp") Also, if you were passing arguments to the C++ function you would need to declare the function differently. Do a search on "Rcpp calling C++ functions from R" HTH, Eric On Sun, Dec 3, 2017 at 3:06 AM, Martin M?ller Skarbiniks Pedersen < traxplayer at gmail.com> wrote: > Hi, > > I have written a small C++ function and compile it.
2009 Dec 15
1
Help in R
Hello, Can anyone give me some suggestion in term of calculating the sum below. Is there a function in R that can help doing it faster? x1, x2, ...xn where xi can be 0 or 1. I want to calculate the following: sum{ beta[a+sum(xi), b+n-sum(xi) ]* [ (1-x1)dnorm(0,1)+x1dnorm(2,1) ]* [ (1-x2)dnorm(0,1)+x2dnorm(2,1) ]* ...* [ (1-xn)dnorm(0,1)+xndnorm(2,1) ] } The sum in the beginning is over all
2009 Feb 22
1
a coding problem from Ross Simulation book
Hi, there could you help me coding this problme? I am just starting to leard the R. So I really need help Question is from Ross, Simulation, 4th Edition. ch3 14. with x1=23, x2=66 Xn=3*Xn-1+5*Xn-2 mod(100) n>=3 we will call the sequence Un=Xn/100 n>=1 find the first 14 values thank you sophia
2009 Aug 19
1
ridge regression
Dear all, I considered an ordinary ridge regression problem. I followed three different ways: 1. estimate beta without any standardization 2. estimate standardized beta (standardizing X and y) and then again convert back 3. estimate beta using lm.ridge() function X<-matrix(c(1,2,9,3,2,4,7,2,3,5,9,1),4,3) y<-t(as.matrix(cbind(2,3,4,5))) n<-nrow(X) p<-ncol(X) #Without
2009 Aug 19
1
Ridge regression [Repost]
Dear all, For an ordinary ridge regression problem, I followed three different approaches: 1. estimate beta without any standardization 2. estimate standardized beta (standardizing X and y) and then again convert back 3. estimate beta using lm.ridge() function X<-matrix(c(1,2,9,3,2,4,7,2,3,5,9,1),4,3) y<-as.matrix(c(2,3,4,5)) n<-nrow(X) p<-ncol(X) #Without standardization
2003 Apr 02
8
lm with an arbitrary number of terms
Hello folks, Any ideas how to do this? data.frame is a data frame with column names "x1",...,"xn" y is a response variable of length dim(data.frame)[1] I want to write a function function(y, data.frame){ lm(y~x1+...+xn) } This would be easy if n was always the same. If n is arbitrary how could I feed the x1+...+xn terms into lm(response~terms)? Thanks Richard -- Dr.
2012 Oct 11
3
Formatting data for bootstrapping for confidence intervals
Hi all, New to R, so this may be obvious to some. I've been trying to figure this out for a while, I have a dataset "events" that looks something like this: Area NAME DATE X Xn Y 1 X 1/10/10 1 1 0 1 Y 1/11/10 0 0 1 1 X 1/12/10 1 0 0 1 X 1/12/10 1 0 0 1 X 1/12/10 1 0 0 2 X 2/12/10 1 1 0
2015 Jul 30
1
all.equal: possible mismatch between behaviour and documentation
Dear Jon, thank you for raising the issue, >>>>> Jon Clayden <jon.clayden at gmail.com> >>>>> on Tue, 28 Jul 2015 12:14:48 +0100 writes: > Sorry; minor clarification. The actual test criterion in the example I > gave is of course abs((0.1-0.102)/0.1) < 0.01, not abs(0.1) < 0.01. In > any case, this does not match (my reading of) the docs,