Displaying 4 results from an estimated 4 matches for "sel_col".
2011 Feb 23
0
Problem with Mclust
...logarithm = TRUE, parameters = parameters, :
data must be one-dimensional
In addition: There were 42 warnings (use warnings() to see them)
Can anyone tell me what I am doing wrong?
Many thanks
Lorenzo
############################
library(mclust)
rm(list=ls())
#Define the training dataset
sel_col <- c(1,2,4)
sample_percentage <- 0.9
my_data <- read.csv("http://dl.dropbox.com/u/5685598/dataedges.csv",
header=FALSE)
my_data <- as.matrix(my_data)
set.seed(1234)
ms <- sample(seq(sample_percentage*dim(my_data)[1]))
train_set <- my_data[ms,...
2008 Aug 02
1
problem with nested loop for regression
...ly(dslicets, wind, by=wind, max, na.rm=F)
Pmult<-Pmin*Pmax #calculating product
tt<-time(Pmult)
for (j in 1:5) #1st nested loop
{
PmatWt[j,]<-Pmult[j,]*mult_col[j,]
}
#rolling regression analysis...
for (k in 1:maxcol) #2nd nested loop
{
sel_col<-PmatWt[,k]
if(!all(is.na(sel_col))) {Preg[,k]<-coef(lm(tt~sel_col))}
}
}
#Code End
Thanks,
rcoder
--
View this message in context: http://www.nabble.com/problem-with-nested-loop-for-regression-tp18792841p18792841.html
Sent from the R help mailing list archive at N...
2011 Jun 23
2
Confidence interval from resampling
...uot;)
newmat<-data.matrix(newx)
# matrix of coefficients
rownum=2
colnum=100
ResultMat<-matrix(NA, ncol=colnum, nrow=rownum)
rownum2=45
colnum2=100
ResultMat2<-matrix(NA, ncol=colnum2, nrow=rownum2)
#loop through each column in the source matrix
for (i in 1:100)
{
sel_col<-newmat[col(newmat)==i]
{ResultMat[,i]<-coef(fitdistr(sel_col,"weibull"))}
xwei.shape<- ResultMat[1,i]
xwei.scale<- ResultMat[2,i]
curve(pweibull(x, shape=xwei.shape, scale=xwei.scale, lower.tail=TRUE,
log.p = FALSE), add=TRUE, col='grey',lwd=0.5...
2008 Jul 29
1
correlation between matrices - both with some NAs
Hi everyone,
I'm having trouble applying the Cor() function to two matrices, both of
which contain NAs. I am doing the following:
a<-cor(m1, m2, use="complete.obs")
... and I get the following error message:
Error in cor(m1, m2, use = "complete.obs") :
no complete element pairs
Does anyone know how I can apply a correlation, ignoring any NAs?
Thanks,
rcoder
--