Displaying 20 results from an estimated 2000 matches similar to: "optimization subject to constraints"
2010 Aug 10
1
[Fwd: Re: optimization subject to constraints]
-------------- next part --------------
An embedded message was scrubbed...
From: Gildas Mazo <gildas.mazo at curie.fr>
Subject: Re: [R] optimization subject to constraints
Date: Tue, 10 Aug 2010 15:49:19 +0200
Size: 4924
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100810/78862894/attachment.eml>
2010 Apr 28
1
function which saves an image of a dgtMatrix as png
Hi,
I'm getting crazy:
This does work:
library(Matrix)
a1<-b1<-c(1,2)
c1<-rnorm(2)
aDgt<-spMatrix(ncol=3,nrow=3,i=a1,j=b1,x=c1)
png("myImage.png")
image(aDgt)
dev.off()
But this doesn't !!!
f<-function(x){
png("myImage.png")
image(x)
dev.off()
}
f(aDgt)
My image is saved as a text file and contains nothing at all !!!
Thanks in advance,
Gildas Mazo
2010 Jul 22
4
SQL/R
Dear R users,
I want to aggregate data in the following way:
###
X <- data.frame(u = c("T1","T1","T1","T2"), v=c("a","a","b","a"))
X
library(sqldf)
sqlOut <- sqldf("select count(distinct(v)) from X group by u")
sqlOut
###
Now I want to get the same result without using SQL. How can I achieve
that ?
2010 Jun 04
2
Build Design Matrix with avoiding loops
Dear R users,
I'd like to build a simple design matrix in a efficient way. I naively
wrote the code below.
####
n = 15
k = 3
nbPerGrp = c(5,5,5)
xT <- list()
for (i in 1:k){
xT[[i]] <- rep(0, k)
xT[[i]][i] <- 1
}
X <- matrix(nrow = n, ncol = k) #design matrix
for (i in 1:nbPerGrp[1]){
X[i,] <- xT[[1]]
}
for (i in 1:k-1){
for (j
2012 Mar 06
2
Numerical Inversion of Cumulative Distribution Function
Dear R users,
Given a user-defined cumulative distribution function F, I want to compute F^{-1}(x). How is that possible with R?
Best Regards,
--
Gildas Mazo
PhD student
MISTIS team at INRIA
Grenoble, France
[[alternative HTML version deleted]]
2012 Sep 20
1
optim and "the function should not" advice
Dear R users,
I'm using optim to optimize a pretty complicated function. This function takes the parameter vector "theta" and within its body I use instructions like
sigma<-theta[a:b]; computations with sigma...
out<-c()
for (i in 1:d){
a<-theta[(3*d+i):c]
out[i]<-evaluation of an expression involving 'a' (I use symbolic differentiation)
}
Unfortunately
2012 Mar 22
4
Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!
Hello All,
Want very much to learn how to plot patient drug timelines. Trouble is I need to figure out how to do this today. So not much time for me to struggle with it. Hoping someone can just help me out a bit.
Below are some sample data and code that produces what I think is the beginning of a very nice graph.
Need to alter the code to:
1. Get the lines for the drugs to appear on the
2010 Mar 25
3
Absolutely No idea how to plot my Spatial Data
Hi,
I have a data set of points which are represented by 3 variables x,y,z where
x is the position of the point on the x-absciss and y on the y-absciss. Each
of my points has a value z, which I want to be displayed as follows: the
more z is high, the more the color on the map is dark.
How can I achieve this ?
Thanks for your help
--
View this message in context:
2008 Mar 05
6
box-constrained
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20080305/80536e8c/attachment.pl
2007 Jun 27
3
Import from excel
Hello,
I have imported data from Excel using the command
cours=read.delim("w:/apprentissage/cours_2.txt")
after transforming my initial file with tab delimiters
It seemed to work
It is 2-dimensionnal. When I type cours[5,5],
I get this type of message : "[1] 0,9760942761824 Levels: 0,495628477 0,893728761 0,89640592 0,903398558 ... 3,864414217"
And when I want to
2010 May 04
4
timing a function
Hi,
I want to time how long a function takes to execute. Any clues on what to
search for to achieve this?
Thanks in advance.
--
View this message in context: http://r.789695.n4.nabble.com/timing-a-function-tp2126319p2126319.html
Sent from the R help mailing list archive at Nabble.com.
2007 Feb 28
4
PROC TABULATE with R
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20070228/6ebce030/attachment.pl
2008 Apr 25
4
Constructing dummy variables for months for a time series object
I have a TS of monthly observations.
head(data4)
1991(1) 1991(2) 1991(3) 1991(4) 1991(5) 1991(6)
12.00864 11.94203 11.98386 12.01900 12.19226 12.15488
Now I want to make 11 dummy variables indicating months. Therefore I did followings :
For Jan :
rep(c(rep(0,0), 1, rep(0, 11)), 17)
For Feb :
rep(c(rep(0,1), 1, rep(0, 10)), 17)
........ and so on
But my
2010 Dec 13
7
descriptive statistics
Hi. In a data set I have a variable that takes values from 1 to 14. For each
subgroup of values of this variable, I would like to obtain some descriptive
statistics of other variables present in the data set. I've been trying with
a "for" loop but I couldn't get nothing. Could you please suggest me some
lines?
--
View this message in context:
2008 May 23
3
extracting columns from a list
Dear all,
i have 2 lists of data with each of the list contain 14 columns. How am i going to extract column 12 and 13 from each of the list ?? and can i combine my extracted columns to form a single list. Attach with are my data. Your coorperation is highly appreciated. Many thanks
Regards,
Anisah
-------------- next part --------------
An embedded and charset-unspecified
2008 Mar 04
6
vector manipulations
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20080304/9de37092/attachment.pl
2011 Feb 17
7
removing lower and upper quantiles from an arry
I'm trying to work out the simplest way to remove the upper and lower quantiles, in this case upper and lower 25% from an array. I can do it in two steps but when I try it in one, it fails. Is there something simple missing from my syntax or are there other simple elegant way to accomplish this?
Thanks
J
> i <-1:20
> i2 <- i[i<quantile(i,.75)]
> i3 <-
2010 Aug 19
6
R reports
I don't see much in the way of an ability to write reports in R the way you
can with SAS. You basically have to write a program with R in a 3G way
unlike SAS with it's 4G proc print and proc report.
Are there similar R functions and packages?
--
View this message in context: http://r.789695.n4.nabble.com/R-reports-tp2330733p2330733.html
Sent from the R help mailing list archive at
2012 Jun 14
3
p-values from lm()
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt.
Name: nicht verf?gbar
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120614/e05ae92c/attachment.pl>
2010 Jul 30
2
svydesign syntax and deviance!
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100731/ac3b9e43/attachment.pl>