Displaying 20 results from an estimated 500 matches similar to: "Powell's unconstrained derivative-free nonlinear least squares routine, VA05AD"
2004 Jan 09
0
minimization using Powell's method without derivative
Good evening! I have a multi-dimensional minimization problem whose
gradient is pretty hard to code. I tried Nelder and Mead method
implemented in function optim and it does not work well. I also tried
the quasi Newton method in optim using difference as approximate
derivative. It does not work well either. I just went through Numerical
Recipes book. The book discusses another method without
2006 Jan 15
1
Powell's Metod
Folks,
Has anyone implemented Powell's Method for minimisation in R ?
Many thanks,
Tolga
2008 Dec 23
1
Borders for rectangles in lattice plot key
Hopefully an easy question. When drawing a rectangles in a lattice plot
key, how do you omit the black borders?
Here is an example adapted from one on the xyplot help page:
bar.cols <- c("red", "blue")
key.list <- list(
space="top",
rectangles=list(col=bar.cols),
text=list(c("foo", "bar"))
)
barchart(
yield ~ variety | site,
2007 Dec 19
1
Different labels by panel in barchart
Dear all,
I'm analysing a survey, and creating a barchart of the different responses
for each question. The questions are grouped according to a number of
categories, so I'm using lattice to create a plot with each question in a
category on it. The problem is that the response set for different
questions within the same category varies. I want to be able to draw only
the relevant
2009 Jan 09
1
Saving plots as byte streams
Is it possible to save plots as byte streams? For example, if I want the
bytes for a PNG plot, I could use
#Write the plot to a PNG file
png("test.png")
plot(1:10)
dev.off()
#Read the bytes back in from the file
plotbytes <- readBin("test.png", "raw", n=2000)
Ideally, I'd like to avoid having to bother writing to the file in the
first place, and simply
2009 Jan 12
2
R2WinBUGS stopping execution
Apologies if this isn't acceptable for the general help list.
I'm running OpenBUGS model via the R2WinBUGS package interface, under
Windows. Is it possible to terminate running models, short of using the
Windows Task Manager to forcibly exit the program?
Regards,
Richie.
Mathematical Sciences Unit
HSL
------------------------------------------------------------------------
2008 May 06
1
Spacing between lattice panels
I'm trying to set up a lattice plot with two y-axes for each panel. (Yes,
I know that multiple y-axes are generally a bad idea; the graph is for
someone else and they want it that way.) I've used a custom
yscale.component in xyplot to achieve this:
myyscale.component <- function(...)
{
ans <- yscale.components.default(...)
ans$right <- ans$left
foo <-
2008 Sep 26
2
adjusting textsize and spacing in mosaic (vcd package)
I'm trying to find a way to change the font size in a mosaic plot (the
grid version, not the base graphics one).
Here's an example to demonstrate:
#Basic plot
library(vcd)
mosaic(HairEyeColor, shade = TRUE)
#Bad first guess: this stops the default cell colouring, and doesn't
change the font size
mosaic(HairEyeColor, shade = TRUE, gp=gpar(fontsize=16))
#This successfully changes
2009 Nov 16
2
n=1 default for random number generators
One tiny thing that would be very nice to have is a default value of n=1 in
the random number generator functions, enabling, e.g., runif() instead of
runif(1). This won't break anyone's existing code and ought to be
relatively straightforward to do.
Is there anyone in the core team who would be willing to include this
change?
-----
Regards,
Richie.
Mathematical Sciences Unit
HSL
--
2003 Sep 04
1
ANOVA/MANOVA
Hello,
I have to do an ANOVA (or is it a MANOVA) with 6 Variables (called HsL,
LsH, Hp, Lp, G, and) and 6 categories (OQ, Go, RC, AV, CC, Sk), the
examples in the literature couldn't help me so far. Who can help me??
Thank
Britta
2008 Sep 05
1
controlling lattice plot ticks with relation="free"
How do you persuade lattice to draw tick marks on both the left and right
side of the y-axis, when relation="free" in the scales component?
#Ticks appear on both sides
histogram(~height|voice.part, data=singer)
##Ticks only on left
histogram(~height|voice.part, data=singer,
scales=list(y=list(relation="free")))
Providing tck as a vector of length 2 doesn't seem to
2008 Oct 17
1
Using key.opts in Ecdf/labcurve (Hmisc package)
I'm presumably missing something very obvious, but how does one use the
key.opts argument in labcurve (via Ecdf)?
In this example, I want the key to be big and have a blue background, but
it isn't and doesn't.
ch <- rnorm(1000, 200, 40)
sex <- factor(sample(c('female','male'), 1000, TRUE))
Ecdf(~ch, group=sex, label.curves=list(keys=c("f",
2006 Oct 31
5
Odd behaviour of removing 'nothing' from an array or data frame
I've just found some behaviour which strikes me as odd, but I'm not sure
whether it's a bug or a feature. If you don't mind, I'd like to explain
via a couple of examples.
Let x = 1:10.
Then intuitively, to me at least, the command x[-integer(0)] should leave
x untouched. However the actual output under R2.4.0 is integer(0).
A slightly more involved example demonstrates
2010 Mar 15
1
map2poly - map lat/long cannot be unconstrained?
Using the maptools function "map2poly" I have created a map/polylist object
- a map of the Great Lakes. My goal is to passively plot additional data on
this map. Unfortunately I am not able to change (distort) the relative scale
of the axes for the map, and so the sample points do not line up correctly
on the map.
In the code below, notice that I have set the same axis ranges on each
2008 May 13
0
add horizontal line "(ABLINE(V=))" to xyplot lattice
> In a lattice plot like this:
>
> win.graph()
> xyplot(tmx~frequ|as.factor(as.numeric(spf)),groups=as.factor(blm),
> data=tmx,type="l",pch=16,xlab="frequency (N)",ylab="Area held (ha)",
> auto.key=list(blm,points=F,lines=T,title="Blm factor",cex.title=0.7,
> cex=0.7,corner=c(1,1)),main="Mangroves target=1573ha",layout=c(2,3))
2008 May 15
0
Function for subset of cases/lines
> I have a vector:
>
> q1<-c(4660,5621,5629,8030,8080,8180,8501,8190,8370,8200)
>
> The following command gives me the mean of its elements:
>
> mean(q1)
> [1] 7346.1
>
> What can I do to do the same for the variable 'height', but only for the
> cases/rows which have one of the elements of q1 as 'number':
>
> number height
> 1
2009 Jun 19
0
RGui Configuration Editor crashes when using an unlisted font
I am using R2.9.0 under Windows XP SP 2 (32-bit).
I just discovered a rather excellent programming font
(http://www.dafont.com/bitstream-vera-mono.font). Since it isn't one of
the fonts listed as an option in the RGui Configuration Editor, I manually
editted my RConsole file font line to
font = Bitstream Vera Sans Mono
When I opened R, the text in the console displayed correctly, but
2008 Sep 01
0
tryCatch
> I am trying to debug a program, and I think tryCatch will help. The
> functions involved
> process through so many times before I encounter the error, things
> are a bit slow to
> use debug and browser().
>
> I've read the help file and postings on conditions, and am still
> having trouble.
>
> While running my program I am getting a NAN from a called
2013 Feb 18
0
Computing Spectral Slope
Greetings,
I'm working on image classification and for that I want to use the spectral
slope as a feature for my classifier. For this I would prefer to calculate
this feature using R, so far I've read my image and converted it's RGB
representation into HSL. The spectral slope is computed over the Luminance
component, so at the moment what I have is a NxN matrix of Luminance values.
2007 Apr 27
0
Update of xlsReadWrite package
The (*windows only*) xlsReadWrite package has been updated and the new
version is available on CRAN.
xlsReadWrite natively reads and writes Excel files (v97 - 2003).
o Changes from v1.1.1 to v1.3.3 (versions between never really published)
- ROWNAMES-support also for matrices (not only for data.frame)
- explicit rowNames argument in interface.
(stimulated by email Adrian Dusa)
-