Displaying 20 results from an estimated 20000 matches similar to: "Accessing matrix elements within a list"
2009 Jan 20
5
Error message from CV.GLM
Dear list members.
I have problems with the usage of cv.glm from the boot package. Here are some parts of the script I wanted to use:
data <- read.table("selected_2D.csv", header=TRUE, sep=",")
?
glm.fitted <- glm("ydata$ y ~ 1 + density + vsurf_ID6 + vsurf_S ", data=data)
error <- cv.glm(data=data, glm.fitted, K=6)
ydata$y is a separate data set, where
2012 Dec 19
2
probability of binary data
Hi, how are you?
I am trying to replicate the binary data f(2) function in the attached
document by starting with the simple example found below:
observed <- matrix(c(0, 1, 0, 0, 1, 1, 1, 0, 0),3,3,byrow=TRUE)
data <- matrix(c(1, 1, 0, 0, 1, 0, 0, 0, 1),3,3,byrow=TRUE)
f2 = sum(probability of the matrix element where the matrix element is
present in both the observed and the
2009 Jan 22
4
text vector clustering
Hi,
I am a new user of R using R 2.8.1 in windows 2003. I have a csv file with
single column which contain the 30,000 students names. There were typo
errors while entering this student names. The actual list of names is <
1000. However we dont have that list for keyword search.
I am interested in grouping/cluster these names as those which are
similar letter to letter. Are there any
2009 Sep 28
1
help with lda function
I am having a problem understanding the lda package. I have a dataset here:
[,1] [,2] [,3]
[1,] 2.95 6.63 0
[2,] 2.53 7.79 0
[3,] 3.57 5.65 0
[4,] 3.16 5.47 0
[5,] 2.58 4.46 1
[6,] 2.16 6.22 1
[7,] 3.27 3.52 1
If I do the following;
"names(d)<-c("y","x1","x2")
d$x1 = d$x1 * 100
d$x2 = d$x2 * 100
g<-lda( y ~ x1 + x2, data=d)
v2
2004 Nov 16
5
Difference between two correlation matrices
Hi
Now a more theoretical question. I have two correlation matrices - one
of a set of variables under a particular condition, the other of the
same set of variables under a different condition. Is there a
statistical test I can use to see if these correlation matrices are
"different"?
Thanks
Mick
2002 Dec 04
1
Mixture of Multivariate Gaussian Sample Data
Hey, I am confused about how to generate the sample data from a mixture of
Multivariate Gaussian ditribution.
For example, there are 2 component Gaussian with prior
probability of 0.4 and 0.6,
the means and variances are
u1=[1 1]', Cov1=[1 0;0 1]
and
u2=[-1 -1]', Cov2=[1 0;0 1]
repectively.
So how can I generate a sample of 500 data from the above mixture
distribution?
Thanks.
Fred
2012 Aug 27
3
How to generate a matrix of Beta or Binomial distribution
Hi folks,
I have a question about how to efficiently produce random numbers from Beta
and Binomial distributions.
For Beta distribution, suppose we have two shape vectors shape1 and shape2.
I hope to generate a 10000 x 2 matrix X whose i th rwo is a sample from
reta(2,shape1[i]mshape2[i]). Of course this can be done via loops:
for(i in 1:10000)
{
X[i,]=rbeta(2,shape1[i],shape2[i])
}
However,
2009 Sep 29
1
help with lda function from MASS package
Thanks David,
Yes, I am talking about the MASS package.Thank you for pointing out that
these scale the same. My question is, how do I get from the V1 data:
V1
1 164.4283
2 166.2492
3 170.5232
4 156.5622
5 127.7540
6 136.7704
7 136.3436
to the other set of data:
+ 1 -2.3769280
+ 2 -2.7049437
+ 3 -3.4748309
+ 4 -0.9599825
+ 5 4.2293774
+ 6 2.6052193
+ 7 2.6820884
On Mon, Sep 28, 2009
2009 Oct 13
1
stochastic process
Hi,
I'm a student in China, and I never used R before.
I'm now wondering how to simulate a sample of Markov chain of ,say 500 entries with a certain transition matrix.
Thanks a lot.
___________________________________________________________
好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/
[[alternative HTML version deleted]]
2009 Feb 18
2
how to randomly eliminate half the entries in a vector?
(sorry if this is a duplicate-problems with posting at my end)
----
Hello all,
I need some help with a nice R-idiomatic and efficient solution to a
small problem.
Essentially, I am trying to eliminate randomly half of the entries in
a vector that contains index values into some other vectors.
More details:
I am working with two strings/vectors of 0s and 1s. These will contain
about 200
2010 Mar 11
4
help about solving two equations
I have two matrix s1 and s2, each of them is 1000*1.
and I have two equations:
digamma(p)-digamma(p+q)=s1,
digamma(q)-digamma(p+q)=s2,
and I want to sovle these two equations to get the value of x and y, which are also two 1000*1 matrices.
I write a program like this:
f <- function(x) {
p<- x[1]; q <- x[2];
((digamma(p)-digamma(p+q)-s1[2,]) )^2 +((digamma(q)-digamma(p+q)-s2[2,]) )^2
2000 Jul 26
3
Correlation matrices
Hello,
are there any good methods in R that will test if two correlation matrices (obtained in different ways) are equal? Something better than the Mantel test would be preferable.
Regards,
Patrik Waldmann
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info",
2011 Oct 21
2
Change column/row-name
Hi,
I am very happy. My problems are solved without one little thing:
(Iske <- matrix(c(1, 1, 1, 2, 2, 2, 1, 1, 1, 5, 1, 2, 2, 2, 1, 1, 1,
4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, 4, 4, 4, 4, 2,
2, 2, 2, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 2), ncol = 5)) #My Matrix
Iske<- Iske+33 #I want see the letters
(Iske.char<-apply(Iske, 1, function(x) rawToChar(as.raw(x)))) #Numbers to
2011 May 19
2
trouble with summary tables with several variables using aggregate function
Dear all,
I am having trouble creating summary tables using aggregate function.
given the following table:
Var1 Var2 Var3 dummy
S1 T1 I 1
S1 T1 I 1
S1 T1 D 1
S1 T1 D 1
S1 T2 I 1
S1 T2 I 1
S1 T2 D 1
S1 T2 D 1
S2
2005 Dec 01
2
Minimizing a Function with three Parameters
Hi,
I'm trying to get maximum likelihood estimates of \alpha, \beta_0 and
\beta_1, this can be achieved by solving the following three equations:
n / \alpha + \sum\limits_{i=1}^{n} ln(\psihat(i)) -
\sum\limits_{i=1}^{n} ( ln(x_i + \psihat(i)) ) = 0
\alpha \sum\limits_{i=1}^{n} 1/(psihat(i)) - (\alpha+1)
\sum\limits_{i=1}^{n} ( 1 / (x_i + \psihat(i)) ) = 0
\alpha \sum\limits_{i=1}^{n} (
2011 Oct 06
3
Wide to long form conversion
I have some data 'myData' in wide form (attached at the end), and
would like to convert it to long form. I wish to have five variables
in the result:
1) Subj: factor
2) Group: between-subjects factor (2 levels: s / w)
3) Reference: within-subject factor (2 levels: Me / She)
4) F: within-subject factor (2 levels: F1 / F2)
5) J: within-subject factor (2 levels: J1 / J2)
As this is the
2004 Oct 12
5
[LLVMdev] set_intersect and Visual C compiler
On Tue, 12 Oct 2004 14:01:21 -0500 (CDT)
Chris Lattner <sabre at nondot.org> wrote:
> On Tue, 12 Oct 2004, Morten Ofstad wrote:
>
> > This is my first post on this mailing list, so bear with me... My name
> > is Morten Ofstad and I work for Hue AS (www.hue.no), a company that
> > makes 3D Visualization software. We are looking into using LLVM for JIT
> >
2009 Jul 25
1
Determine the dimension-names of an element in an array in R
Hi:
How can I extract the dimension-names of a pre-defined element in a
multidimensional array in R ?
A toy example is provided below:
I have a 4-dimensional array with each dimension having certain length. In
the below example, "mydatastructure" explains the structure of my data.
mydatastructure = array(0, dim=c(length(b),length(z),length(x),length(d)),
dimnames=list(b,z,x,d))
where,
2009 Oct 11
1
Solving a nonlinear System of equations
Hello there,
I wish to solve the following nonlinear System of equations:
+ u1 - Vmax11*S1/(S1 + Km11 *(1 + S2/Km21)) - Vmax12*S1/( S1 + Km12 *(1+S2/Km22)) == 0
+ u2 - Vmax22*S2/(S2 + Km22 *(1 + S1/Km12)) - Vmax21*S2/( S2 + Km21 *(1+S1/Km11)) == 0
+ Vmax11*S1/(S1 + Km11 *(1 + S2/Km21)) + Vmax12*S1/( S1 + Km12 *(1+S2/Km22)) - d1*P1 == 0
+ Vmax22*S2/(S2 + Km22 *(1 + S1/Km12)) + Vmax21*S2/( S2 +
2012 Nov 01
2
[LLVMdev] llvm linking issue
I have three modules:
-----------------------------------------------------------------
s1.ll:
%0 = type <{ i32, i32 }>
define void @s1(%0* byval %myStruct) nounwind {
return:
ret void
}
-----------------------------------------------------------------
s2.ll:
%0 = type <{ i32, i32 }>
define void @s2(%0* byval %myStruct) nounwind {
return:
ret void
}