Displaying 20 results from an estimated 10000 matches similar to: "Command Line Programs"
2004 Feb 24
5
Nonlinear Optimization
Hi,
I have been brought back to the "R-Side" from MatLab. I have used R in
graduate econometrics but only for statistics and regression (linear and
nonlinear). But now I need to run general nonlinear optimization.
I know about the add-in quadprog but my problem is not QP. My problem is a
general nonlinear (obj funct) with linear constraints.I know about the "ms"
and
2004 Mar 31
2
functions & paths
Hi,
I have a couple of quick questions regarding R.
1) I have a ".First" function that automatically loads the quadprog package into the workspace. The .First function resides in R and is only saved if I save the workspace. The exact function is as follows:
.First<-function()
{
library(quadprog)
}
Is there any way that this function can be saved outside of R? That is, is there
2004 Mar 19
3
Reading Data
Hi,
Quick question on reading data.
I am running simulations but want to allow the user the option to define the number of simulations. How can I have R read-in user data entered from the keyboard? Is there a difference for reading in numeric and character data?
For example, I am trying to write the following in R:
Enter Number of Iterations?
<<<the user then enters a number say Y
2011 Jun 29
3
4D data acsess
Hi, I have a 4D data file from MATLAB, call it X, that I want to analyze in
R. The first 3 dimensions are x y z coordinates and the forth is a value in
time.
If you took a sample vector in matlab it would look like
vec1 = X(x1, y1, z1, :)
vec2 = X( x2, y2, z2, :)
this would give you all values (I have 300 of them) corresponding to this
(x1,y1,z1) point of X.
Now I read the MATLAB datafile 4D
2012 Aug 28
5
return first index for each unique value in a vector
I would like to efficiently find the first index of each unique value in a
very large vector.
For example, if I have a vector
A<-c(9,2,9,5)
I would like to return not only the unique values (2,5,9) but also their
first indices (2,4,1).
I tried using a for loop with which(A==unique(A)[i])[1] to find the first
index of each unique value but it is very slow.
What I am trying to do is easily
2008 Jun 03
3
matlab eigs function in R
Hello
Does anybody know how one can compute d largest eigenvalues/eigenvectors in
R, like in MATLAB eigs function ? eigen function computes all
eigenvectors/eigenvalues, and they are slightly different than those
generated by matlab eigs.
Thanks in advance
--
View this message in context: http://www.nabble.com/matlab-eigs-function-in-R-tp17619641p17619641.html
Sent from the R help mailing list
2006 Jul 08
2
String mathematical function to R-function
hello
I make a subroutine that give-me a (mathematical)
function in string format.
I would like transform this string into function ( R
function ).
thanks for any tips.
cleber
#e.g.
fun_String = "-100*x1 + 0*x2 + 100*x3"
fun <- function(x1,x2,x3){
return(
############
evaluation( fun_String )
############
)
True String mathematical function :-( :-(
> nomes
[1]
2009 Nov 09
3
How to transform the Matrix into the way I want it ???
Hi, R users,
I'm trying to transform a matrix A into B (see below). Anyone knows how to
do it in R? Thanks.
Matrix A (zone to zone travel time)
zone z1 z2 z3 z1 0 2.9 4.3 z2 2.9 0 2.5 z3 4.3 2.5 0
B:
from to time z1 z1 0 z1 z2 2.9 z1 z3 4.3 z2 z1 2.9 z2 z2 0 z2 z3 2.5 z3 z1
4.3 z3 z2 2.5 z3 z3 0
The real matrix I have is much larger, with more than 2000 zones. But I
think it should
2003 Apr 03
2
Matrix eigenvectors in R and MatLab
Dear R-listers
Is there anyone who knows why I get different eigenvectors when I run
MatLab and R? I run both programs in Windows Me. Can I make R to produce
the same vectors as MatLab?
#R Matrix
PA9900<-c(11/24 ,10/53 ,0/1 ,0/1 ,29/43 ,1/24 ,27/53 ,0/1 ,0/1 ,13/43
,14/24 ,178/53 ,146/244 ,17/23 ,15/43 ,2/24 ,4/53 ,0/1 ,2/23 ,2/43 ,4/24
,58/53 ,26/244 ,0/1 ,5/43)
#R-syntax
2011 Mar 29
5
Integration with variable bounds
If this is posted elsewhere I cannot find it. I need to perform multiple
integration where some of the variables are in the bounds of the other
variables. I was trying to use R2Cuba function but cannot set the upper and
lower bounds. My code so far is :
int <- function(y){
u2 = y[1]
z2 = y[2]
u1 =y[3]
z1 = y[4]
ff <- u1*(z1-u1)*u2*(z2-u2)*exp(-0.027*(12-z2))
return(ff)
}
2012 Aug 08
3
help, please! matrix operations inside 3 nested loops
hello, this is my script:
#1) read in data:
daten<-read.table('K:/Analysen/STRUCTURE/input_STRUCTURE_tab_excl_5_282_559.txt',
header=TRUE, sep="\t")
daten<-as.matrix(daten)
#2) create empty matrix:
indxind<-matrix(nrow=617, ncol=617)
indxind[1:20,1:19]
#3) compare cells to each other, score:
for (s in 3:34) { #walks though the matrix colum by colum, starting at
2002 Mar 27
2
Error with nls
Dear R-group members,
I use:
platform i386-pc-mingw32
arch x86
os Win32
system x86, Win32
status
major 1
minor 4.1
year 2002
month 01
day 30
language R
I try to fit a 2 compartment model. The compartments are open, connected
to each other and
2006 Jun 15
3
matrix selection return types
Dear Rusers,
I would like some comments about the following results
(under R-2.2.0)
> m = matrix(1:6 , 2 , 3)
> m
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
> z1 = m[(m[,1]==2),]
> z1
[1] 2 4 6
> is.matrix(z1)
[1] FALSE
> z2 = m[(m[,1]==0),]
> z2
[,1] [,2] [,3]
> is.matrix(z2)
[1] TRUE
Considered together, I'm a bit surprised about
2008 Oct 04
3
How to plot countours with fixted densities?
Hello,
I used the following codes to generate bivariate normal dependence structure with unit Frechet margins.
Sigma <- matrix(c(1,.5*sqrt(1),.5*sqrt(1),1),2,2) # generate
y <- mvrnorm(Nsam, c(0,0), Sigma) # random
v <- cbind(pnorm(y[,1],mean = 0, sd = 1), pnorm(y[,2],mean = 0, sd = 1))
z <- cbind(-1/log(v[,1]),-1/log(v[,2]))
z1 <- z[,1]
z2 <- z[,2]
And to
2013 Oct 18
1
crr question in library(cmprsk)
Hi all
I do not understand why I am getting the following error message. Can
anybody help me with this? Thanks in advance.
install.packages("cmprsk")
library(cmprsk)
result1 <-crr(ftime, fstatus, cov1, failcode=1, cencode=0 )
one.pout1 = predict(result1,cov1,X=cbind(1,one.z1,one.z2))
predict.crr(result1,cov1,X=cbind(1,one.z1,one.z2))
Error: could not find function
2017 Jul 28
3
problem with "unique" function
I have the joint distribution of three discrete random variables z1, z2 and
z3 which is captured by "z"
and "prob" as described below.
For example, the probability for z1=0.46667, z2=-1 and z3=-1 is 2.752e-13.
Also, the probability adds up to 1.
> head(z) z1 z2 z3
[1,] -0.46667 -1.0000 -1.0000
[2,] -0.33333 -0.9333 -0.9333
[3,] -0.20000 -0.8667 -0.8667
2006 Jun 14
3
A question about stepwise procedures: step function
Dear all,
I tried to use "step" function to do model selection, but I got an error massage. What I don't understand is that data as data.frame worked well for my other programs, how come I cannot make it run this time. Could you please tell me how I can fix it?
***************************************************************************************************
2008 Jul 11
1
Comparing complex numbers
Is there an easy way to compare complex numbers?
Here is a small example:
> (z1=polyroot(c(1,-.4,-.45)))
[1] 1.111111-0i -2.000000+0i
> (z2=polyroot(c(1,1,.25)))
[1] -2+0i -2+0i
> x=0
> if(any(identical(z1,z2))) x=99
> x
[1] 0
# real and imaginary parts:
> Re(z1); Im(z1)
[1] 1.111111 -2.000000
[1] -8.4968e-21 8.4968e-21
> Re(z2); Im(z2)
[1] -2
2006 Mar 16
2
Using of LME function in non-replicate data
Hello all R-users!
In Jun-2005, I find the follow discussion about using
of
LME function ( in NLME library ) for fitting
non-replicate data
The thread: ANOVA vs REML approach to variance
component estimation
http://tolstoy.newcastle.edu.au/R/help/05/06/6498.html
Someone expose the follow problem:
# non-replicate data
y <- c(2.2, -1.4, -0.5, -0.3, -2.1, 1.5, 1.3, -0.3,
0.5, -1.4,
2006 Jan 27
1
about lm restrictions...
Hello all R-users
_question 1_
I need to make a statistical model and respective ANOVA table
but I get distinct results for
the T-test (in summary(lm.object) function) and
the F-test (in anova(lm.object) )
shouldn't this two approach give me the same result, i.e
to indicate the same significants terms in both tests???????
obs.
The system has two restrictions:
1) sum( x_i ) = 1
2) sum(