Re: [R] Restricted 4-PL curves using drc package

2015-12-10 Thread li li
The option 2 works. Thanks. Hanna 2015-12-09 16:24 GMT-05:00 Bert Gunter : > 1. Don't know, but, assuming I understand you correctly, probably not. > > 2 Note (subject to my understanding again) that you can rephrase your > query as fitting a 4 parameter logistic to all the data together with >

Re: [R] Request Help

2015-12-10 Thread David Winsemius
> On Dec 10, 2015, at 2:55 PM, Pedro Malpartida wrote: > > Hello, > > I am currently facing difficulties while doing a couple of financial tasks > in R. I will appreciate if you give a solution code for these issues. > > 1) If I have to price an european call option non dividend paying stock >

[R] Request Help

2015-12-10 Thread Pedro Malpartida
Hello, I am currently facing difficulties while doing a couple of financial tasks in R. I will appreciate if you give a solution code for these issues. 1) If I have to price an european call option non dividend paying stock being t= 12 months, rf= 3% pa.cc and volatility of 30% per annum. Plot t

[R] Trading Strategy and Bootstrap

2015-12-10 Thread Schiele, Erik
Hi, I'm beginning to fool around in R for trading strategy purposes. To keep it simple, I have only played with stock data at this point. I have created a simple trend following strategy (in blue). Given my statistical background, I am attempting to bootstrap the results and table the same par

Re: [R] problem in metro_hasting function‏

2015-12-10 Thread hms Dreams
No, it is not a homework.. The 3 paramters I want to estimate it are : alpha,gam and delta, the range of them >0 here my code: library("MHadaptive") baysianlog5=function (param,data) { alpha=param[1] gam=param[2] delta=param[3] x=data

Re: [R] [FORGED] Correct notation for functions, packages when using LaTex

2015-12-10 Thread Rolf Turner
On 11/12/15 06:10, Erin Hodgess wrote: Hello everyone! I am writing up something (quickly) using LaTex and periodically refer to R functions and packages. What is the correct way to put those into LaTex, please? I know that R itself is {\tt R}, but am not sure about the others. Actually I mu

Re: [R] choropleth packages (US)

2015-12-10 Thread Benjamin Tyner
Very nice Adrian. Is there a straightforward way to add Alaska and Hawaii at the lower left? (without resorting to choroplethr package) On 12/10/2015 06:09 AM, Adrian Waddell wrote: Hi, You can also use the 'maps' package for the map data and the 'scales' package for the color mapping. E.g.

Re: [R] problem in metro_hasting function‏

2015-12-10 Thread Bert Gunter
... Note that if your parameters are uniform on [0, ...] you might be getting into trouble with (1/param) in your priors and likelihood. Or you might just be over-parameterized -- your data can't support your model and you are getting near singularities in your approximations. Cheers, Bert Ber

Re: [R] problem in metro_hasting function‏

2015-12-10 Thread Bert Gunter
Sara: Always cc your reply to the list, which I have done here. No, I cannot help you. Others may be able to now. (They may still need your data, however). Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (ak

[R] spplot

2015-12-10 Thread Debasish Pai Mazumder
Hi all, I am using spplot for a spatial map. spplot(hspdf, "CDP", col = "white", col.regions = blue2red(20), sp.layout = list(l2), at = seq(1,10,1), colorkey = list(space = "bottom", labels = list(labels = paste(seq(1,10,1)), cex = 1.5)), sub = list("CDP", cex = 1.5, font = 2)) I have three ques

Re: [R] Raster-package - problem with stackApply()

2015-12-10 Thread MacQueen, Don
Appears to me that results for the third set of indices you supplied (1,1) ended up in the third layer of the result. Similarly for the other sets of indices. This makes sense to me. r-sig-geo might be a better place to ask questions about the raster package. I've seen other questions about stackA

Re: [R] Correct notation for functions, packages when using LaTex

2015-12-10 Thread Ista Zahn
While we're at it: There is another LaTeX package called minted. It has an R option to highlight R code. I've used it and it works well, though it depends on python and the pygments python package. --Ista On Thu, Dec 10, 2015 at 12:32 PM, wrote: > Erin > There is a LaTeX package called listing

Re: [R] problem in metro_hasting function‏

2015-12-10 Thread Bert Gunter
Heh, heh ... Uniform distributions are not necessarily "non-informative" priors (itself, a non-definition). See, e.g. http://www.stats.org.uk/priors/noninformative/YangBerger1998.pdf . For a basic argument, see: http://www.amstat.org/publications/jse/v12n2/zhu.pdf Further discussion is off-topi

[R] problem in metro_hasting function‏

2015-12-10 Thread hms Dreams
Hello, I estimated three paramters using non informative prior(all paramters following uniform distribution) the output is: Error in optim(pars, li_func, control = list(fnscale = -1), hessian = TRUE, : non-finite finite-difference value [1] How can I solve it using uniform distribution for

Re: [R] Errors when compile RInside using intel c++ compiler on windows

2015-12-10 Thread Bert Gunter
Thanks, Marc. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Dec 10, 2015 at 9:43 AM, Marc Schwartz wrote: > Hi, > > For clarification, the rcp

Re: [R] Errors when compile RInside using intel c++ compiler on windows

2015-12-10 Thread Marc Schwartz
Hi, For clarification, the rcpp support list is the recommended location for RInside support: http://lists.r-forge.r-project.org/mailman/listinfo/rcpp-devel Regards, Marc > On Dec 10, 2015, at 11:30 AM, Bert Gunter wrote: > > Wrong list!. This is about programming **IN** the R language.

Re: [R] Correct notation for functions, packages when using LaTex

2015-12-10 Thread JLucke
Erin There is a LaTeX package called listings. It has an R option to prettyprint code. Never used it. Joe "Kevin E. Thorpe" Sent by: "R-help" 12/10/2015 12:14 PM To Erin Hodgess , cc R help Subject Re: [R] Correct notation for functions, packages when using LaTex On 12/10/2015

Re: [R] Errors when compile RInside using intel c++ compiler on windows

2015-12-10 Thread Bert Gunter
Wrong list!. This is about programming **IN** the R language. For your sort of question, post to the R-devel list. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" com

Re: [R] Correct notation for functions, packages when using LaTex

2015-12-10 Thread Erin Hodgess
Great, Thanks! Erin On Thu, Dec 10, 2015 at 11:14 AM, Kevin E. Thorpe wrote: > On 12/10/2015 12:10 PM, Erin Hodgess wrote: > >> Hello everyone! >> >> I am writing up something (quickly) using LaTex and periodically refer to >> R >> functions and packages. >> >> What is the correct way to put th

Re: [R] Correct notation for functions, packages when using LaTex

2015-12-10 Thread Kevin E. Thorpe
On 12/10/2015 12:10 PM, Erin Hodgess wrote: Hello everyone! I am writing up something (quickly) using LaTex and periodically refer to R functions and packages. What is the correct way to put those into LaTex, please? I know that R itself is {\tt R}, but am not sure about the others. Thanks fo

[R] Correct notation for functions, packages when using LaTex

2015-12-10 Thread Erin Hodgess
Hello everyone! I am writing up something (quickly) using LaTex and periodically refer to R functions and packages. What is the correct way to put those into LaTex, please? I know that R itself is {\tt R}, but am not sure about the others. Thanks for any help, Sincerely, Erin PS Or should I ju

Re: [R] choropleth packages (US)

2015-12-10 Thread Adrian Waddell
Hi, You can also use the 'maps' package for the map data and the 'scales' package for the color mapping. E.g. library(maps) library(scales) m <- map('state', fill=TRUE, plot=FALSE) s_data <- tolower(rownames(USArrests)) s_map <- tolower(m$names) mapping <- lapply(s_data, function(state) { w

[R] Errors when compile RInside using intel c++ compiler on windows

2015-12-10 Thread 李琥
I have read the mailing list about compiling R using intel c++ compiler on linux. http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2013-January/005035.html In my environment I am going to compile RInside using intel c++ compiler on windows. I take the sample0 in RInside example fol

[R] Raster-package - problem with stackApply()

2015-12-10 Thread Mark R Payne
Hi, I am trying to use stackApply() to perform averages over subsets of a brick. However, I am struggling with the indices argument, and how it should be interpreted. Here is a simple working example illustrating my problem: r <- raster() r[] <- 1 inp <- brick(r,r,r,r,r,r)*(1:6) res <- stackAppl

Re: [R] matrix which results singular but at the same time positive definite

2015-12-10 Thread Fox, John
Dear Peter, > -Original Message- > From: peter dalgaard [mailto:pda...@gmail.com] > Sent: Thursday, December 10, 2015 11:09 AM > To: Stefano Sofia > Cc: Fox, John; r-help@r-project.org > Subject: Re: [R] matrix which results singular but at the same time > positive definite > > Looks like

Re: [R] package MASS - MLE of negative binomial distributions

2015-12-10 Thread peter dalgaard
The author usually points out that this is support software for a book, which you should probably consult. Generally speaking, theta in glm.nb plays the same role as the variance in least squares, and you can and cannot do essentially the same things with it. If you want to do more than that, y

Re: [R] matrix which results singular but at the same time positive definite

2015-12-10 Thread peter dalgaard
Looks like the ill-conditioning is almost entirely due to scaling, e.g. > eigen(cov2cor(m)) $values [1] 1.7234899 1.3380701 0.6619299 0.2765101 ... This is an annoyance in several parts of numerical linear algebra: Routines assume that R^n has all coordinates on a similar scale and therefore thi

Re: [R] package MASS - MLE of negative binomial distributions

2015-12-10 Thread Rik Verdonck
That makes sense indeed, but it also raises further questions to me if you don't mind: - Is there a good reason why the default assumption would be a constant overdispersion? Is it because you lose fewer degrees of freedom which would give you more power in comparing models? - Is there a way to

Re: [R] package MASS - MLE of negative binomial distributions

2015-12-10 Thread peter dalgaard
glm.nb fits 6 mean parameters plus 1 theta. 6 x fitdistr fits two parameters each. -pd On 10 Dec 2015, at 16:21 , Rik Verdonck wrote: > Dear list, > > > > I have a question about the exact estimate of the maximum likelihood for a > negative binomial fit. I'm trying to approach this in two

Re: [R] matrix which results singular but at the same time positive definite

2015-12-10 Thread Fox, John
Dear Stefano, I don't really know anything about your application, but my point is about the scaling of the variables. Can't you rescale some or all of the variables so their variances aren't so different? For example, the correlation matrix among these four variables isn't ill-conditioned. Be

Re: [R] matrix which results singular but at the same time positive definite

2015-12-10 Thread Stefano Sofia
Dear John, thank you for your considerations. This matrix (which is a variance matrix) is part of an algorithm for forward-filtering and backward-sampling of Dynamic Linear Models (West and Harrison, 1997), applied to DLM representation of ARIMA processes (Petris, Petrone, Campagnoli). It is th

Re: [R] If I have 3 parameters, is optim() doing the same thing as Gibbs sampling?

2015-12-10 Thread S Ellison
> If function p1 has 3 parameters, is it doing the same thing as Gibbs sampling? No. > How does optim() choose random numbers? It doesn't, for Nelder-Mead. Nelder-Mead is a deterministic algorithm that does not need random numbers. Read up on Nelder-Mead; it - and everything else in optim() -

[R] package MASS - MLE of negative binomial distributions

2015-12-10 Thread Rik Verdonck
Dear list, I have a question about the exact estimate of the maximum likelihood for a negative binomial fit. I'm trying to approach this in two different ways: the first one is a fit using the glm.nb method, and the second one is a fit using the fitdistr function for each condition separately

[R] If I have 3 parameters, is optim() doing the same thing as Gibbs sampling?

2015-12-10 Thread C W
Hi R list, I am using optim() to optimize a function with 3 parameters. #My 1-d toy example: loglikelihood of normal with x=c(2,5,3,7,-3,-2,0), find MLE of mean. p1 <- function(theta){ sum(log(dnorm(c(2,5,3,7,-3,-2,0), mean = theta, sd = 1))) +log(dnorm( theta, mean = 0.8, sd = 2)) } optimiz

Re: [R] matrix which results singular but at the same time positive definite

2015-12-10 Thread Fox, John
Dear Stefano, You've already had a couple of informative responses directly addressing your question, but are you aware how ill-conditioned the matrix is (one of the responses alluded to this)? > kappa(X, exact=TRUE) [1] 7.313338e+12 > eigen(X)$values [1] 4.964711e+00 9.356881e-01 4.863392e-12

Re: [R] change col types of a df/tbl_df

2015-12-10 Thread arnaud gaboury
On Thu, Dec 10, 2015 at 1:47 PM, Giorgio Garziano < giorgio.garzi...@ericsson.com> wrote: > my_convert <- function(col) { > v <- grep("[0-9]{2}.[0-9]{2}.[0-9]{4}", col); > w <- grep("[0-9]+,[0-9]+", col) > col2 <- col > if (length(v) == length(col)){ > col2 <- as.Date(col, format="%d.%

Re: [R] change col types of a df/tbl_df

2015-12-10 Thread Giorgio Garziano
my_convert <- function(col) { v <- grep("[0-9]{2}.[0-9]{2}.[0-9]{4}", col); w <- grep("[0-9]+,[0-9]+", col) col2 <- col if (length(v) == length(col)){ col2 <- as.Date(col, format="%d.%m.%y") } else if (length(w) == length(col)) { col2 <- as.numeric(gsub(",", "", col)) } col2 }

Re: [R] there is a vectorinzing version of "[[<-" for "tclArray" class ?

2015-12-10 Thread peter dalgaard
On 10 Dec 2015, at 08:27 , phgrosj...@sciviews.org wrote: > library(tcltk) > methods(class = "tclArray") > > ## [1] [[ [[<- $$<- length length<- namesnames<- > ## see '?methods' for accessing help and source code > > It should be something like `[<-`. But this one

[R] R 3.2.3 is released

2015-12-10 Thread Peter Dalgaard
The build system rolled up R-3.2.3.tar.gz (codename "Wooden Christmas-Tree") this morning. The list below details the changes in this release. You can get the source code from http://cran.r-project.org/src/base/R-3/R-3.2.3.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Bi

Re: [R] change col types of a df/tbl_df

2015-12-10 Thread arnaud gaboury
On Thu, Dec 10, 2015 at 12:54 PM, Duncan Murdoch wrote: > On 10/12/2015 6:12 AM, arnaud gaboury wrote: > >> Here is a sample of my data frame, obtained with read_csv2 from readr >> package. >> >> myDf <- structure(list(X15 = c("30.09.2015", "05.10.2015", "30.09.2015", >> >> "29.09.2015", "10.10.2

Re: [R] change col types of a df/tbl_df

2015-12-10 Thread Duncan Murdoch
On 10/12/2015 6:12 AM, arnaud gaboury wrote: Here is a sample of my data frame, obtained with read_csv2 from readr package. myDf <- structure(list(X15 = c("30.09.2015", "05.10.2015", "30.09.2015", "29.09.2015", "10.10.2015"), X16 = c("02.10.2015", "06.10.2015", "01.10.2015", "01.10.2015", "13.1

[R] change col types of a df/tbl_df

2015-12-10 Thread arnaud gaboury
Here is a sample of my data frame, obtained with read_csv2 from readr package. myDf <- structure(list(X15 = c("30.09.2015", "05.10.2015", "30.09.2015", "29.09.2015", "10.10.2015"), X16 = c("02.10.2015", "06.10.2015", "01.10.2015", "01.10.2015", "13.10.2015"), X17 = c("Grains", "Grains", "Grains",

Re: [R] matrix which results singular but at the same time positive definite

2015-12-10 Thread Rolf Turner
On 10/12/15 23:08, Stefano Sofia wrote: Dear list users, through the "matrixcalc" package I am performing some checks of variance matrices (which must be positive definite). In this example, it happens that the matrix A here reported is singular but positive definite. Is it possible?

Re: [R] matrix which results singular but at the same time positive definite

2015-12-10 Thread Giorgio Garziano
Decrease the "tol" parameter specified into the "is.non.singular.matrix() call, for example as: m <- matrix(c( 1.904255e-12, -1.904255e-12, -8.238960e-13, -1.240294e-12, -1.904255e-12, 3.637979e-12, 1.364242e-12, 1.818989e-12, -8.238960e-13, 1.364242e-12, 4.80998

Re: [R] Use of R for estimation of Discrete Choice Models incorporating latent variables

2015-12-10 Thread Giorgio Garziano
My educated guess: package: RSGHB https://cran.r-project.org/web/packages/RSGHB/RSGHB.pdf http://www.inside-r.org/packages/cran/RSGHB/docs/doHB Wondering if also package ltm may help. There is available R package search at: http://rseek.org/ My apologies if abovementioned packages do not f

[R] matrix which results singular but at the same time positive definite

2015-12-10 Thread Stefano Sofia
Dear list users, through the "matrixcalc" package I am performing some checks of variance matrices (which must be positive definite). In this example, it happens that the matrix A here reported is singular but positive definite. Is it possible? [,1] [,2] [,3]

Re: [R] problems with plotting/graphics after changing my computer

2015-12-10 Thread PIKAL Petr
Hi I do not use ctmm and did not install it. I just opened recent docs for stmm and there is no AKDE parameter for plot. ctmm pdf you sent me has 0.2.8 version and was published August 26, 2015 but recently available version has number 0.3.0 and was published November 28, 2015 So if you did th

Re: [R] problems with plotting/graphics after changing my computer

2015-12-10 Thread Alexander Moßbrucker
Just curious: do you get the same error message, or is it a problem with my specific version/computer??? 2015-12-10 15:28 GMT+07:00 Alexander Moßbrucker : > I am not surve, as I cannot start the crashed computer I used before. I > guess it might be the same versions, I installed them on my crashe

Re: [R] problems with plotting/graphics after changing my computer

2015-12-10 Thread Alexander Moßbrucker
I am not surve, as I cannot start the crashed computer I used before. I guess it might be the same versions, I installed them on my crashed computer in October, and now reinstalled them on my new computer in December, thus only 2-3 months difference.

Re: [R] problems with plotting/graphics after changing my computer

2015-12-10 Thread PIKAL Petr
Hi Reply to the list too, somebody could answer your question better than myself. You say that it is the same script. OK. But is it also the same version of R and ctmm? Cheers Petr From: Alexander Moßbrucker [mailto:islandelepha...@gmail.com] Sent: Thursday, December 10, 2015 8:50 AM To: PIKAL