Displaying 20 results from an estimated 6000 matches similar to: "Sum of Probabilities in a matrix..."
2011 May 25
1
matrix Manipulation...
Hello everyone,
I have a 2 x 5 matrix: say
0.2 0.3 1 -1 3
0.2. 0.4 5 0.5 -1
I want to replace all the values greater than or equal to 1 with 1 and those
less than or equal to 0 with 0. So I should end up with a mtrix looking
like:
0.2 0.3 1 0 1
0.2. 0.4 1 0.5 0
Any ideas how to do this?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2013 Mar 06
3
About basic logical operators
Hello everyone,
I have a basic question regarding logical operators.
> x<-seq(-1,1,by=0.02)
> x
[1] -1.00 -0.98 -0.96 -0.94 -0.92 -0.90 -0.88 -0.86 -0.84 -0.82 -0.80 -0.78
[13] -0.76 -0.74 -0.72 -0.70 -0.68 -0.66 -0.64 -0.62 -0.60 -0.58 -0.56 -0.54
[25] -0.52 -0.50 -0.48 -0.46 -0.44 -0.42 -0.40 -0.38 -0.36 -0.34 -0.32 -0.30
[37] -0.28 -0.26 -0.24 -0.22 -0.20 -0.18 -0.16
2011 Aug 27
1
Overdispersed GLM
Hi all,
I have the following data:
rep1_treat rep2_treat rep1_control rep2_control
2 3 4 5
100 20 98 54
0 1 2 3
23 32 27
2009 Dec 19
1
as.xts convert all my numeric data to character
Hello, all... I've been playing with the TTR package and quantmod, and I'm
loading the Chicago Board of Exchange put/call ratio data via a simple
read.csv call...
CBOEtotal<-read.csv(file="
http://www.cboe.com/publish/ScheduledTask/MktData/datahouse/totalpc.csv
",skip=1)
this gives me a data frame with columns....
> names(CBOEtotal)
[1] "Trade_date"
2007 Apr 11
1
Programming Problem (for loop, random # control, 3 dimentional graph)
Dear List,
This is just a programming problem which i cannot seem
to figure out. I am trying to get a set of power from
a test (say, kolmogorov smirnov) out of a distribution
(say, G-K distribution) as follows. I am trying to
reduce to pain of writing the whole set of data points
(p# below) using "for" loop. However, I seem to have
some problem in it as the output "M" does not
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 <-
2008 Feb 01
2
bug using matplot (PR#10676)
Full_Name: Anne CORI
Version: 2.6.1
OS: windows
Submission from: (NULL) (134.157.220.19)
let A be a mtrix with n lines and p columns, p>36 ;
matplot(A) will only draw the plot of the first 36 columns of A.
This is due to a bug in the definition of pch in the function :
pch <- c(paste(c(1:9, 0)), letters)[1:k]
should be replaced by
pch <- c(paste(c(1:9, 0)), letters)
I hope this
2011 Aug 24
4
Column of probabilities
Hi all,
I have a vector xm say: xm = c(1,2,3,4,5,5,5,6,6)
I want to return a vector with the corresponding probabilities based on the
amount of times the numbers occurred. For example, I should get the
following vector for xm:
prob.xm = c(1/9, 1/9, 1/9, 1/9, 3/9, 3/9, 3/9, 2/9, 2/9)
Any help greatly appreciated.
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2007 Jul 20
1
Column-mean-values for targeted rows
Hi all,
I'm handling massive data.frames and matrices in R (30000 x 400).
In the 1st column, say, I have 0s and 1s indicating rows that matter; other columns have probability values.
One simple task I would like to do would be to get the column mean values for signaled rows (the ones with 1)
As a very fresh "programmer" I have build a simple function in R which should not be very
2013 May 23
1
sample(c(0, 1)...) vs. rbinom
Greetings.? My wife is teaching an introductory stat class at UC Davis.? The
class emphasizes the use of simulations, rather than mathematics, to get
insight into statistics, and R is the mandated tool.?? A student in the class
recently inquired about different approaches to sampling from a binomial
distribution.? I've appended some code that exhibits the idea, the gist of
which is that using
2007 Jun 27
1
stepAIC on lm() where response is a matrix..
dear R users,
I have fit the lm() on a mtrix of responses.
i.e M1 = lm(cbind(R1,R2)~ X+Y+0). When i use
summary(M1), it shows details for R1 and R2
separately. Now i want to use stepAIC on these models.
But when i use stepAIC(M1) an error message comes
saying that dropterm.mlm is not implemented. What is
the way out to use stepAIC in such cases.
regards,
2012 Oct 06
3
vector is not assigned correctly in for loop
Hi there,
Here is a minimum working example:
----------------------------------------------------------------
lower = 0
upper = 1
n_bins = 50
interval = (upper - lower) / n_bins
bins = vector(mode="numeric", length=n_bins)
breaks = seq(from=lower + interval, to=upper, by=interval)
for(idx in breaks)
{
bins[idx / interval] = idx
}
print(bins)
2011 Jun 10
0
[LLVMdev] -fplugin-arg-dragonegg-enable-gcc-optzns status
Duncan,
Here are the complete benchmarks rerun against gcc 4.5.4 built with...
Using built-in specs.
COLLECT_GCC=gfortran-fsf-4.5
COLLECT_LTO_WRAPPER=/sw/lib/gcc4.5/libexec/gcc/x86_64-apple-darwin11.0.0/4.5.4/lto-wrapper
Target: x86_64-apple-darwin11.0.0
Configured with: ../gcc-4.5.4/configure --prefix=/sw --prefix=/sw/lib/gcc4.5 --mandir=/sw/share/man --infodir=/sw/lib/gcc4.5/info
2009 Sep 02
2
Normalized Y-axis for Histogram Density Plot
I have the following data which I tried to draw
the probability density plot.
Here is the code I have:
x <- read.table("mydat.txt");
d <- rep(x$V2,times=x$V3);
hist(d,probability=T, xlab="FlowSignal");
But why the y-axis range from 0 to 6,
instead of 0 to 1? What's the correct way to plot it?
#id flowsignal frequency
1 0.67 1
1 0.70 1
1
2011 Jun 09
3
[LLVMdev] -fplugin-arg-dragonegg-enable-gcc-optzns status
On Thu, Jun 09, 2011 at 03:44:40PM +0200, Duncan Sands wrote:
> Hi Jack, thanks for doing this.
>
>> Below are the tabulated compile times and executable sizes.
>>
>> A) gcc 4.5.4svn using -msse3 -ffast-math -O3 -fno-tree-vectorize
>> B) gcc 4.5.4svn/dragonegg using -msse3 -ffast-math -O3 -fno-tree-vectorize -fplugin-arg-dragonegg-enable-gcc-optzns
>> C)
2000 Feb 21
3
incompatibilities between 0.90 and 0.99?
Maybe this is dumb, but I seem to be having problems reading a file saved in R
v. 0.99 into R 0.90.1 (in a different machine).
I did
>save(test1, file="test1.RData")
then I tried to read that data file in R 0.90.1:
>load("test1.RData")
Error in load("test1.RData") : restore file corrupted -- no data loaded
More info:
- both machines are running Linux;
2006 Oct 20
6
summing elements in a list of functions
Dear all,
I have looked for an answer for a couple of days, but can't come with any
solution.
I have a set of functions, say:
> t0 <- function(x) {1}
> t1 <- function(x) {x}
> t2 <- function(x) {x^2}
> t3 <- function(x) {x^3}
I would like to find a way to add up the previous 4 functions and obtain a new
function:
> rrr <- function(x) {1+x+x^2+x^3}
without,
2006 Mar 11
2
weird! QDA does not depend on priors?
Hi all,
If I run LDA on the same data (2-class classification) with default(no
priors specified in the lda function) vs. "prior=c(0.5, 0.5)", the results
are different.
The (0.5, 0.5) priors give better 1-classify-to-1 rate, and the proportional
priors(default, no priors specified in the lda function) give better
0-classify-to-0 rate, for both training and testing data sets.
However,
2011 Sep 26
1
compute probabilities on a Bayesian Network
Deal R Users,
I'm trying to find out how can I compute probabilities on a Bayesian
Network using R. The Bayesian Network I modelled is shown at
http://www.dsr.inpe.br/~mello/1727/BNgrapmodel.png and I'd like to know
how can I proceed (commands on R) to answer questions like: (1) what is
the probability of S=T given C=T, L=T, R=F, H=F and D=F; or (2) what is
the probability of S=T
2010 Dec 09
1
Extremely poor write performance, but read appears to be okay
Hello,
I'm writing from the otherside of the world from where my systems are,
so details are coming in slow. We have a 6TB OCFS2 volume across 20 or
so nodes all running OEL5.4 running ocfs2-1.4.4. The system has worked
fairly well for the last 6-8 months. Something has happened over the
last few weeks which has driven write performance nearly to a halt.
I'm not sure how to proceed, and