search for: allval

Displaying 6 results from an estimated 6 matches for "allval".

Did you mean: allvals
2006 Sep 23
1
Fitdistr() versus nls()
...me if there's a major mistake in the code? Thanks in advance, Luca ------ BEGINNING OF CODE ---------------------------------------------------------------- cdf.all=read.table("all_failures.cdf", header=FALSE, col.names=c ("ttr", "cdf"), sep=":" ) allvals.x=array(t(cdf.all[1])) allvals.y=array(t(cdf.all[2])) library(MASS) bestval.exp.nls=bestval.exp.fit=-1 plot(allvals.x, allvals.y) for(it in 1:100){ #extract random samples random=sort(sample(1:length(allvals.x), 15)) somevals.x=allvals.x[c(random)] somevals.y=allvals.y[c(random)] #fit with n...
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 Nov 23
1
Student-t distributed random value generation within a confidence interval?
Dear R-users! I?m faced with following problem: Given is a sample where the sample size is 12, the sample mean is 30, and standard deviation is 4.1. Based on a Student-t distribution i?d like to simulate randomly 500 possible mean values within a two-tailed 95% confidence interval. Calculation of the lower and upper limit of the two-tailed confidence interval is the easy part. m <- 30 #sample
2009 May 22
0
EM algorithm mixture of multivariate
...le ######################### #Start Script ######################### library(mvtnorm) libray(scatterplot3d) library(MASS) n=100 m1=c(5,-5) m2=c(-3,3) s1=matrix(c(2,1,1,3), 2,2) s2=matrix(c(4,1,1,6), 2,2) alpha=0.3 c1 <- mvrnorm(round(n*alpha),m1,s1) c2 <- mvrnorm(round(n*(1-alpha)),m2,s2) allval <- rbind(c1,c2) x <- allval[sample(n,n),] mixm<- function(x,m1,m2,s1,s2, alpha) { f1<-dmvnorm(x, m1, s1, log=FALSE) f2<-dmvnorm(x, m2, s2, log=FALSE) f=alpha*f1+(1-alpha)*f2 f } plot(x) den<-mixm(x,m1,m2,s1,s2,alpha) scatterplot3d(x[,1],x[,2],den, highlight.3d=TRUE...
2009 May 22
0
EM algorithm mixture of multivariate gaussian
...le ######################### #Start Script ######################### library(mvtnorm) libray(scatterplot3d) library(MASS) n=100 m1=c(5,-5) m2=c(-3,3) s1=matrix(c(2,1,1,3), 2,2) s2=matrix(c(4,1,1,6), 2,2) alpha=0.3 c1 <- mvrnorm(round(n*alpha),m1,s1) c2 <- mvrnorm(round(n*(1-alpha)),m2,s2) allval <- rbind(c1,c2) x <- allval[sample(n,n),] mixm<- function(x,m1,m2,s1,s2, alpha) { f1<-dmvnorm(x, m1, s1, log=FALSE) f2<-dmvnorm(x, m2, s2, log=FALSE) f=alpha*f1+(1-alpha)*f2 f } plot(x) den<-mixm(x,m1,m2,s1,s2,alpha) scatterplot3d(x[,1],x[,2],den, highlight.3d=TRUE...
2011 Apr 09
1
loop and sapply problem, help need
Dear R experts Sorry for this question M1 <- 1:10 lcd1 <- c(11, 22, 33, 44, 11, 22, 33, 33, 22, 11) lcd2 <- c(22, 11, 44, 11, 33, 11, 22, 22, 11, 22) lcd3 <- c(12, 12, 34, 14, 13, 12, 23, 23, 12, 12) #generating variables through sampling pvec <- c("PR1", "PR2", "PR3", "PR4", "PR5", "PR6", "PR7",