similar to: Multi-dimensional function.

Displaying 20 results from an estimated 9000 matches similar to: "Multi-dimensional function."

2007 Apr 06
4
Computing the rank of a matrix.
Hi! Maybe this is a silly question, but I need the column rank (http://en.wikipedia.org/wiki/Rank_matrix) of a matrix and R function 'rank()' only gives me the ordering of the elements of my matrix. How can I compute the column rank of a matrix? Is there not an R equivalent to Matlab's 'rank()'? I've been browsing for a time now and I can't find anything, so any
2007 Sep 11
5
Percentiles in R
Hi there! Still struggling to translate Matlab code into R's tsDyn package. Here is my question: Is there in R an equivalent function to Matlab's prctile()? To the moment I thought it was quantile(), but I just realized I was wrong. The definition of the Matlab function: prctile Percentiles of a sample SyntaxY = prctile(X,p) Description Y = prctile(X,p) calculates a value that is
2008 Sep 30
1
ordering problem
Hi there! I need some assistance here with vector orderings. I have a set of q vectors of length p, grouped by rows in a matrix A, q?p, that I need to order lexicographically (http://en.wikipedia.org/wiki/Lexicographical_order). I also have another matrix B, p?r, and a vector c, that should be ordered according to the order of A. So far, I was doing ordering <-
2008 Aug 28
3
Plots spanning columns
Hi! I want to plot three graphs (residuals, ACF and PACF of a model). Ideally I would use a c(2,2) disposition where the residuals plot would start at position 1,1 and span to position 1,2. Then I would plot the ACF in position 2,1 and the PACF in position 2,2. Maybe is clearer like this: -------------------------- | | | residuals | |
2008 Aug 15
2
Combination with repetition
Hi there! I can't find any information about creating combinations with repetitions in R. The function combn() does create combinations, but _without_ repetitions. Here is what I need to do: svIter <- 1000 xx <- matrix(rnorm(m*n), c(m, n)) sequence <- seq(range(xx)[1], range(xx)[2], length.out = svIter^(1/q)) expand.grid(secuence, secuence, .../q times/..., secuence) That is,
2007 Mar 26
5
Developer work cycle
Hi! I've been browsing through the last months' archive and I can't find an answer to my question, so here it is (let's hope it's not too obvious): I'm working on extensions of an R library, and I would be very surprised if everyone developing R packages is doing the following, as I do: 1.- Write down a modification of an R file 2.- Exit the current R
2007 Sep 07
2
Matlab's lsqnonlin
Hi! I'm translating some code from Matlab to R and I found a problem. I need to translate Matlab's function 'lsqnonlin' (http://www-ccs.ucsd.edu/matlab/toolbox/optim/lsqnonlin.html) into R, and at the beginning I thought it would be the same as R's 'optim'. But then I looked at the definition of 'lsqnonlin' and I don't quite see how to make
2007 Sep 27
1
A matrix multiplication
Dear all, I'm having trouble using the 'apply' function to multiply some arrays. Let A be a 500x2 array and B a 500x3 array. I need a vector C which has 6 columns being the first three the result of A[,1] * B and the second three the result of A[,2] * B. What is the most efficient way to express that? I'm trying to use 'apply' with no success... Thanks for your
2012 May 03
1
overlapping confidence bands for predicted probabilities from a logistic model
Dear list, I'm a bit perplexed why the 95% confidence bands for the predicted probabilities for units where x=0 and x=1 overlap in the following instance. I've simulated binary data to which I've then fitted a simple logistic regression model, with one covariate, and the coefficient on x is statistically significant at the 0.05 level. I've then used two different methods to
2011 May 05
7
Draw a nomogram after glm
Hi all R users I did a logistic regression with my binary variable Y (0/1) and 2 explanatory variables. Now I try to draw my nomogram with predictive value. I visited the help of R but I have problem to understand well the example. When I use glm fonction, I have a problem, thus I use lrm. My code is: modele<-lrm(Y~L+P,data=donnee) fun<- function(x) plogis(x-modele$coef[1]+modele$coef[2])
2009 Feb 04
2
overlay plot question
Greetings all, I have two logistic plots coming from two calls to plogis. The code is .x <- seq(-7.6, 7.6, length=100) plot(.x, plogis(.x, location=0, scale=1), xlab="x", ylab="Density", main="Logistic Distribution: location = 0, scale = 1", type="l") abline(h=0, col="gray") .y <- seq(-7.6, 7.6, length=100) plot(.x, plogis(.x,
2007 Sep 12
3
Passing parameters to 'optim' fn function
Hi again! I'm using the 'optim' method to fix the parameters of a model. I have written the function to be minimised and another function which returns the gradient of the error. Now my problem is that, in order to compute that gradient, it would be extremely convenient to be able to pass some parameters to the gradient function. I don't see how to do it given the fixed syntax
2008 Aug 14
3
extending the derivs table/fools rushing in
I added "plogis" to the derivative table in the development version of R; the patch against yesterday's R-devel src/deriv/main.c is available at http://www.zoology.ufl.edu/bolker/deriv_patch.txt . I pretty much followed the framework of the other symbols; here was my incantation - } else if (CAR(expr) == PlogisSymbol) { - ans = simplify(TimesSymbol, -
2008 Aug 21
1
pnmath compilation failure; dylib issue?
(1) ...need to speed up a monte-carlo sampling...any suggestions about how I can get R to use all 8 cores of a mac pro would be most useful and very appreciated... (2) spent the last few hours trying to get pnmath to compile under os- x 10.5.4... using gcc version 4.2.1 (Apple Inc. build 5553) as downloaded from CRAN, xcode 3.0... ...xcode 3.1 installed over top of above after
2005 Aug 22
1
How to add legend of plot.Design function (method=image)? (if (!.R.) )
Hi, When running z <- plot(fit, age=NA, cholesterol=NA, perim=boundaries, method='image') Legend(z, fun=plogis, at=qlogis(c(.01,.05,.1,.2,.3,.4,.5)), zlab='Probability') And after pointing the cursor to the plot() screen in R, I obtain the following message: Using function "locator(2)" to place opposite corners of image.legend Error in
2008 Nov 08
3
Fitting a modified logistic with glm?
Hi all, Where f(x) is a logistic function, I have data that follow: g(x) = f(x)*.5 + .5 How would you suggest I modify the standard glm(..., family='binomial') function to fit this? Here's an example of a clearly ill-advised attempt to simply use the standard glm(..., family='binomial') approach: ######## # First generate some data ######## #define the scale and location of
2010 Jul 31
3
I have a problem
dear£º in the example£¨nomogram£©£¬I don't understand the meanings of the program which have been marked by red line.And how to compile the program(L <- .4*(sex=='male') + .045*(age-50) + (log(cholesterol - 10)-5.2)*(-2*(sex=='female') + 2*(sex=='male'))). n <- 1000 # define sample size set.seed(17) # so can reproduce the results age <- rnorm(n, 50, 10)
2012 Oct 20
1
Logistic regression/Cut point? predict ??
I am new to R and I am trying to do a monte carlo simulation where I generate data and interject error then test various cut points; however, my output was garbage (at x equal zero, I did not get .50) I am basically testing the performance of classifiers. Here is the code: n <- 1000; # Sample size fitglm <- function(sigma,tau){ x <- rnorm(n,0,sigma) intercept <- 0 beta
2007 Feb 24
2
Depending on many packages: another best practice question
Dear all, ggplot currently requires 13 packages (grid, reshape, RColorBrewer, proto, splines, MASS, Hmisc, boot, butler, hexbin, mapproj, quantreg, sm). Some of these are absolutely necessary (eg. proto), but most are used for one or two specific tasks (eg. boot is only used to get plogis, used for logit scales). Do you think I should make them all "depends" packages, or
2005 Feb 20
1
logistic regression and 3PL model
Hello colleagues, This is a follow up to a question I posed in November regarding an analysis I was working on. Thank you to Dr. Brian Ripley and Dr. John Fox for helping me out during that time. I am conducting logistic regression on data set on psi (ESP) ganzfeld trials. The response variable is binary (correct/incorrect), with a 25% guessing base rate. Dr. Ripley suggested that I