search for: prob1

Displaying 14 results from an estimated 14 matches for "prob1".

Did you mean: probe
2008 Apr 22
2
Multidimensional contingency tables
How does one ideally handle and display multidimenstional contingency tables in R v. 2.6.2? E.g.: > prob1<- data.frame(victim=c(rep('white',4),rep('black',4)), + perp=c(rep('white',2),rep('black',2),rep('white',2),rep('black',2)), + death=rep(c('yes','no'),4), count=c(19,132,11,52,0,9,6,97)) > prob1 victim perp death count 1...
2010 Sep 06
1
calculating area between plot lines
Hi everyone. I have these data: probClass<-seq(0,0.9,0.1) prob1<-c(0.0070,0.0911,0.1973,0.2949,0.3936,0.5030,0.5985,0.6869,0.7820,0.8822) prob2<-c(0.0066,0.0791,0.2358,0.3478,0.3714,0.3860,0.6667,0.6400,0.7000,1.0000) # which I'm plotting as follows: plot(probClass,prob1,xlim=c(0,1),ylim=c(0,1),xaxs='i',yaxs='i',type="n") l...
2011 Oct 06
1
sum of functions
...er to maximize the log-likelihood function, I have to sum these log-likelihood functions for each i and so to get another function that is a function only of betas and so to maximize it through maxLik for instance. Is that possible? In order to be more clear I give an example of how it could be: Prob1 <- function(b, i) g.yj(b,y=1,h.np,i)/(g.yj(b,y=1,h.np,i)+g.yj(b,y=0,h.np,i)) loglik.i<- function(b, i) Y[i,]*log(Prob1(b,i))+(1-Y[i,])*log(1-Prob1(b,i)) where b denotes the betas, i the observations, Y is the response vector and g.yj(b,1,h.np,i) a function that I created previously, Prob1(b...
2010 Mar 06
1
Plotting Comparisons with Missing Data
...got a data table that I've read from a file containing some simple information about the performance of 4 algorithms. The columns are the name of the algorithm, the problem instance and the resulting score on that problem (if it wasn't solved I mark that with NA). solver instance result A prob1 40 B prob1 NA C prob1 39 D prob1 35 A prob2 100 B prob2 50 C prob2 NA D prob2 NA A prob3 75 B prob3 80 C prob3 60 D prob3 70 A prob4 80 B prob4 NA C prob4 85 D prob4 75 I've managed to read in the data as follows: data <- table.read("./test.txt", header = TRUE, colClasses = c(&quo...
2007 Jan 19
1
naive bayes help
...# number of training points n.test <- 200 # number of test points p<-2 # dimension of input space z <- matrix(rnorm((n+n.test)*p),ncol=p) x <- matrix(0,nrow=n+n.test,ncol=p) for (i in 1:p) x[,i] <- z%*%rnorm(p) truecoef <- c(1,2) prob1 <- exp(x%*%truecoef)/(1+exp(x%*%truecoef)) # prob is the true probability of class 1 y <- rbinom(n+n.test,1,prob1) # separate the data into train and test sets mydata <- data.frame(y=y[1:n],x=x[1:n,]) mydata.test <- data.frame(y=y[n+(1:n.test)],x=x[n+(1: n.test),]) #####################...
2000 Apr 05
2
My first R-program
Sorry, I pasted the wrong file in earlier... this is the correct one: pValCalculator(b, n=20, m=20) { ind <- 1:min(c(n,m)) prob <- (1-pnorm(b,sd=std*sqrt(ind))) prob1 <- sum((n-ind+1)*(m-ind+1)*prob) prob1 } inputData <- scan("/users/lvssso/projects/LAMA/output/pValLamaScore.tmp", list(block1 = "",block2 = "",width1 = 0,width2 = 0,alignment = 0,score = 0)); pVal <- vector(mode = "numeric", length(inputData$sco...
2009 Jun 10
1
Analisys in Multidimensional contingency tables
...is of multidimensional contingency tables using R. I' working with the Agresti example where you have the data from 3 categories. The thing is how can I do the analisys using the G2 statistics. Somebody can send me an Idea? I attach the program where you can find the data. Best Regards, > prob1<- data.frame(victim=c(rep('white',4),rep('black',4)), + perp=c(rep('white',2),rep('black',2),rep('white',2),rep('black',2)), + death=rep(c('yes','no'),4), count=c(19,132,11,52,0,9,6,97)) > prob1 victim perp death count 1 whit...
2000 Apr 05
0
My first R program
...other you guys with this syntax problem, this is my first R program, and I seem to not have grasped something right. I keep getting an error message from 'parse' on the line with the *** : pValCalculator(b, n=20, m=20) { ind <- 1:min(c(n,m)) prob <- (1-pnorm(b,sd=std*sqrt(ind))) prob1 <- sum((n-ind+1)*(m-ind+1)*prob) prob1 } inputData <- scan("/users/lvssso/projects/LAMA/output/pValLamaScore.tmp", list(block1 = "",block2 = "",width1 = 0,width2 = 0,alignment = 0,score = 0)); pVal <- vector(mode = "numeric", length(lamaScore));...
2007 Jan 18
0
help with niave bayes
...# number of training points n.test <- 200 # number of test points p<-2 # dimension of input space z <- matrix(rnorm((n+n.test)*p),ncol=p) x <- matrix(0,nrow=n+n.test,ncol=p) for (i in 1:p) x[,i] <- z%*%rnorm(p) truecoef <- c(1,2) prob1 <- exp(x%*%truecoef)/(1+exp(x%*%truecoef)) # prob is the true probability of class 1 y <- rbinom(n+n.test,1,prob1) # separate the data into train and test sets mydata <- data.frame(y=y[1:n],x=x[1:n,]) mydata.test <- data.frame(y=y[n+(1:n.test)],x=x[n+(1:n.test),]) ######################...
2012 Apr 04
0
multivariate ordered probit regression---use standard bivariate normal distribution?
...he model with the two response variables separately. Any suggestions are welcome. Again, if it helps in your response, I've included a link to the data below. Thanks. --Trey Get the data (a *.csv file) here: https://docs.google.com/open?id=0B5zZGW2utJN0TEctcW1oblFRcTJrNDVLOVBmRWRaQQ unvar.prob1<-vglm(pube3~age,data=refdata,cumulative(link="probit",parallel=FALSE,reverse=TRUE)) > unvar.prob1 Call: vglm(formula = pube3 ~ age, family = cumulative(link = "probit", parallel = FALSE, reverse = TRUE), data = refdata) Coefficients: (Intercept):1 (Intercept):2 age:1 age:...
2002 Aug 06
3
hard to believe speed difference
...bj.nextGaussian()*sd; if(harvest>lower && harvest<upper) break; } harvest = Sfun.nearestInteger(harvest); left = (harvest - .5 - mean)/sd; right = (harvest + .5 - mean)/sd; double prob1 = Statistics.normalCdf(right) - Statistics.normalCdf(left); prob = prob1/prob2; } public static void main(String[] useless) { System.out.println(new Date()); int n = 500000;...
2007 Jul 06
0
svyglm
...all: svyglm(q14sum ~ q16x + q17ax + q17bx + q17cx + q17dx + q17ex + q17fx + q18x + q19x + heavy + binge + smoksum + q41sum + q46 + exsum + q53 + q55 + q61 + ethnicgrp + pcs_sum + mcs_sum, design = dudleyls1design, family = binomial) Survey design: svydesign(id = ~1, probs = ~prob1, strata = ~strat1, fpc = ~pop1, data = dudleyls1) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -0.929963 0.286259 -3.249 0.001170 ** q16xOK 0.433945 0.086506 5.01...
2009 Apr 21
4
My surprising experience in trying out REvolution's R
...); obj <- optim(u.mean.initial, fn, control=list(fnscale=-1), hessian = T) u.mean.initial <- obj$par; var.root <- solve(-obj$hessian); var.root <- t( chol(var.root) ); u <- matrix( rnorm(n.random*n.simu), nrow=n.random, ncol=n.simu ); log.prob1 <- -colSums(u*u)/2; u <- u.mean.initial + var.root %*% u; ada <- exp( ada.part + z %*% u ); ada <- ada/(1+ada); #it is probability now log.prob2 <- colSums( y*log(ada) + (1-y)*log(1-ada) ); log.prob2 <- -quadratic.form2(D.u.inv, u)/2 + log....
2019 Jun 24
1
Calculation of e^{z^2/2} for a normal deviate z
>>>>> jing hua zhao >>>>> on Mon, 24 Jun 2019 08:51:43 +0000 writes: > Hi All, > Thanks for all your comments which allows me to appreciate more of these in Python and R. > I just came across the matrixStats package, > ## EXAMPLE #1 > lx <- c(1000.01, 1000.02) > y0 <- log(sum(exp(lx))) > print(y0) ## Inf