Displaying 20 results from an estimated 6000 matches similar to: "arrow on contour line"
2011 Feb 22
1
Discrepancies in run times
Dear R-users,
I am in the process of creating new custom functions and am quite puzzled by
some discrepancies in execution time when I run some R scripts that call
those new functions. So here is the situation:
- let's assume I have created two custom functions, called myg and myf;
- myg is mostly a plotting function, which makes a heavy use of grid and
lattice functions;
- myf is a function
2012 Nov 08
1
A panel of contour plots through a iteration process
Dear all,
as you can see from the code I want to create *a panel of 11 contour
plots through
a iteration process*. I found a thread that address the issue of plotting
many contour.plots in the same device, but it does not address my problem!
I emphasize that the 11 contour plots must be appeared in the same device
through an iteration process and NOT individually!
par(mfrow=c(4,3)) # I want them
2007 Oct 24
3
how to loop over a group of variables?
Hi All,
I have a data frame with a group of variables named b1, b2, b3, ..., b18. These variables take the value 1, 2 or NA. For each observation, I want to do some computation by looping over the values for the group of variables: b1 to b18. In STATA I would do:
forval i=1/18 {
--- use b`i' for computation ----
}
How can this be done in R?
Deepankar
2006 Dec 19
4
Upgrading
Hi!
As per Thomas' advice, I upgraded R by using "update.packages()" and got the following warning messages:
Warning messages:
1: installation of package 'lmtest' had non-zero exit status in: install.packages(update[, "Package"], instlib, contriburl = contriburl,
2: installation of package 'quadprog' had non-zero exit status in: install.packages(update[,
2007 Apr 23
4
Estimates at each iteration of optim()?
I am trying to maximise a complicated loglikelihood function with the "optim" command. Is there some way to get to know the estiamtes at each iteration? When I put "control=list(trace=TRUE)" as an option in "optim", I just got the initial and final values of the loglikelihood, number of iterations and whether the routine has converged or not. I need to know the
2007 Nov 06
4
C++ and R interface
Hi All,
I am trying to do an ML estimation in R. My likelihood function has
several nested loops and so it takes a lot of time (days when I use the
genetic algorithm for optimization) for the optimization to finish.
Unable to avoid loops, I am thinking of writing the likelihood function
in C++ and calling it from within R when using *optim()*. I found that
one can call C functions (once they have
2009 Feb 27
3
question about 3-d plot
Hi R Users,
I have produced a simulated scatter plot of y versus x tightly clustered
around the 45 degree line through the origin with the following code:
x <- seq(1,100)
y <- x+rnorm(100,0,10)
plot(x,y,col="blue")
abline(0,1)
Is there some way to generate a 3-dimensional analogue of this? Can I get a
similar simulated scatter plot of points in 3 dimensions where the points
2007 Apr 19
3
Problem installing packages
I tried to install the package "tseries" but could not do so. Any
suggestions are welcome. I am using Ubuntu Linux and here is what I did:
$ sudo R
Then once in R, I did
> install.packages("tseries", dep=TRUE)
which gave a long list of errors. Going through them, I saw that the
basic problem was that the package "grid" was not found by the packages
(like
2008 Feb 17
2
filled.contour with log axis
Dear all,
I would like to generate a filled.contour plot with log x and y axis,
however using:
filled.contour(as.line,log="xy")
results in a warning message.
Does anybody knos what to do?
Thanks
Thomas
2007 Apr 18
3
Problems in programming a simple likelihood
As part of carrying out a complicated maximum likelihood estimation, I
am trying to learn to program likelihoods in R. I started with a simple
probit model but am unable to get the code to work. Any help or
suggestions are most welcome. I give my code below:
************************************
mlogl <- function(mu, y, X) {
n <- nrow(X)
zeta <- X%*%mu
llik <- 0
for (i in 1:n) {
if
2006 Jul 18
2
FW: Large datasets in R
Hi,
I have two further comments/questions about large datasets in R.
1. Does R's ability to handle large datasets depend on the operating
system's use of virtual memory? In theory, at least, VM should make the
difference between installed RAM and virtual memory on a hard drive
primarily a determinant of how fast R will calculate rather than whether or
not it can do the calculations.
2006 Dec 19
2
attach and object masking
Hi R users!
I am new to R. When I try to attach a simple dataset using the attach() command, I get the following message:
> attach(data1)
The following object(s) are masked from package:base :
write
Can someone tell me what this means? (`write' is the name of a variable in the dataset). And, do I need to do do something about this.
Thanks.
2007 Oct 26
1
finding birth position
Hi All,
I have data on the sequence of births for families with completed
fertility cycle (in a data frame); the relevant variables are called b1,
b2, b3, b4, b5, b6 and record the birth of the first, second, ..., sixth
child. So,
b1=1 if the first birth is male,
b1=2 if the first birth is female,
and b1=NA if the family did not record any first birth.
Similarly for b2, b3, b4, b5 and b6.
I
2007 May 24
3
Problem with numerical integration and optimization with BFGS
Hi R users,
I have a couple of questions about some problems that I am facing with
regard to numerical integration and optimization of likelihood
functions. Let me provide a little background information: I am trying
to do maximum likelihood estimation of an econometric model that I have
developed recently. I estimate the parameters of the model using the
monthly US unemployment rate series
2008 Aug 05
1
Add arrows to a filled.contour margin
Hi,
I try to put an arrow to a filled.contour plot. I make this:
filled.contour(volcano, color = terrain.colors,key.axes=F)
arrows(0.95,0,0.95,1,lwd=2)
This work, but the problem is that I find the coordinates at random try, for
other graphic with other scale is other fight with coordinates. Anybody know
a more easy or more generalized way to make this? Somethink like this
2010 May 06
1
question about rolling regressions
Hi All,
I am using R 2.11.0 on a Ubuntu machine. I have a time series data set and
want to run rolling regressions with it. Any suggestions would be useful.
Here are the details:
(1) I convert relevant variables into time series objects and compute first
differences:
vad <- ts(data$ALLGVA/data$GDPDEF, start=1948, frequency=1)
emp <- ts(data$ALLEMP, start=1948, frequency=1)
vad.dif1 <-
2007 Sep 27
3
Plotting from different data sources on the same plot (with ggplot2)
Hello everyone (and Hadley in particular),
I often need to plot data from multiple datasets on the same graph. A
common example is when mapping some values: I want to plot the
underlying map and then add the points. I currently do it with base
graphics, by recording the maximum region in which my map+point will
fit, plotting both with these xlim and ylim parameters, adding par
(new=T)
2010 Jul 22
3
Hydrology plots in R
Hello,
I am trying to create a plot often seen in hydrodynamic work than includes a
contour plot representing the water speed with arrows pointing in the
direction of flow. Does anyone have any idea how I might add arrows based on
wf$angle (in the example below) to the plot below?
Thanks in advance!
Sam
library(lattice)
speed <- runif(100, 0, 20)
wf <- data.frame(speed)
wf$width <-
2010 May 02
1
question about 2SLS
Hi All,
I am using R 2.11.0 on a Ubuntu machine. I estimated a model using "tsls"
from the package "sem". Is there a way to get Newey West standard errors for
the parameter estimates?
When estimating the model by OLS, I used "NeweyWest" from the package
"sandwich" to get HAC standard errors. But, I am not able to use the same
method with the results of the
2011 Feb 15
1
ternary contour plot
Colin,
If your propose is to create a ternary plot with points and vectors, I think easier do this with graphics based plots instead of trellis based plots. Although, with little work you can do with trellis too. I gave you a reproducible code to put an arrow in a ternary plot. I use the function locator() to extract coordinates. The code is the following