gmane.comp.lang.r.general
http://blog.gmane.org/gmane.comp.lang.r.general
hourly11901-01-01T00:00+00:00Gmanehttp://gmane.org/img/gmane-25t.png
http://gmane.org
General copula model with heterogeneous marginals
http://comments.gmane.org/gmane.comp.lang.r.general/326009
<pre>
I am looking to model the sum of a number of random variables with
arbitrary gamma distributions and an empirical dependence structure
that I obtain from data. Basically I observe all of the individual
pieces but I want to model their sum, as opposed to many copula
questions which observe a single outcome of a multivariate process and
seek to fit possible marginal and covariance structure.
It has been years since I coded in R, but this is what I have thus far:
library(copula)
library(scatterplot3d)
library(psych)
set.seed(1)
myCop<-
normalCopula(param=c(.1,.1,.1,.1,.1,.2,.2,.2,.2,.2,.2,.2,.4,.4,.4,.4,.4,.5,.5,.5,.5), dim=7,
dispstr="un")
myMvd<-mvdc(copula=myCop, margins=rep("gamma",7),
paramMargins=list(list(shape=3,scale=4),
list(shape=2, scale=5),
list(shape=2, scale=5),
list(shape=2, scale=5),
list(shape=2, scale=5),
list(shape=3, scale=5),
list(shape=3, scale=5)))
simulation<- rMvdc(20000,myMvd)
colnames(simulation)<-c("P1","P2","P3","P4","P5","P6","P7")
total = </pre>Justin Balthrop2015-11-30T15:19:59Extracting part of alpha numeric string
http://comments.gmane.org/gmane.comp.lang.r.general/325996
<pre>Hi,
I have a field with alpha numeric codes like,
2154333b-3208-4519-8b76-acaef5b5a479 980958a0-103b-4ba9-afaf-27b2f5c24e69
00966654-0dea-4899-b8cf-26e8300b262d
I want a derived field which will contain ONLY the numeric part before the
first alphabet and the first '-',
for example the derived field from the sample above will give me
2154333
980958
00966654
How can this be achieved in R?
P.S. I do not have much knowledge on regex. It would be of great help if
you could suggest some reading for beginners.
Thanks,
Abhinaba
[[alternative HTML version deleted]]
</pre>Abhinaba Roy2015-11-30T10:39:20[R-pkgs] New package: gpuR
http://comments.gmane.org/gmane.comp.lang.r.general/325994
<pre>R Users,
I am happy to inform you that my 'gpuR' package has just been accepted to
CRAN.
https://cran.r-project.org/web/packages/gpuR/index.html
The gpuR package is designed to provide simple to use functions for
leveraging GPU's for computing. Although there are a couple existing
packages for GPU's in R most are specific to NVIDIA GPU's and have very
limited and specific functions. The packaged is based on an OpenCL backend
in conjunction with the ViennaCL library (which is packaged within the
RViennaCL package). This allows the user to use almost any GPU (Intel,
AMD, or NVIDIA). It is my hope that these functions can be used to more
rapidly develop algorithms within R that can leverage GPUs.
The package is structured to use a few new S4 classes that retain the
object either on the host CPU or in GPU memory (thereby avoiding transfer
time). I have included a minimal introductory vignette describing the
package further, providing a simple use case, and listing currently
available functions.
https:/</pre>Charles Determan2015-11-23T13:10:09Extracing Unique Rows based on 2 Column
http://comments.gmane.org/gmane.comp.lang.r.general/325990
<pre>Dear group,
kindly, I have a data frame, as follows:
Measure_id i j value rank
1 1 2 3 2.0 1.0000000
2 1 5 1 2.0 1.0000000
3 1 2 1 1.5 0.7500000
4 1 5 2 1.5 0.7500000
5 1 7 3 1.5 1.0000000
6 1 2 4 1.0 0.5000000
7 1 7 5 1.0 0.6666667
8 2 5 2 2.5 1.0000000
9 2 2 1 2.0 1.0000000
10 2 2 4 2.0 1.0000000
.. ... . . ... ...
I want to select distinct rows based on two coulmn ( Measure_id and i )
for example for Measure_id = 1,2 the result would be....
1 1 2 3 2.0 1.0000000
2 1 5 1 2.0 1.0000000
5 1 7 3 1.5 1.0000000
8 2 5 2 2.5 1.0000000
9 2 2 1 2.0 1.0000000
kindly how I could do this?
example of the data frame are followed using dput.
dput(orderlist)
structure(list(Measure_id = c(1, 1, 1, 1, 1, 1, 1,</pre>Ragia Ibrahim2015-11-30T03:55:08Converting a matrix to an mcmc object
http://comments.gmane.org/gmane.comp.lang.r.general/325988
<pre>Dear List,
I am using R2jags and post process some mcmc objects to produce a new
object, which is currently a matrix, which replicates the shape of the
objects from which it is derived.
I want to produce a Gelman-Rubin graph from its (implied) three chains, but
I need to coerce the matrix into an mcmc object if I am to use gelman.plot
or gelman.diag from the R-package "coda".
(The various mcmc functions in "coda" seem to work in the other
direction.....)
Regards,
Margaret Donald
</pre>Margaret Donald2015-11-29T22:44:31Separating lines in ts.plot()?
http://comments.gmane.org/gmane.comp.lang.r.general/325986
<pre>I'm using ts.plot() to plot a matrix of time series (each column is a
ts).
What I noticed is that ts.plot() creates a lot of overlapping lines
which makes it difficult to distinguish different series.
What options exist for making the series more easily read?
</pre>mviljamaa2015-11-29T18:22:07Error in 'Contrasts<-' while using GBM.
http://comments.gmane.org/gmane.comp.lang.r.general/325983
<pre>Hey,
I was trying to implement Stochastic Gradient Boosting in R. Following is
my code in rstudio:
library(caret);
library(gbm);
library(plyr);
library(survival);
library(splines);
library(mlbench);
set.seed(35);
stack = read.csv("E:/Semester 3/BDA/PROJECT/Sample_SO.csv", head
=TRUE,sep=",");
dim(stack); #displaying dimensions of the dataset
#SPLITTING TRAINING AND TESTING SET
totraining <- createDataPartition(stack$ID, p = .6, list = FALSE);
training <- stack[ totraining,]
test <- stack[-totraining,]
#PARAMETER SETTING
t_control <- trainControl(method = "cv", number = 10);
# GLM
start <- proc.time();
glm = train(ID ~ ., data = training,
method = "gbm",
metric = "ROC",
trControl = t_control,
verbose = FALSE)
When I am compiling last line, I am getting following error:
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
Can anyone t</pre>Karteek Pradyumna Bulusu2015-11-29T03:04:46Error in Contrast
http://comments.gmane.org/gmane.comp.lang.r.general/325982
<pre>Hey,
I was trying to implement Stochastic Gradient Boosting in R. Following is my code in rstudio:
library(caret);
library(gbm);
library(plyr);
library(survival);
library(splines);
library(mlbench);
set.seed(35);
stack = read.csv("E:/Semester 3/BDA/PROJECT/Sample_SO.csv", head =TRUE,sep=",");
dim(stack); #displaying dimensions of the dataset
#SPLITTING TRAINING AND TESTING SET
totraining <- createDataPartition(stack$ID, p = .6, list = FALSE);
training <- stack[ totraining,]
test <- stack[-totraining,]
#PARAMETER SETTING
t_control <- trainControl(method = "cv", number = 10);
# GLM
start <- proc.time();
glm = train(ID ~ ., data = training,
method = "gbm",
metric = "ROC",
trControl = t_control,
verbose = FALSE)
When I am compiling last line, I am getting following error:
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
Can anyone tell me where I am going wrong and Ho</pre>kb1304< at >rit.edu2015-11-29T02:47:19efficiently multiply each column of a sparse Matrix by a sparse vector
http://comments.gmane.org/gmane.comp.lang.r.general/325981
<pre>Hi,
Say I have a sparse Matrix X, and a sparse vector (stored as a 1-column
sparse Matrix A), with X and A having the same number of rows, and I
wish to multiply each column of X by A, but would like the operation to
take full advantage of the sparseness of both X and A. In other words I
want the result to be another sparse Matrix but not having any zeros
calculated or stored unnecessarily. For concreteness,
library(Matrix)
set.seed(6860)
X <- sparseMatrix(i = sample(1:10, 5L),
j = sample(1:10, 5L),
x = rep(1, 5),
dims = c(10L, 10L)
)
A <- sparseMatrix(i = sample(1:10, 5L),
j = rep(1L, 5L),
x = rep(1, 5),
dims = c(10L, 1L)
)
and observe that
print(X * A[, 1L, drop=TRUE])
gives the following, in which three 0s are not represented sparsely,
10 x 10 sparse Matrix of class "dgCMatrix"
[1,] . . . . .</pre>Benjamin Tyner2015-11-29T03:01:22Some help understanding ggplot2
http://comments.gmane.org/gmane.comp.lang.r.general/325980
<pre>All,
I am trying to format a graph using scales and percent format but I am missing something and all my graphics books on ggplot2 are now quite far behind where ggplot2 is today. I seem to be missing a trick but the documentation implies that percent_format() will multiply by 100 and add %. I think the problem has to do with normalizing the data.
Glenn
Here is my data
structure(list(Rate = c(0.004975, 0.0126625, 0.0180375, 0.0136,
0.016, 0.0196, 0.023, 0.0256, 0.0293, 0.0324, 0.0338), Maturity = c(0.0833,
0.25, 0.5, 1, 2, 3, 4, 5, 7, 10, 30)), .Names = c("Rate", "Maturity"
), row.names = c("ED1M", "ED3M", "ED6M", "USSW1", "USSW2", "USSW3",
"USSW4", "USSW5", "USSW7", "USSW10", "USSW30"), class = "data.frame")
data <- data.frame(Rates[1:2,2:12])
data <- data.frame(t(data))
Note: if I do not normalize the data by dividing by 100 percent_format() works but then 2.25% is 225%
data[,1] <- data[,1]/100
colnames(data) <- c("Rate", "Maturity")
Here is the color palette
cbbPalette <- c("#E69F00", "#5</pre>Glenn Schultz2015-11-28T20:34:47Isotonic Regression
http://comments.gmane.org/gmane.comp.lang.r.general/325979
<pre>Dear Sir
I am new to R.statistics. I am an Anaesthetist using the version Ri 386
3.2.2
I have tested the patients' response sequence for a dose sequence, and I
need to calculate an estimate of the minimum dose that gives a certain
effect on a certain percentage of the patients' number.
I am using the Canty Bootstrap package and the functions:
preparePava.R (last updated 16-Dec.2012)
bootIsotonicResample.R (last updated 17-Dec.2012)
bootIsotonicReggresion.R (last updated 17-Dec.2012)
bootBC.ci.R (last updated 28-Dec.2011)
Unfortunately, I always get the error messages
Error in is.data.frame(x) : argument "x" is missing, with no default
Error: object 'test.boot' not found
after using the boot package:
test.boot <- boot(data=test.df,statistic=bootIsotonicRegression,
R=9999,sim='parametric',ran.gen=bootIsotonicResample,
mle = list(baselinePava=testPava.df,firstDose=10,PROBABILITY.GAMMA=0.5),
baselinePava=testPava.df,PROBABILITY.GAMMA=0.5)
Searching all the program for "is.data.frame(x)",</pre>Hamed Nofal2015-11-28T18:04:16Using uniroot on c(0, 1) when the function does not change sign in this interval?
http://comments.gmane.org/gmane.comp.lang.r.general/325975
<pre>How can I use uniroot to find a root in the interval (0,1) when my
function does not change sign in this interval.
I've tried plugging in some values and seems like e.g. f(50) < 0 and
then I can pick c(0,50). But this sounds really weird, given that I need
to find a root in (0,1).
So what are my options? Perhaps another function?
</pre>mviljamaa2015-11-28T00:08:36detect computer drives
http://comments.gmane.org/gmane.comp.lang.r.general/325961
<pre>Dear All,
Is there a method to detect the computer's drives?
That would include USB sticks, when they are recognised by the operating
system.
I believe to have read somewhere it's possible, but I am unable to find
that message.
Thank you for any hint,
Adrian
</pre>Adrian Dușa2015-11-27T13:43:14Graphing the Area of Definite Integral
http://comments.gmane.org/gmane.comp.lang.r.general/325960
<pre>Dear All:
I am trying to explain to my students how to calculate the definite
integral using the Riemann sum. Can someone help me to graph the area under
the curve of the function, showing the curve as well as the rectangles
between 0 and 4..
*f(x) = x^3 - 2*x *
over the interval [0 , 4]
with many thanks
steve
</pre>Steven Stoline2015-11-27T12:52:31From KDE-surfaces to 3d-printing format?
http://comments.gmane.org/gmane.comp.lang.r.general/325959
<pre>Hi,
Is it somehow possible to produce 3D-printing data from the kernel
density map produced by the
"DrawDensity3D"-function of "VecStatGraphs3D"-package?
I'm not an expert of KDE-technics, just can use that function to produce
surfaces...
Best ,
Atte Tenkanen
</pre>Atte Tenkanen2015-11-27T12:24:09Handling huge data of 17GB in R
http://comments.gmane.org/gmane.comp.lang.r.general/325957
<pre>Hello,
I am trying the DBSCAN clustering algorithm on a huge data matrix (26000 x 26000). I dont have the datapoints, just the distance matrix. It comes to 17 GB in the hard disk, and needs to be loaded into R to use the DBSCAN implementation (under package fpc). So I tried using read.csv but R crashed.
I am getting the message 'Killed after it runs for 10 minutes'
dist<-read.csv('dist.csv',header=FALSE)
Killed
So I chceked is there any R package that handles big data like this, and came across bigmemory package in R. So I installed it and ran this command, but even this does not work, R exits.
*** caught bus error ***
address 0x7fbc4faba000, cause 'non-existent physical address'
Traceback:
1: .Call("bigmemory_CreateSharedMatrix", PACKAGE = "bigmemory", row, col, colnames, rownames, typeLength, ini, separated)
2: CreateSharedMatrix(as.double(nrow), as.double(ncol), as.character(colnames), as.character(rownames), as.integer(typeVal), as.double(init), as.logical(separated))
3: big.ma</pre>Ajay Ramaseshan2015-11-27T11:03:05rjags cannot find JAGS-4.0.0
http://comments.gmane.org/gmane.comp.lang.r.general/325955
<pre>1. Despite being in R with administrative rights the library "rjags" loads
in a temporary location.
+ lib= "C:/Users/Margaret Donald/Documents/R/win-library/3.2")
trying URL 'https://cran.r-project.org/bin/windows/contrib/3.2/rjags_4-4.zip
'
Content type 'application/zip' length 525871 bytes (513 KB)
downloaded 513 KB
package ‘rjags’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Margaret
Donald\AppData\Local\Temp\RtmpMzv76s\downloaded_packages
#-----------------------------------------------------------------------------------------------------------------
2. Cannot find JAGS-4.0.0 which is in C;\programs\JAGS\JAGS-4.0.0. How do
I get R to see JAGS-4.0.0
Error : .onLoad failed in loadNamespace() for 'rjags', details:
call: fun(libname, pkgname)
error: Failed to locate any version of JAGS version 4
The rjags package is just an interface to the JAGS library
Make sure you have installed JAGS-4.x.y.exe (for any x >=0, y>=0) from
http://www.</pre>Margaret Donald2015-11-27T00:59:53Memory problem when changing a function
http://comments.gmane.org/gmane.comp.lang.r.general/325952
<pre>I changed a function in a package and I want to run this new function.
It always gives the error of "Error in memory: couldn't allocate a
vector of 15.3 Gb" altough the built in function doesn't give this
error.
My system is window 10, 8 Ram, AMD Quad-Core processor.
I've read about memory problems but I couldn't solve it. I tried the
code on another system with 16 RAM but it didn't work also. How can I
solve this problem given that i can't change the code?Thank you.
Regards,
Marwah Sabry Siam,
Teaching Assistant at Faculty of Economics and Political Science,
Statistics Department,
01225875205
</pre>Marwah Sabry Siam2015-11-26T19:57:12metafor - Meta-Analysis of rare events / beta-binomialregression
http://comments.gmane.org/gmane.comp.lang.r.general/325950
<pre>Dear all,
I am currently writing a protocol for a meta-analysis which will analyze
suicidal events. Recently, O. Kuss has (DOI 10.1002/sim.6383) published a
paper that suggest using beta-binomial regression methods to incorporate
double-zero studies. He states that </pre>Markus Kösters2015-11-26T13:39:34R: Re: R: RE: Syntax error in using Anova (car package)
http://comments.gmane.org/gmane.comp.lang.r.general/325949
<pre>Dear Bert,
I do not have any statistical consultant that I can find near me or pay. Yes,
I was confused by some statistical
concept, but I remember you, with humility, that human beings have the
possibility to learn. Some even
learn fast! Don't under estimate the will of a person of learning.
However, it is my hope that you are the only one that feels so much pissed off
by my HELP requests!
The point of a forum is to provide help, don't you think? And there might be
people in future that reading
my posts over internet can find solutions to the same problem. Do you know
that there are many
people around that do not have a statistical consultant available and try to
learn by themselves?
I do hope that some one could provide an answer to my last question, since it
is just a syntactical question
and this is the most appropriate forum in the world that can help me (and
maybe others in future) in
understanding and solving the problem.
Thank you
Best regards
Angelo
rows
repetition2
of
"Stimulus_5</pre>angelo.arcadi< at >virgilio.it2015-11-26T09:33:00R: RE: Syntax error in using Anova (car package)
http://comments.gmane.org/gmane.comp.lang.r.general/325946
<pre>
Dear Prof. John Fox,
thanks a lot for your answer. Do you mean that my data set should have 19 rows
(one for each of the 19 subjects)
and 144 columns (that is 72 trials * 2 dependent variables)? So should the
dataframe look like this?
Subject Stimulus_1.Centroid.repetition1 Stimulus_1.Centroid.repetition2
Stimulus_1.Peak.repetition1 Stimulus_1.Peak.repetition2
Subject1 1000 2000
10 20
Subject2 500
600 5 6
......
SubjectN
However, differently from the example reported in the document you kindly
provided, my experiment
has two dependent variables.
My guess is that the analysis should be the following (considering 12 types of
stimuli and 6 repetitions
for each of them, and 2 dependent variables)
stimulus_type <- factor(rep(c("Stimulus_1", "Stimulus_2", "Stimulus_3",
"Stimulus_4", "Stimulus_5", </pre>angelo.arcadi< at >virgilio.it2015-11-26T03:04:01Search EngineSearch the mailing list at Gmanequery
http://search.gmane.org/?group=$group=gmane.comp.lang.r.general