Displaying 20 results from an estimated 5000 matches similar to: "princomp with not non-negative definite correlation matrix"
2013 May 15
1
x and y lengths differ
I have a problem with R. I try to compute the confidence interval for my
df. When I want to create the plot I have this problem: Error in
xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ.
I try this code:
library(dplR)
df.rwi <- detrend(rwl = df, method = "Spline",nyrs=NULL)
write.table(df.rwi,file="rwi.txt",quote=FALSE,row.names=TRUE)
2012 Jul 30
2
distance matrix and hclustering
Dear R Users,i am very new to R. I want your help on an issue regarding distance matrix and cluster analysis
i had discharge data of 4 rivers(a,b,c,d) in 4 vectors each having 364 values
> dput(qmu)structure(list(a = c(0.26, 0.25, 0.25, 0.25, 0.24, 0.23, 0.22, 0.21, 0.21, 0.21, 0.2, 0.19, 0.19, 0.19, 0.19, 0.18, 0.18, 0.18, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17,
2010 Mar 31
1
Weird R behaviour?
Dear list,
I have observed a weird behaviour from R --- apologies if I am missing
something obvious!
df3f826f28
df3f826f28
Say you type in R:
>c.preec <- 10074
>c.gd <- 2200
>p1 <- .2
>c.neo <- p1*9451 + (1-p1)*3883
>n.preec <- 3710
>n.gd <- 2650
>n.neo <- 2120
>n.pcos <- 53000
>unit.met <- 94
>cost.met <- 94*n.pcos
>effect <-
2004 Nov 03
2
Princomp(), prcomp() and loadings()
In comparing the results of princomp and prcomp I find:
1. The reported standard deviations are similar but about 1% from
each other, which seems well above round-off error.
2. princomp returns what I understand are variances and cumulative
variances accounted for by each principal component which are
all equal. "SS loadings" is always 1.
3. Same happens
2012 Apr 25
1
pca biplot.princomp has a bug?
x=rmvnorm(2000, rep(0, 6), diag(c(5, rep(1,5))))
x=scale(x, center=T, scale=F)
pc <- princomp(x)
biplot(pc)
There are a bunch of red arrows plotted, what do they mean? I knew that the
first arrow labelled with "Var1" should be pointing the most varying
direction of the data-set (if we think them as 2000 data points, each being
a vector of size 6). I also read from
2012 Sep 28
2
Converting array to matrix
Hi,
I have a 3d array as below, I want to make this array to a matrix of p=50(rows) and n=20(columns) with the coverage values .
The code before the array is:
library(binom)
Loading required package: lattice
pi.seq<-seq(from = 0.01, to = 0.5, by = 0.01)
no.seq<-seq(from = 5, to = 100, by = 5)
cp.all = binom.coverage( p = pi.seq, n = no.seq , conf.level = 0.95, method = "exact")
2011 May 17
0
Help fit 5 nonlinear models. - Plant growth curves
Hi!! Can anyone help me, i have problems to converge the following
data with 5 nonlinears models that i evaluated.
Firtly, i send my data (totalsinatipicos) that i just try to fit with
the nonlinear models.
Next, i have the following script where i called the data as
totalsinatipicos. I made selfstarting each nonlinear model.
###Library
library(NRAIA)
###Data
d<-totalsinatipicos
2005 Apr 08
1
Princomp$Scores
Hi all,
I was hoping that someone could verify this for me-
when I run princomp() on a matrix, it is my understanding that the scores
slot of the output is a measure of how well each row correlates (for lack of
a better word) with each principal component.
i.e. say I have a 300x6 log2 scaled matrix, and I run princomp(). I would
get back a $scores slot that is also 300x6, where each value
2008 Jun 26
1
How to turn Time Series daily values into weekly means (aggregate?)
#this is a daily series of precipitation data. I would like to condense it
into weekly means. How can I do this
#as a side note I would like to do this same thing to two years worth of
fifteen minute interval data and make it into
#a series of daily averages (there are 96 readings per day)
#is aggregate the right function? or...
y <- c(1.23, 0, 0, 0, 0, 0, 0, 0, 0, 0.27, 0, 0.29, 0, 0, 0,
2009 Nov 25
1
which to trust...princomp() or prcomp() or neither?
According to R help:
princomp() uses eigenvalues of covariance data.
prcomp() uses the SVD method.
yet when I run the (eg., USArrests) data example and compare with my own
"hand-written" versions of PCA I get what looks like the opposite.
Example:
comparing the variances I see:
Using prcomp(USArrests)
-------------------------------------
Standard deviations:
[1] 83.732400 14.212402
2012 Oct 19
1
factor score from PCA
Hi everyone,
I am trying to get the factor score for each individual case from a principal component analysis, as I understand, both princomp() and prcomp() can not produce this factor score, the principal() in psych package has this option: scores=T, but after running the code, I could not figure out how to show the factor score results. Here is my code, could anyone give me some advice please?
2010 Jun 15
1
Getting the eigenvectors for the dependent variables from principal components analysis
Dear listserv,
I am trying to perform a principal components analysis and create an output table of the eigenvalues for the dependent variables. What I want is to see which variables are driving each principal components axis, so I can make statements like, "PC1 mostly refers to seed size" or something like that.
For instance, if I try the example from ?prcomp
> prcomp(USArrests,
2009 Mar 08
2
prcomp(X,center=F) ??
I do not understand, from a PCA point of view, the option center=F
of prcomp()
According to the help page, the calculation in prcomp() "is done by a
singular value decomposition of the (centered and possibly scaled) data
matrix, not by using eigen on the covariance matrix" (as it's done by
princomp()) .
"This is generally the preferred method for numerical accuracy"
2008 Sep 09
4
PCA and % variance explained
After doing a PCA using princomp, how do you view how much each component
contributes to variance in the dataset. I'm still quite new to the theory of
PCA - I have a little idea about eigenvectors and eigenvalues (these
determine the variance explained?). Are the eigenvalues related to loadings
in R?
Thanks,
Paul
--
View this message in context:
2010 Feb 17
2
extract the data that match
Hi r-users,
I would like to extract the data that match. Attached is my data:
I'm interested in matchind the value in column 'intg' with value in column 'rand_no'
> cbind(z=z,intg=dd,rand_no = rr)
z intg rand_no
[1,] 0.00 0.000 0.001
[2,] 0.01 0.000 0.002
[3,] 0.02 0.000 0.002
[4,] 0.03 0.000 0.003
[5,] 0.04 0.000 0.003
[6,]
2003 Jan 30
3
Principal comp. scores in R
Hello, I am trying to run a PCA in R and I cannot get the PC scores for
each of the values. Using pcX <- princomp(X) then loadings(pcX) I can get a
listing of the eigenvectors but not the actual PC scores for each value in
the dataset. I greatly appreciate any help anyone can offer
Thanks
Ken
2012 Jul 02
1
How to get prediction for a variable in WinBUGS?
Dear all,I am a new user of WinBUGS and need your help. After running the following code, I got parameters of beta0 through beta4 (stats, density), but I don't know how to get the prediction of the last value of h, the variable I set to NA and want to model it using the following code.Does anyone can given me a hint? Any advice would be greatly appreciated.Best
2008 Dec 06
1
Morlet wavelet not supportd by wavCWTPeaks
aa <- (structure(list(X.0.85 = c(-1.02, -1.17, -1.29, -1.39, -1.46,
-1.5, -1.52, -1.5, -1.46, -1.39, -1.3, -1.19, -1.07, -0.93, -0.79,
-0.65, -0.5, -0.36, -0.22, -0.08, 0.05, 0.18, 0.3, 0.41, 0.52,
0.62, 0.72, 0.81, 0.89, 0.98, 1.05, 1.13, 1.19, 1.25, 1.29, 1.31,
1.31, 1.29, 1.24, 1.16, 1.06, 0.93, 0.77, 0.58, 0.38, 0.16, -0.07,
-0.31, -0.89, -1.05, -1.19, -1.31, -1.41, -1.47, -1.51, -1.51,
2011 Jan 21
4
clustering fuzzy
hello,
i'm pete ,how can i order rows of matrix by max to min value?
I have a matrix of membership degrees, with 82 (i) rows and K coloumns, K
are clusters.
I need first and second largest elements of the i-th row.
for example
1 0.66 0.04 0.01 0.30
2 0.02 0.89 0.09 0.00
3 0.06 0.92 0.01 0.01
4 0.07 0.71 0.21 0.01
5 0.10 0.85 0.04 0.01
6 0.91 0.04 0.02 0.02
7 0.00 0.01 0.98 0.00
8 0.02
2009 Feb 13
4
PCA functions
Hi All, would appreciate an answer on this if you have a moment;
Is there a function (before I try and write it !) that allows the input of a
covariance or correlation matrix to calculate PCA, rather than the actual
data as in princomp()
Regards
Glenn
[[alternative HTML version deleted]]