similar to: legend help

Displaying 20 results from an estimated 6000 matches similar to: "legend help"

2013 Mar 28
3
problem with plots with short example.
i am having problem running my own data. yesterday it was working just fine. today it is not. this is the code i was using as an example to follow. this code ALSO worked just fine yesterday, and is no longer working at all. i suspect it is a problem with either my computer or the software, at this point. if THIS won't even run.... something is wrong. i can assure you this isn't
2011 Sep 19
2
Poisson-Gamma computation (parameters and likelihood)
Good afternoon/morning readers. This is the first time I am trying to run some Bayesian computation in R, and am experiencing a few problems. I am working on a Poisson model for cancer rates which has a conjugate Gamma prior. 1) The first question is precisely how I work out the parameters. #Suppose I assign values to theta with *seq()* *theta<-seq(0,1,len=500)* #Then I try out the
2009 Apr 12
3
p-values from bootstrap - what am I not understanding?
Dear stats experts: Me and my little brain must be missing something regarding bootstrapping. I understand how to get a 95%CI and how to hypothesis test using bootstrapping (e.g., reject or not the null). However, I'd also like to get a p-value from it, and to me this seems simple, but it seems no-one does what I would like to do to get a p-value, which suggests I'm not understanding
2006 Apr 05
2
R2WinBUGS error
Dear R-help, I'm using the R2WinBUGS package and getting an error message: Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open file 'codaIndex.txt', reason 'No such file or directory' I'm using R 2.2.1 and WinBUGS 1.4.1 on a windows machine (XP). My R code and WinBUGS code is given below.
2010 Sep 02
1
Help on glm and optim
Dear all, I'm trying to use the "optim" function to replicate the results from the "glm" using an example from the help page of "glm", but I could not get the "optim" function to work. Would you please point out where I did wrong? Thanks a lot. The following is the code: # Step 1: fit the glm clotting <- data.frame( u =
2005 Nov 15
1
An optim() mystery.
I have a Master's student working on a project which involves estimating parameters of a certain model via maximum likelihood, with the maximization being done via optim(). A phenomenon has occurred which I am at a loss to explain. If we use certain pairs of starting values for optim(), it simply returns those values as the ``optimal'' values, although they are definitely not
2003 Aug 20
2
Method of L-BFGS-B of optim evaluate function outside of box constraints
Hi, R guys: I'm using L-BFGS-B method of optim for minimization problem. My function called besselI function which need non-negative parameter and the besselI will overflow if the parameter is too large. So I set the constraint box which is reasonable for my problem. But the point outside the box was test, and I got error. My program and the error follows. This program depends on CircStats
2006 Nov 11
2
Bayesian question (problem using adapt)
In the following code I have created the posterior density for a Bayesian survival model with four parameters. However, when I try to use the adapt function to perform integration in four dimensions (on my old version of R I get an error message saying that I have applied a non-function, although the function does work when I type kernel2(param0, theta0), or on the newer version of R the computer
2011 May 27
1
Error with BRugs 0.53 and 0.71, on Win7 with R 2.12.2 and 2.13.0 (crashes R GUI)
I've run into persistent problems with OpenBUGS crashing when using BRugs .53 and .71, and am hoping someone has suggestions. There is obviously something unusual going on in my environment, but I'm at a loss as to where to begin to try to solve it. In a nutshell, what happens is that, as soon as I call "modelCheck()" in BRugs, it gets an error or crashes ... but only some of
2011 Aug 17
2
An example of very slow computation
This message is about a curious difference in timing between two ways of computing the same function. One uses expm, so is expected to be a bit slower, but "a bit" turned out to be a factor of >1000. The code is below. We would be grateful if anyone can point out any egregious bad practice in our code, or enlighten us on why one approach is so much slower than the other. The problem
2010 Feb 21
1
how do I get the legend?
http://en.wikipedia.org/wiki/Binomial_distribution Bino Hi there, How can I get the legend in the probability density plot in that http://en.wikipedia.org/wiki/File:Binomial_distribution_pmf.svg wiki page ? and the cumalative plot as well? ==================================== # Binomial Distribution x=0:40
2011 Dec 01
1
Estimation of AR(1) Model with Markov Switching
Dear R users, I have been trying to obtain the MLE of the following model state 0: y_t = 2 + 0.5 * y_{t-1} + e_t state 1: y_t = 0.5 + 0.9 * y_{t-1} + e_t where e_t ~ iidN(0,1) transition probability between states is 0.2 I've generated some fake data and tried to estimate the parameters using the constrOptim() function but I can't get sensible answers using it. I've tried using
2012 May 16
3
triangular matrices input/output
Hi, Is there any package that deals with triangular matrices? Say ways of inputting an upper (lower) triangular matrix? Or convert a vector of length 6 to an upper (lower) triangular matrix (by row/column)? Thanks! ----- ###################### PhD candidate in Statistics Big R Fan Big LEGO Fan Big sTaTs Fan ###################### -- View this message in context:
2013 Apr 09
5
Error when using fitdist function in R
Hello everyone, I was trying to do some distribution fitting with a numerical field called Tolls. The sample size = 999 rows. Basically I assigned the Toll data to a new variable K by doing: k<-dtest$Toll After that, tried to fit a gamma distribution by doing: fitG<-fitdist(k, "gamma") Then the following messages showed (oh and I checked for empty rows before doing this):
2003 Aug 22
1
Substitute in legend
I tried to use substitute in legend as follows: pval <- 0.04 plot(0) legend(1,0.5,substitute(hat(theta) == p, list(p = pval))) For some reason the legend is repeated 3 times. Any suggestions or is this a bug?
2012 Feb 09
1
Constraint on one of parameters.
Dear all, I have a function to optimize for a set of parameters and want to set a constraint on only one parameter. Here is my function. What I want to do is estimate the parameters of a bivariate normal distribution where the correlation has to be between -1 and 1. Would you please advise how to revise it? ex=function(s,prob,theta1,theta,xa,xb,xc,xd,t,delta) { expo1=
2011 Sep 11
2
how to quote "factors" in a function?
### code ### x=sample(LETTERS[1:26],100,T) prob=function(y){ count=sum(x==y) total=length(x) count/total } ### end ### How do I quote the letters A,B,C,D ect, in order to make the "prob" function return the weights of the desired Letter? Thanks! -- View this message in context:
2010 Dec 18
3
use of 'apply' for 'hist'
Hi all, ########################################## dof=c(1,2,4,8,16,32) Q5=matrix(rt(100,dof),100,6,T,dimnames=list(NULL,dof)) par(mfrow=c(2,6)) apply(Q5,2,hist) myf=function(x){ qqnorm(x);qqline(x) } apply(Q5,2,myf) ########################################## These looks ok. However, I would like to achieve more. Apart from using a loop, is there are fast way to 'add' the titles to be
2009 Sep 25
1
Problem with dgamma function.
Hi, All, I am getting some funny results trying to use R's built in distribution functions. In R: > dgamma(4.775972,1.37697964405418, 0.106516604930466) [1] 0.05585295 > dgamma(4.775972,1.37697964405418, 0.106516604930466,TRUE) ### THIS IS JUST WRONG! [1] 0.01710129 > log(dgamma(4.775972,1.37697964405418, 0.106516604930466)) [1] -2.885033 > In C:
2007 Apr 23
2
Problem with dgamma ?
Hi All, Here 's what I got using dgamma function : > nu<-.2 > nu*log(nu)-log(gamma(nu))+(nu-1)*log(1)-nu*(1) [1] -2.045951 > dgamma(1,nu,nu,1) [1] 0.0801333 > dgamma(1,nu,nu,0) [1] NaN Warning message: NaNs produced in: dgamma(x, shape, scale, log) Could anyone tell me what is wrong here ? I am using R-2.4.1 on windows XP. Thanks a lot.