similar to: extracting more information from optim in R?

Displaying 20 results from an estimated 2000 matches similar to: "extracting more information from optim in R?"

2010 Sep 30
1
R 2.11.1 crashes
Dear R community, I was using R 2.11.1 without internet connection on Windows XP and whenever I type ?mean for example, R would freeze and crash out... Is this something that can be fixed? I would like to use the internel help file if possible... Thanks. ########################################### Assistant Professor Steve Su School of Mathematics and Statistics Faculty of Engineering,
2016 Jan 12
0
On 'R CMD INSTALL' with multiple architectures
G'day all, I guess it is still early enough in the year to wish everybody a happy and successful new year. I thought I should report that the installation of the CRAN package rstan regularly fails on my machine (a 64 bit linux box running Xubuntu 15.10). The reason being that I have the 32-bit and the 64-bit architecture of R installed, and my /tmp file is on a partition with about 1Gb
2008 Oct 22
1
optim bug/help?
In the documentation for 'optim' it gives the following function: fr <- function(x) { ## Rosenbrock Banana function x1 <- x[1] x2 <- x[2] 100 * (x2 - x1 * x1)^2 + (1 - x1)^2 } optim(c(-1.2,1), fr) When I run this code I get: $par [1] 1.000260 1.000506 I am sure I am missing something but why isn't 1,1 a better answer? If I plug 1,1 in the function it seems
2011 Jun 24
4
How to capture console output in a numeric format
Hi, I would like to know how to capture the console output from running an algorithm for further analysis. I can capture this using capture.output() but that yields a character vector. I would like to extract the actual numeric values. Here is an example of what I am trying to do. fr <- function(x) { ## Rosenbrock Banana function on.exit(print(f)) x1 <- x[1] x2 <- x[2]
2013 Mar 01
0
Extracting coefficients of covariates in a LME-model
Hi all, I have created a linear mixed-effects model using lmer. My dependent variable is comp.score and my main independent variable is delay.type, a repeated-measures within-subject variable (2 levels: Synch and Asynch, order counter-balanced across participants). I had a series of covariates that were included in the initial model and used a step-wise process to produce the most parsimonious
2003 Oct 29
1
constrOptim doesn´t send arguments to optim!(?)
Hi, I think that there something wrong with the 'constrOptim' max/minimization function because she doesn?t send extra arguments to 'optim' call. Fact: When I use optim in a f(x,theta)-like function, everything goes ok. But using constrOptim with the same function leads to error... Proof: Make a small change in the 'Rosenbrock Banana function' (taken from the Examples
2023 Aug 03
3
feature request: optim() iteration of functions that return multiple values
Dear all, I have used optim a lot in contexts where it would useful to be able to iterate function myfun that, in addition to the primary objective to be minimized ('minimize.me'), could return other values such as alternative metrics of the minimization, informative intermediate values from the calculations, etc. myfun <- function() { ... return(list(minimize.me = minimize.me, R2 =
2023 Aug 05
1
feature request: optim() iteration of functions that return multiple values
For a solution that does not require any change to the original function being optimized, the following one-liner could be used, which converts existing functions to functions that return only the first element: returnFirst <- function(fun) function(...) do.call(fun,list(...))[[1]] Example: fr <- function(x) { ## Rosenbrock Banana function x1 <- x[1] x2 <- x[2] ans
2003 Apr 28
2
sum(..., na.rm=TRUE) oddity
Hi all, I get two different results when using sum() and the switch na.rm. The result is correct when na.rm=FALSE. Linux Redhat 7.3, R version 1.6.1. I've had no luck searching the mail archives, so I was hoping somebody could explain/check this one for me. I will need to apply the function to missing data, simple as it is. Code: x<-matrix(runif(20,0,5)%/%1,4,5) # random matrix
2001 Jul 06
0
R 1.3 on iMacs (PR#1015)
Hi, I have been trying to run R 1.3 on a Lab of iMacs running system 9.0. It starts up fine but it wont accept any input from the keyboard. I can select commands and use the copy and paste menu option and this works. It works fine on my G4 running 9.04. Apart from having to install the latest carbonlib, is there anything else needed to get it running on system 9.0 on iMacs? If you don't
2002 Oct 28
0
re: problem installing library sm
Hi all, The suggestions were great. However, after installing readline-devel I had to install ncurses-devel before getting sm to work. Can this be put into the RH 7.3 Readme when downloading R rpms (and other distbns like Mandrake where there may be a similar problem)? Thanks for your help. Rohan Sadler -- Ecosystems Research Group (ERGO) School of Plant Biology (Botany), Faculty of
2003 Jan 22
1
re: box counting method and other landscape ecology measures
Hi all, I wish to implement various landscape ecology measures through R, such as: box counting dimension; twist number statistics; contagion and lacuniarity indices; angular second moment; adjacency measures; dominance indices; etc ... Some of the measures can be applied to shape analysis and classification. Is anyone implementing any of these measures? If so I would like to contribute and
2003 Aug 21
1
R is mentioned on Linux Today
Hi all, people who don't follow Linux Today regularly may want to check out: http://linuxtoday.com/developer/2003082000626OSSVDV My apologies if this is considered spam. Cheers, Berwin ========================== Full address ============================ Berwin A Turlach Tel.: +61 (8) 9380 3338 (secr) School of Mathematics and Statistics +61
2004 Jul 14
2
constrOptim and function with additional parameters?
How can I use a function with some additional input parameters in constrOptim? For example, something like fr <- function(x,a) { ## Rosenbrock Banana function x1 <- x[1] x2 <- x[2] a * (x2 - x1 * x1)^2 + (1 - x1)^2 } where the optimum is to be found w.r.t. x. Calling optim(c(-1.2,1), fr, NULL, a=100) works as expected, but I fail to provide the a=100 in the constrained case:
2008 Dec 09
1
errors with compilation
Hi, i'm trying to compile R on a Cray XT3 using pgi/7.2.1 - CNL (compute node linux) The R version is 2.8.0 this is the option -enable-R-static-lib=yes --disable-R-shlib CPICFLAGS=fpic FPICFLAGS=fpic CXXPICFLAGS=fpic SHLIB_LDFLAGS=shared --with-x=no SHLIB_CXXLDFLAGS=shared --disable-BLAS-shlib CFLAGS="-g -O2 -Kieee" FFLAGS="-g -O2 -Kieee" CXXFLAGS="-g -O2
2004 Jun 11
2
tcp wrappers?
How can I secure dovecot listening on port 143 to specific machines only? Squirrelmail suggests using non-ssl if the imap daemon is on the same host... Otherwise squirrelmail could use TLS but what about other clients wanting to use SSL on port 993? (sorry I don't know enough about TLS). Thanks, Roman. -- ______________________________________________________________________ Roman
2009 Jan 05
0
getResponse(model.lme) yields incorrect number of dimensions error
Dear R experts, I would like to get an R^2 - like value for a multilevel regression using lme. I followed an archived suggestion by José Pinheiro to use the squared correlation between fitted and observed values, i.e., (cor(fitted(model.lme), getResponse(model.lme))^2 but getResponse returns the error message Error in val[, level] : incorrect number of dimensions The same happens with
2005 Mar 29
1
improved pairs.formula?
Dear all, I would like to suggest changing the pairs.formula command such that a command like pairs(GNP ~ . - Year - GNP.deflator, longley) would behave in a similar fashion as lm(GNP ~ . - Year - GNP.deflator, longley) i.e., make a pairwise scatterplot of GNP and all other variables in the (longley) dataframe except for Year and GNP.deflator. The above command, with the
2011 Oct 12
2
p adjustment on 4thcorner results
Hi all, This is probably a very simple question but I cannot figure out how to do it. I run the fourthcorner method with my data and would like to adjust the p values for multiple comparisons using Holm correction. When I run the fourthcorner I obtain the results in yellow. What do I need to do to be able to aply the Holm correction to those p values? > library(ade4) > four1 <-
2010 Oct 19
1
Doubt on using lattice
Hi all, I suppose this is a very simple question, but as I've lost already a bit of time with it, without being able to get what I wanted, I'm addressing the question to the group in the hope someone can help me. I pretend to plot the richness of herbaceous species (RichHN) as a function of time since remnant isolation (Isol) conditioned to the area of the remnant (fArea - this is a