[R] VGAM package : Frechet distribution - 2 parameter estimation

2014-11-06 Thread Katherine Gobin
Dear R forum,

I am trying to execute following code (Page no 259 - VGAM.pdf)

# 
.

library(VGAM)

set.seed(123)
fdata - data.frame(y1 = rfrechet(nn - 1000, shape = 2 + exp(1)))
with(fdata, hist(y1))
fit2 - vglm(y1 ~ 1, frechet, data = fdata, trace = TRUE)

# 
.


However, I receive following error 

Error in vglm(y1 ~ 1, frechet, data = fdata, trace = TRUE) : 
  object 'frechet' not found


Earlier there used to be a function called frechet3 which I guess has been 
withdrawn by VGAM. 

Kindly guide 

Katherine
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] limit of cmdscale function

2014-11-06 Thread Kawashima, Masayuki
Hi

We have a few questions regarding the use of the isoMDS function.

When we run isoMDS function using 60,000 x 60,000 data matrix, 
we get the following error message:


cmdscale(d, k) : invalid value of 'n'
Calls: isoMDS - cmdscale


We checked the source code of cmdscale and found the following limitation:

## we need to handle nxn internally in dblcen
if(is.na(n) || n  46340) stop(invalid value of 'n')


1. This cmdscale limitation ('n  46340') is due to the limitation of BLAS and 
LAPACK variables(int4) which can only handle '2^31-1' amount of data?

2. Is there any workaround to run isoMDS using large data (i.e. greater than 
46340)?
   We would like to run isoMDS using a maximum of 150,000x150,000 data matrix.

Best regards

Masayuki Kawashima
Email: kawasim...@jp.fujitsu.com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Time dependant covariate

2014-11-06 Thread Paula Iso-Markku
Hello,

Can I get help? I have the attached kind of material and I should create a
time-dependant covariate from the variate Optime? I have tried using
survsplit function but I don't know exactly how to do it. Or I can't get it
to work. How can I split every id's follow-up time into two rows according
the time of optime (The time they get treatment)?

Best regards,
Paula Iso-Markku
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] VGAM package : Frechet distribution - 2 parameter estimation

2014-11-06 Thread Michael Dewey



On 06/11/2014 06:04, Katherine Gobin wrote:

Dear R forum,

I am trying to execute following code (Page no 259 - VGAM.pdf)

# 
.

library(VGAM)

set.seed(123)
fdata - data.frame(y1 = rfrechet(nn - 1000, shape = 2 + exp(1)))
with(fdata, hist(y1))
fit2 - vglm(y1 ~ 1, frechet, data = fdata, trace = TRUE)

# 
.



Is it not called frechet2?


However, I receive following error

Error in vglm(y1 ~ 1, frechet, data = fdata, trace = TRUE) :
   object 'frechet' not found


Earlier there used to be a function called frechet3 which I guess has been 
withdrawn by VGAM.

Kindly guide

Katherine
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.5557 / Virus Database: 4189/8518 - Release Date: 11/05/14




--
Michael
http://www.dewey.myzen.co.uk

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] VGAM package : Frechet distribution - 2 parameter estimation

2014-11-06 Thread Katherine Gobin
Dear Mr Michael,

Thanks a lot for your guidance. The pdf file describing VGAM package has 
mentioned 'frechet' in the example, so I got the error.

Regards
Katherine


On Thursday, 6 November 2014 2:54 PM, Michael Dewey i...@aghmed.fsnet.co.uk 
wrote:
 




On 06/11/2014 06:04, Katherine Gobin wrote:
 Dear R forum,

 I am trying to execute following code (Page no 259 - VGAM.pdf)

 # 
 .

 library(VGAM)

 set.seed(123)
 fdata - data.frame(y1 = rfrechet(nn - 1000, shape = 2 + exp(1)))
 with(fdata, hist(y1))
 fit2 - vglm(y1 ~ 1, frechet, data = fdata, trace = TRUE)

 # 
 .


Is it not called frechet2?


 However, I receive following error

 Error in vglm(y1 ~ 1, frechet, data = fdata, trace = TRUE) :
object 'frechet' not found


 Earlier there used to be a function called frechet3 which I guess has been 
 withdrawn by VGAM.

 Kindly guide

 Katherine
 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


 -
 No virus found in this message.
 Checked by AVG - www.avg.com
 Version: 2015.0.5557 / Virus Database: 4189/8518 - Release Date: 11/05/14



-- 
Michael
http://www.dewey.myzen.co.uk
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] VGAM package : Frechet distribution - 2 parameter estimation

2014-11-06 Thread Rolf Turner


Dear Ms. Gobin,

There would appear to be a typo in the package manual that appears on 
CRAN.  Doing ?Frechet (it would be nice to have this aliased also to 
frechet) points you immediately to frechet.  With frechet2 
substituted for frechet your code, everything works.


cheers,

Rolf Turner

On 06/11/14 22:34, Katherine Gobin wrote:

Dear Mr Michael,

Thanks a lot for your guidance. The pdf file describing VGAM package has 
mentioned 'frechet' in the example, so I got the error.

Regards
Katherine


On Thursday, 6 November 2014 2:54 PM, Michael Dewey i...@aghmed.fsnet.co.uk 
wrote:





On 06/11/2014 06:04, Katherine Gobin wrote:

Dear R forum,

I am trying to execute following code (Page no 259 - VGAM.pdf)

# 
.

library(VGAM)

set.seed(123)
fdata - data.frame(y1 = rfrechet(nn - 1000, shape = 2 + exp(1)))
with(fdata, hist(y1))
fit2 - vglm(y1 ~ 1, frechet, data = fdata, trace = TRUE)

# 
.



Is it not called frechet2?



However, I receive following error

Error in vglm(y1 ~ 1, frechet, data = fdata, trace = TRUE) :
object 'frechet' not found


Earlier there used to be a function called frechet3 which I guess has been 
withdrawn by VGAM.

Kindly guide

Katherine


--
Rolf Turner
Technical Editor ANZJS

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] limit of cmdscale function

2014-11-06 Thread David L Carlson
You avoid the call to cmdscale() by supplying your own starting configuration 
(see the manual page for the y= argument). You could still hit other barriers 
within isoMDS() or insufficient memory on your computer.

-
David L Carlson
Department of Anthropology
Texas AM University
College Station, TX 77840-4352

-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of Kawashima, Masayuki
Sent: Wednesday, November 5, 2014 10:51 PM
To: r-help@r-project.org
Subject: [R] limit of cmdscale function

Hi

We have a few questions regarding the use of the isoMDS function.

When we run isoMDS function using 60,000 x 60,000 data matrix, 
we get the following error message:


cmdscale(d, k) : invalid value of 'n'
Calls: isoMDS - cmdscale


We checked the source code of cmdscale and found the following limitation:

## we need to handle nxn internally in dblcen
if(is.na(n) || n  46340) stop(invalid value of 'n')


1. This cmdscale limitation ('n  46340') is due to the limitation of BLAS and 
LAPACK variables(int4) which can only handle '2^31-1' amount of data?

2. Is there any workaround to run isoMDS using large data (i.e. greater than 
46340)?
   We would like to run isoMDS using a maximum of 150,000x150,000 data matrix.

Best regards

Masayuki Kawashima
Email: kawasim...@jp.fujitsu.com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] speed issue in simulating a stochastic process

2014-11-06 Thread Matteo Richiardi
I wish to simulate the following stochastic process, for i = 1...N
individuals and t=1...T periods:

y_{i,t} = y_0 + lambda Ey_{t-1} + epsilon_{i,t}

where Ey_{t-1} is the average of y over the N individuals computed at time
t-1.

My solution (below) works but is incredibly slow. Is there a faster but
still clear and readable alternative?

Thanks a lot. Matteo

rm(list=ls())
library(plyr)
y0 = 0
lambda = 0.1
N = 20
T = 100
m_e = 0
sd_e = 1

# construct the data frame and initialize y
D = data.frame(
  id = rep(1:N,T),
  t = rep(1:T, each = N),
  y = rep(y0,N*T)
)

# update y
for(t in 2:T){
  ybar.L1 = mean(D[D$t==t-1,y])
  for(i in 1:N){
epsilon = rnorm(1,mean=m_e,sd=sd_e)
D[D$id==i  D$t==t,]$y = lambda*y0+(1-lambda)*ybar.L1+epsilon
  }
}

ybar - ddply(D,~t,summarise,mean=mean(y))

plot(ybar, col = blue, type = l)

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] speed issue in simulating a stochastic process

2014-11-06 Thread Thomas Adams
Matteo,

I tried your example code using R 3.1.1 on an iMac (24-inch, Early 2009), 3.06
GHz Intel Core 2 Duo, 8 GB 1333 MHz DDR3, NVIDIA GeForce GT 130 512 MB
running Mac OS X 10.10 (Yosemite).

After entering your code, the elapsed time from the time I hit return to
when the graphics appeared was about 2 seconds — is this about what you are
seeing?

Regards,
Tom



On Thu, Nov 6, 2014 at 7:47 AM, Matteo Richiardi matteo.richia...@gmail.com
 wrote:

 I wish to simulate the following stochastic process, for i = 1...N
 individuals and t=1...T periods:

 y_{i,t} = y_0 + lambda Ey_{t-1} + epsilon_{i,t}

 where Ey_{t-1} is the average of y over the N individuals computed at time
 t-1.

 My solution (below) works but is incredibly slow. Is there a faster but
 still clear and readable alternative?

 Thanks a lot. Matteo

 rm(list=ls())
 library(plyr)
 y0 = 0
 lambda = 0.1
 N = 20
 T = 100
 m_e = 0
 sd_e = 1

 # construct the data frame and initialize y
 D = data.frame(
   id = rep(1:N,T),
   t = rep(1:T, each = N),
   y = rep(y0,N*T)
 )

 # update y
 for(t in 2:T){
   ybar.L1 = mean(D[D$t==t-1,y])
   for(i in 1:N){
 epsilon = rnorm(1,mean=m_e,sd=sd_e)
 D[D$id==i  D$t==t,]$y = lambda*y0+(1-lambda)*ybar.L1+epsilon
   }
 }

 ybar - ddply(D,~t,summarise,mean=mean(y))

 plot(ybar, col = blue, type = l)

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] cluster + tt terms in coxph

2014-11-06 Thread Henric Winell

On 2014-11-05 14:50, Therneau, Terry M., Ph.D. wrote:


This is fixed in version 2.37-8 of the survival package, which has been
in my send to CRAN real-soon-now queue for 6 months.  Your note is a
prod to get it done.  I've been updating and adding vignettes.


Is your fixed code publicly available somewhere?  (The 'survival' 
repository at R-forge doesn't seem to have been updated since January.)


Henric Winell




Terry Therneau


On 11/05/2014 05:00 AM, r-help-requ...@r-project.org wrote:

I am receiving the following error when trying to include both tt
(time transforms) and frailty terms in coxph


coxph(Surv(time, status) ~ ph.ecog + tt(age)+cluster(sex), data=lung,

+  tt=function(x,t,...) pspline(x + t/365.25))
Error in residuals.coxph(fit2, type = dfbeta, collapse = cluster,
weighted = TRUE) :
   Wrong length for 'collapse'

I tried both 64 bit (R.3.1.0) and 32 bit (R.3.1.2) in Windows 7 64bit
and get the same errors

Inclusion of tt and cluster terms worked fine in R2.9.2-2.15.1 under
Windows Vista 32 bit and Ubuntu 64 bit

Any ideas?


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] speed issue in simulating a stochastic process

2014-11-06 Thread Thomas Adams
Matteo,

Ah — OK, N=20, I did not catch that. You have nested for loops, which R is
known to be exceedingly slow at handling — if you can reorganize the code
to eliminate the loops, your performance will increase significantly.

Tom

On Thu, Nov 6, 2014 at 7:47 AM, Matteo Richiardi matteo.richia...@gmail.com
 wrote:

 I wish to simulate the following stochastic process, for i = 1...N
 individuals and t=1...T periods:

 y_{i,t} = y_0 + lambda Ey_{t-1} + epsilon_{i,t}

 where Ey_{t-1} is the average of y over the N individuals computed at time
 t-1.

 My solution (below) works but is incredibly slow. Is there a faster but
 still clear and readable alternative?

 Thanks a lot. Matteo

 rm(list=ls())
 library(plyr)
 y0 = 0
 lambda = 0.1
 N = 20
 T = 100
 m_e = 0
 sd_e = 1

 # construct the data frame and initialize y
 D = data.frame(
   id = rep(1:N,T),
   t = rep(1:T, each = N),
   y = rep(y0,N*T)
 )

 # update y
 for(t in 2:T){
   ybar.L1 = mean(D[D$t==t-1,y])
   for(i in 1:N){
 epsilon = rnorm(1,mean=m_e,sd=sd_e)
 D[D$id==i  D$t==t,]$y = lambda*y0+(1-lambda)*ybar.L1+epsilon
   }
 }

 ybar - ddply(D,~t,summarise,mean=mean(y))

 plot(ybar, col = blue, type = l)

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] speed issue in simulating a stochastic process

2014-11-06 Thread William Dunlap
I find that representing the simulated data as a T row by N column matrix
allows for a clearer and faster simulation function.  E.g., compare the
output of the following two functions, the first of which uses your code
and the second a matrix representation (which I convert to a data.frame at
the end so I can compare outputs easily).  I timed both of them for T=10^3
times and N=50 individuals; both gave the same results and f1 was 1
times faster than f0:
   set.seed(1); t0 - system.time(s0 - f0(N=50,T=1000))
   set.seed(1); t1 - system.time(s1 - f1(N=50,T=1000))
   rbind(t0, t1)
 user.self sys.self elapsed user.child sys.child
  t0436.87 0.11  438.48 NANA
  t1  0.04 0.000.04 NANA
   all.equal(s0, s1)
  [1] TRUE

The functions are:

f0 - function(N = 20, T = 100, lambda = 0.1, m_e = 0, sd_e = 1, y0 = 0)
{
  # construct the data frame and initialize y
  D - data.frame(
id = rep(1:N,T),
t = rep(1:T, each = N),
y = rep(y0,N*T)
  )

  # update y
  for(t in 2:T){
ybar.L1 = mean(D[D$t==t-1,y])
for(i in 1:N){
  epsilon = rnorm(1,mean=m_e,sd=sd_e)
  D[D$id==i  D$t==t,]$y = lambda*y0+(1-lambda)*ybar.L1+epsilon
}
  }
  D
}

f1 - function(N = 20, T = 100, lambda = 0.1, m_e = 0, sd_e = 1, y0 = 0)
{
  # same process simulated using a matrix representation
  #   The T rows are times, the N columns are individuals
  M - matrix(y0, nrow=T, ncol=N)
  if (T  1) for(t in 2:T) {
ybar.L1 - mean(M[t-1L,])
epsilon - rnorm(N, mean=m_e, sd=sd_e)
M[t,] - lambda * y0 + (1-lambda)*ybar.L1 + epsilon
  }
  # convert to the data.frame representation that f0 uses
  tM - t(M)
  data.frame(id = as.vector(row(tM)), t = as.vector(col(tM)), y =
as.vector(tM))
}



Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Thu, Nov 6, 2014 at 6:47 AM, Matteo Richiardi matteo.richia...@gmail.com
 wrote:

 I wish to simulate the following stochastic process, for i = 1...N
 individuals and t=1...T periods:

 y_{i,t} = y_0 + lambda Ey_{t-1} + epsilon_{i,t}

 where Ey_{t-1} is the average of y over the N individuals computed at time
 t-1.

 My solution (below) works but is incredibly slow. Is there a faster but
 still clear and readable alternative?

 Thanks a lot. Matteo

 rm(list=ls())
 library(plyr)
 y0 = 0
 lambda = 0.1
 N = 20
 T = 100
 m_e = 0
 sd_e = 1

 # construct the data frame and initialize y
 D = data.frame(
   id = rep(1:N,T),
   t = rep(1:T, each = N),
   y = rep(y0,N*T)
 )

 # update y
 for(t in 2:T){
   ybar.L1 = mean(D[D$t==t-1,y])
   for(i in 1:N){
 epsilon = rnorm(1,mean=m_e,sd=sd_e)
 D[D$id==i  D$t==t,]$y = lambda*y0+(1-lambda)*ybar.L1+epsilon
   }
 }

 ybar - ddply(D,~t,summarise,mean=mean(y))

 plot(ybar, col = blue, type = l)

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Daylight Saving Time

2014-11-06 Thread Vasantha Kumar Kesavan
Hi,

I am working R on windows 2012 R2 platform, I have updated the latest
hotfixes for time zone information(Microsoft KB 2981580.
http://support.microsoft.com/kb/2981580).

But still R is not populating correct date time values(Standard and
Daylight saving).

Could you please advise me, how to enable R to pick up the latest time zone
information/configurations.

Example:

R --vanilla
Sys.setenv(TZ = America/Eirunepe);
dt-c(seq(as.POSIXct(2013-11-09 20:00:00,tz=America/Eirunepe),
as.POSIXct(2013-11-10 10:00:00 ,tz=America/Eirunepe), by=hour));
 dt
 [1] 2013-11-09 20:00:00 AMT 2013-11-09 21:00:00 AMT
 [3] 2013-11-09 22:00:00 AMT 2013-11-09 23:00:00 AMT
 [5] 2013-11-10 00:00:00 AMT 2013-11-10 01:00:00 AMT
 [7] 2013-11-10 02:00:00 AMT 2013-11-10 03:00:00 AMT
 [9] 2013-11-10 04:00:00 AMT 2013-11-10 05:00:00 AMT
[11] 2013-11-10 06:00:00 AMT 2013-11-10 07:00:00 AMT
[13] 2013-11-10 08:00:00 AMT 2013-11-10 09:00:00 AMT
[15] 2013-11-10 10:00:00 AMT

For the “*America/Eirunepe*” time zone, the DST ended on Sun 10-Nov-2013 at
12:00:00 A.M. when local clocks were set backward 1 hour.


as per the latest timezone configuration, the date time sequence should
have 2013-11-09 23:00:00 twice.


Thanks

Vasanth

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Timezone Upgrade

2014-11-06 Thread Vasantha Kumar Kesavan
Hi,

I would like to know, once the operating system timezone information is
updated, what step should be carried out at R for reflecting the operating
system(LINUX X64 SOLARIS X64 and WINDOWS X64) update.


Thanks
Vasanth

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Timezone Upgrade

2014-11-06 Thread Jeff Newmiller
Log out and log back in again. For many people this may happen in the normal 
course of daily use.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On November 6, 2014 1:28:37 PM EST, Vasantha Kumar Kesavan 
info.vas...@gmail.com wrote:
Hi,

I would like to know, once the operating system timezone information is
updated, what step should be carried out at R for reflecting the
operating
system(LINUX X64 SOLARIS X64 and WINDOWS X64) update.


Thanks
Vasanth

   [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Timezone Upgrade

2014-11-06 Thread Vasantha Kumar Kesavan
I am log out and login many times. but no luck.

Thanks
Vasanth

On Fri, Nov 7, 2014 at 1:04 AM, Jeff Newmiller jdnew...@dcn.davis.ca.us
wrote:

 Log out and log back in again. For many people this may happen in the
 normal course of daily use.
 ---
 Jeff NewmillerThe .   .  Go Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
 Go...
   Live:   OO#.. Dead: OO#..  Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
 ---
 Sent from my phone. Please excuse my brevity.

 On November 6, 2014 1:28:37 PM EST, Vasantha Kumar Kesavan 
 info.vas...@gmail.com wrote:
 Hi,
 
 I would like to know, once the operating system timezone information is
 updated, what step should be carried out at R for reflecting the
 operating
 system(LINUX X64 SOLARIS X64 and WINDOWS X64) update.
 
 
 Thanks
 Vasanth
 
[[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Daylight Saving Time

2014-11-06 Thread Jeff Newmiller
R on Windows uses the Olsen timezone database, a copy of which is stored with R 
in the Program Files directory (e.g. R/R-3.1.1/share/zoneinfo). You could 
update the file yourself if you can find a corrected version, or download an 
updated version of R.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On November 6, 2014 1:16:06 PM EST, Vasantha Kumar Kesavan 
info.vas...@gmail.com wrote:
Hi,

I am working R on windows 2012 R2 platform, I have updated the latest
hotfixes for time zone information(Microsoft KB 2981580.
http://support.microsoft.com/kb/2981580).

But still R is not populating correct date time values(Standard and
Daylight saving).

Could you please advise me, how to enable R to pick up the latest time
zone
information/configurations.

Example:

R --vanilla
Sys.setenv(TZ = America/Eirunepe);
dt-c(seq(as.POSIXct(2013-11-09 20:00:00,tz=America/Eirunepe),
as.POSIXct(2013-11-10 10:00:00 ,tz=America/Eirunepe), by=hour));
 dt
 [1] 2013-11-09 20:00:00 AMT 2013-11-09 21:00:00 AMT
 [3] 2013-11-09 22:00:00 AMT 2013-11-09 23:00:00 AMT
 [5] 2013-11-10 00:00:00 AMT 2013-11-10 01:00:00 AMT
 [7] 2013-11-10 02:00:00 AMT 2013-11-10 03:00:00 AMT
 [9] 2013-11-10 04:00:00 AMT 2013-11-10 05:00:00 AMT
[11] 2013-11-10 06:00:00 AMT 2013-11-10 07:00:00 AMT
[13] 2013-11-10 08:00:00 AMT 2013-11-10 09:00:00 AMT
[15] 2013-11-10 10:00:00 AMT

For the “*America/Eirunepe*” time zone, the DST ended on Sun
10-Nov-2013 at
12:00:00 A.M. when local clocks were set backward 1 hour.


as per the latest timezone configuration, the date time sequence should
have 2013-11-09 23:00:00 twice.


Thanks

Vasanth

   [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Daylight Saving Time

2014-11-06 Thread Vasantha Kumar Kesavan
Thanks Jeff Newmiller, it is working now.

I would like to know, the same kind of configuration can be done in Linux
and Solaris platform.

Instead of R is mapping to operating system(/usr/share/. /usr/share/lib/)
zoneinfo directory.

Thanks
Vasanth

On Fri, Nov 7, 2014 at 1:18 AM, Jeff Newmiller jdnew...@dcn.davis.ca.us
wrote:

 R on Windows uses the Olsen timezone database, a copy of which is stored
 with R in the Program Files directory (e.g. R/R-3.1.1/share/zoneinfo). You
 could update the file yourself if you can find a corrected version, or
 download an updated version of R.
 ---
 Jeff NewmillerThe .   .  Go Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
 Go...
   Live:   OO#.. Dead: OO#..  Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
 ---
 Sent from my phone. Please excuse my brevity.

 On November 6, 2014 1:16:06 PM EST, Vasantha Kumar Kesavan 
 info.vas...@gmail.com wrote:
 Hi,
 
 I am working R on windows 2012 R2 platform, I have updated the latest
 hotfixes for time zone information(Microsoft KB 2981580.
 http://support.microsoft.com/kb/2981580).
 
 But still R is not populating correct date time values(Standard and
 Daylight saving).
 
 Could you please advise me, how to enable R to pick up the latest time
 zone
 information/configurations.
 
 Example:
 
 R --vanilla
 Sys.setenv(TZ = America/Eirunepe);
 dt-c(seq(as.POSIXct(2013-11-09 20:00:00,tz=America/Eirunepe),
 as.POSIXct(2013-11-10 10:00:00 ,tz=America/Eirunepe), by=hour));
  dt
  [1] 2013-11-09 20:00:00 AMT 2013-11-09 21:00:00 AMT
  [3] 2013-11-09 22:00:00 AMT 2013-11-09 23:00:00 AMT
  [5] 2013-11-10 00:00:00 AMT 2013-11-10 01:00:00 AMT
  [7] 2013-11-10 02:00:00 AMT 2013-11-10 03:00:00 AMT
  [9] 2013-11-10 04:00:00 AMT 2013-11-10 05:00:00 AMT
 [11] 2013-11-10 06:00:00 AMT 2013-11-10 07:00:00 AMT
 [13] 2013-11-10 08:00:00 AMT 2013-11-10 09:00:00 AMT
 [15] 2013-11-10 10:00:00 AMT
 
 For the “*America/Eirunepe*” time zone, the DST ended on Sun
 10-Nov-2013 at
 12:00:00 A.M. when local clocks were set backward 1 hour.
 
 
 as per the latest timezone configuration, the date time sequence should
 have 2013-11-09 23:00:00 twice.
 
 
 Thanks
 
 Vasanth
 
[[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Daylight Saving Time

2014-11-06 Thread Jeff Newmiller
Working now... after what action?

AFAIK on *NIX systems R uses the OS installation of the Olsen database, so on a 
fresh login R should pick up any OS update you have installed.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On November 6, 2014 3:36:38 PM EST, Vasantha Kumar Kesavan 
info.vas...@gmail.com wrote:
Thanks Jeff Newmiller, it is working now.

I would like to know, the same kind of configuration can be done in
Linux
and Solaris platform.

Instead of R is mapping to operating system(/usr/share/.
/usr/share/lib/)
zoneinfo directory.

Thanks
Vasanth

On Fri, Nov 7, 2014 at 1:18 AM, Jeff Newmiller
jdnew...@dcn.davis.ca.us
wrote:

 R on Windows uses the Olsen timezone database, a copy of which is
stored
 with R in the Program Files directory (e.g.
R/R-3.1.1/share/zoneinfo). You
 could update the file yourself if you can find a corrected version,
or
 download an updated version of R.

---
 Jeff NewmillerThe .   .  Go
Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
 Go...
   Live:   OO#.. Dead: OO#.. 
Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#. 
rocks...1k

---
 Sent from my phone. Please excuse my brevity.

 On November 6, 2014 1:16:06 PM EST, Vasantha Kumar Kesavan 
 info.vas...@gmail.com wrote:
 Hi,
 
 I am working R on windows 2012 R2 platform, I have updated the
latest
 hotfixes for time zone information(Microsoft KB 2981580.
 http://support.microsoft.com/kb/2981580).
 
 But still R is not populating correct date time values(Standard and
 Daylight saving).
 
 Could you please advise me, how to enable R to pick up the latest
time
 zone
 information/configurations.
 
 Example:
 
 R --vanilla
 Sys.setenv(TZ = America/Eirunepe);
 dt-c(seq(as.POSIXct(2013-11-09 20:00:00,tz=America/Eirunepe),
 as.POSIXct(2013-11-10 10:00:00 ,tz=America/Eirunepe),
by=hour));
  dt
  [1] 2013-11-09 20:00:00 AMT 2013-11-09 21:00:00 AMT
  [3] 2013-11-09 22:00:00 AMT 2013-11-09 23:00:00 AMT
  [5] 2013-11-10 00:00:00 AMT 2013-11-10 01:00:00 AMT
  [7] 2013-11-10 02:00:00 AMT 2013-11-10 03:00:00 AMT
  [9] 2013-11-10 04:00:00 AMT 2013-11-10 05:00:00 AMT
 [11] 2013-11-10 06:00:00 AMT 2013-11-10 07:00:00 AMT
 [13] 2013-11-10 08:00:00 AMT 2013-11-10 09:00:00 AMT
 [15] 2013-11-10 10:00:00 AMT
 
 For the “*America/Eirunepe*” time zone, the DST ended on Sun
 10-Nov-2013 at
 12:00:00 A.M. when local clocks were set backward 1 hour.
 
 
 as per the latest timezone configuration, the date time sequence
should
 have 2013-11-09 23:00:00 twice.
 
 
 Thanks
 
 Vasanth
 
[[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Daylight Saving Time

2014-11-06 Thread Vasantha Kumar Kesavan
In LINUX, I don't want R to use the operating system zoneinfo(Olsen
database) instead of that I like to point different path which has the
latest zoneinfo(latest Olsen database).

On Fri, Nov 7, 2014 at 2:34 AM, Jeff Newmiller jdnew...@dcn.davis.ca.us
wrote:

 Working now... after what action?

 AFAIK on *NIX systems R uses the OS installation of the Olsen database, so
 on a fresh login R should pick up any OS update you have installed.
 ---
 Jeff NewmillerThe .   .  Go Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
 Go...
   Live:   OO#.. Dead: OO#..  Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
 ---
 Sent from my phone. Please excuse my brevity.

 On November 6, 2014 3:36:38 PM EST, Vasantha Kumar Kesavan 
 info.vas...@gmail.com wrote:
 Thanks Jeff Newmiller, it is working now.
 
 I would like to know, the same kind of configuration can be done in
 Linux
 and Solaris platform.
 
 Instead of R is mapping to operating system(/usr/share/.
 /usr/share/lib/)
 zoneinfo directory.
 
 Thanks
 Vasanth
 
 On Fri, Nov 7, 2014 at 1:18 AM, Jeff Newmiller
 jdnew...@dcn.davis.ca.us
 wrote:
 
  R on Windows uses the Olsen timezone database, a copy of which is
 stored
  with R in the Program Files directory (e.g.
 R/R-3.1.1/share/zoneinfo). You
  could update the file yourself if you can find a corrected version,
 or
  download an updated version of R.
 

 ---
  Jeff NewmillerThe .   .  Go
 Live...
  DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
  Go...
Live:   OO#.. Dead: OO#..
 Playing
  Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
  /Software/Embedded Controllers)   .OO#.   .OO#.
 rocks...1k
 

 ---
  Sent from my phone. Please excuse my brevity.
 
  On November 6, 2014 1:16:06 PM EST, Vasantha Kumar Kesavan 
  info.vas...@gmail.com wrote:
  Hi,
  
  I am working R on windows 2012 R2 platform, I have updated the
 latest
  hotfixes for time zone information(Microsoft KB 2981580.
  http://support.microsoft.com/kb/2981580).
  
  But still R is not populating correct date time values(Standard and
  Daylight saving).
  
  Could you please advise me, how to enable R to pick up the latest
 time
  zone
  information/configurations.
  
  Example:
  
  R --vanilla
  Sys.setenv(TZ = America/Eirunepe);
  dt-c(seq(as.POSIXct(2013-11-09 20:00:00,tz=America/Eirunepe),
  as.POSIXct(2013-11-10 10:00:00 ,tz=America/Eirunepe),
 by=hour));
   dt
   [1] 2013-11-09 20:00:00 AMT 2013-11-09 21:00:00 AMT
   [3] 2013-11-09 22:00:00 AMT 2013-11-09 23:00:00 AMT
   [5] 2013-11-10 00:00:00 AMT 2013-11-10 01:00:00 AMT
   [7] 2013-11-10 02:00:00 AMT 2013-11-10 03:00:00 AMT
   [9] 2013-11-10 04:00:00 AMT 2013-11-10 05:00:00 AMT
  [11] 2013-11-10 06:00:00 AMT 2013-11-10 07:00:00 AMT
  [13] 2013-11-10 08:00:00 AMT 2013-11-10 09:00:00 AMT
  [15] 2013-11-10 10:00:00 AMT
  
  For the “*America/Eirunepe*” time zone, the DST ended on Sun
  10-Nov-2013 at
  12:00:00 A.M. when local clocks were set backward 1 hour.
  
  
  as per the latest timezone configuration, the date time sequence
 should
  have 2013-11-09 23:00:00 twice.
  
  
  Thanks
  
  Vasanth
  
 [[alternative HTML version deleted]]
  
  __
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
  http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
 



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Daylight Saving Time

2014-11-06 Thread Jeff Newmiller
?timezones

You probably need to recompile R.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On November 6, 2014 4:10:58 PM EST, Vasantha Kumar Kesavan 
info.vas...@gmail.com wrote:
In LINUX, I don't want R to use the operating system zoneinfo(Olsen
database) instead of that I like to point different path which has the
latest zoneinfo(latest Olsen database).

On Fri, Nov 7, 2014 at 2:34 AM, Jeff Newmiller
jdnew...@dcn.davis.ca.us
wrote:

 Working now... after what action?

 AFAIK on *NIX systems R uses the OS installation of the Olsen
database, so
 on a fresh login R should pick up any OS update you have installed.

---
 Jeff NewmillerThe .   .  Go
Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
 Go...
   Live:   OO#.. Dead: OO#.. 
Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#. 
rocks...1k

---
 Sent from my phone. Please excuse my brevity.

 On November 6, 2014 3:36:38 PM EST, Vasantha Kumar Kesavan 
 info.vas...@gmail.com wrote:
 Thanks Jeff Newmiller, it is working now.
 
 I would like to know, the same kind of configuration can be done in
 Linux
 and Solaris platform.
 
 Instead of R is mapping to operating system(/usr/share/.
 /usr/share/lib/)
 zoneinfo directory.
 
 Thanks
 Vasanth
 
 On Fri, Nov 7, 2014 at 1:18 AM, Jeff Newmiller
 jdnew...@dcn.davis.ca.us
 wrote:
 
  R on Windows uses the Olsen timezone database, a copy of which is
 stored
  with R in the Program Files directory (e.g.
 R/R-3.1.1/share/zoneinfo). You
  could update the file yourself if you can find a corrected
version,
 or
  download an updated version of R.
 


---
  Jeff NewmillerThe .   . 
Go
 Live...
  DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#. 
Live
  Go...
Live:   OO#.. Dead: OO#..
 Playing
  Research Engineer (Solar/BatteriesO.O#.   #.O#. 
with
  /Software/Embedded Controllers)   .OO#.   .OO#.
 rocks...1k
 


---
  Sent from my phone. Please excuse my brevity.
 
  On November 6, 2014 1:16:06 PM EST, Vasantha Kumar Kesavan 
  info.vas...@gmail.com wrote:
  Hi,
  
  I am working R on windows 2012 R2 platform, I have updated the
 latest
  hotfixes for time zone information(Microsoft KB 2981580.
  http://support.microsoft.com/kb/2981580).
  
  But still R is not populating correct date time values(Standard
and
  Daylight saving).
  
  Could you please advise me, how to enable R to pick up the latest
 time
  zone
  information/configurations.
  
  Example:
  
  R --vanilla
  Sys.setenv(TZ = America/Eirunepe);
  dt-c(seq(as.POSIXct(2013-11-09
20:00:00,tz=America/Eirunepe),
  as.POSIXct(2013-11-10 10:00:00 ,tz=America/Eirunepe),
 by=hour));
   dt
   [1] 2013-11-09 20:00:00 AMT 2013-11-09 21:00:00 AMT
   [3] 2013-11-09 22:00:00 AMT 2013-11-09 23:00:00 AMT
   [5] 2013-11-10 00:00:00 AMT 2013-11-10 01:00:00 AMT
   [7] 2013-11-10 02:00:00 AMT 2013-11-10 03:00:00 AMT
   [9] 2013-11-10 04:00:00 AMT 2013-11-10 05:00:00 AMT
  [11] 2013-11-10 06:00:00 AMT 2013-11-10 07:00:00 AMT
  [13] 2013-11-10 08:00:00 AMT 2013-11-10 09:00:00 AMT
  [15] 2013-11-10 10:00:00 AMT
  
  For the “*America/Eirunepe*” time zone, the DST ended on Sun
  10-Nov-2013 at
  12:00:00 A.M. when local clocks were set backward 1 hour.
  
  
  as per the latest timezone configuration, the date time sequence
 should
  have 2013-11-09 23:00:00 twice.
  
  
  Thanks
  
  Vasanth
  
 [[alternative HTML version deleted]]
  
  __
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
  http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible
code.
 
 



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, 

Re: [R] speed issue in simulating a stochastic process

2014-11-06 Thread William Dunlap
Loops are not slow, but your code did a lot of unneeded operations in each
loop.
E.g, you computed
D$id==i  D$t==t
for each row of D.  That involves 2*nrow(D) equality tests for each of the
nrow(D)
rows, i.e., it is quadratic in N*T.

Then you did a data.frame replacement operation
D[k,]$y - newValue
where k is D$id==1D$t==t.  This extracts the k'th row of D, then extracts
the 1-row 'y' column
from it, replaces it with the new value, then puts that row back into D.
If you must use
a data.frame, the equivalent
   D$y[k] - newValue
is probably much faster (data.frames are lists of columns, so replacing a
column is fast).

Using a matrix to organize things is less flexible, but faster because you
don't have to search
when you want to find the element for a given id and time - you just do a
little arithmetic to
get the offset from the start of the matrix.


Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Thu, Nov 6, 2014 at 2:05 PM, Matteo Richiardi matteo.richia...@gmail.com
 wrote:

 Hi William,
 that's super. Thanks a lot. I knew that R is slow with loops, but did not
 imagine so slow! B.t.w., what's the reason?
 Final question: in your code you have mean(M[t-1L,]): what is the 'L'
 for? I removed it at apparently the code produces the same output...

 Thanks again,
 Matteo

 On 6 November 2014 18:46, William Dunlap wdun...@tibco.com wrote:

 I find that representing the simulated data as a T row by N column matrix
 allows for a clearer and faster simulation function.  E.g., compare the
 output of the following two functions, the first of which uses your code
 and the second a matrix representation (which I convert to a data.frame at
 the end so I can compare outputs easily).  I timed both of them for T=10^3
 times and N=50 individuals; both gave the same results and f1 was 1
 times faster than f0:
set.seed(1); t0 - system.time(s0 - f0(N=50,T=1000))
set.seed(1); t1 - system.time(s1 - f1(N=50,T=1000))
rbind(t0, t1)
  user.self sys.self elapsed user.child sys.child
   t0436.87 0.11  438.48 NANA
   t1  0.04 0.000.04 NANA
all.equal(s0, s1)
   [1] TRUE

 The functions are:

 f0 - function(N = 20, T = 100, lambda = 0.1, m_e = 0, sd_e = 1, y0 = 0)
 {
   # construct the data frame and initialize y
   D - data.frame(
 id = rep(1:N,T),
 t = rep(1:T, each = N),
 y = rep(y0,N*T)
   )

   # update y
   for(t in 2:T){
 ybar.L1 = mean(D[D$t==t-1,y])
 for(i in 1:N){
   epsilon = rnorm(1,mean=m_e,sd=sd_e)
   D[D$id==i  D$t==t,]$y = lambda*y0+(1-lambda)*ybar.L1+epsilon
 }
   }
   D
 }

 f1 - function(N = 20, T = 100, lambda = 0.1, m_e = 0, sd_e = 1, y0 = 0)
 {
   # same process simulated using a matrix representation
   #   The T rows are times, the N columns are individuals
   M - matrix(y0, nrow=T, ncol=N)
   if (T  1) for(t in 2:T) {
 ybar.L1 - mean(M[t-1L,])
 epsilon - rnorm(N, mean=m_e, sd=sd_e)
 M[t,] - lambda * y0 + (1-lambda)*ybar.L1 + epsilon
   }
   # convert to the data.frame representation that f0 uses
   tM - t(M)
   data.frame(id = as.vector(row(tM)), t = as.vector(col(tM)), y =
 as.vector(tM))
 }



 Bill Dunlap
 TIBCO Software
 wdunlap tibco.com

 On Thu, Nov 6, 2014 at 6:47 AM, Matteo Richiardi 
 matteo.richia...@gmail.com wrote:

 I wish to simulate the following stochastic process, for i = 1...N
 individuals and t=1...T periods:

 y_{i,t} = y_0 + lambda Ey_{t-1} + epsilon_{i,t}

 where Ey_{t-1} is the average of y over the N individuals computed at
 time
 t-1.

 My solution (below) works but is incredibly slow. Is there a faster but
 still clear and readable alternative?

 Thanks a lot. Matteo

 rm(list=ls())
 library(plyr)
 y0 = 0
 lambda = 0.1
 N = 20
 T = 100
 m_e = 0
 sd_e = 1

 # construct the data frame and initialize y
 D = data.frame(
   id = rep(1:N,T),
   t = rep(1:T, each = N),
   y = rep(y0,N*T)
 )

 # update y
 for(t in 2:T){
   ybar.L1 = mean(D[D$t==t-1,y])
   for(i in 1:N){
 epsilon = rnorm(1,mean=m_e,sd=sd_e)
 D[D$id==i  D$t==t,]$y = lambda*y0+(1-lambda)*ybar.L1+epsilon
   }
 }

 ybar - ddply(D,~t,summarise,mean=mean(y))

 plot(ybar, col = blue, type = l)

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.





[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Differences between MTDFReml and kinship2

2014-11-06 Thread David Duffy

From: silvano silv...@uel.br

I fitted a genetic model using kinship2 and I compared it with MTDFReml program 
output.
The residual variance of both are very close but the genetic variance are very 
differents.

The output are:

MTDFReml:
genetic variance = 1.24015
residual variance = 5.93424

R (Kinship2):
genetic variance = 0.767187
residual variance = 5.6712

Both of them use REML method. Could someone tell why the difference?



Hi Silvano.

You haven't given us enough information, I'm afraid.  We would need the
commands you used, the versions of the software,  plus output from both
jobs, and your data, or a smaller subset that exhibits the same problem.

You may have made an error, there may be a problem in one program, or the
likelihood might be flat around those solutions (ie your data are not very
informative).

It might be better to continue this on the R-sig-mixed-models list.

Cheers, David Duffy.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] VGAM package : Frechet distribution - 2 parameter estimation

2014-11-06 Thread Thomas Yee

Hello,

a day or two ago I submitted VGAM 0.9-5 to CRAN, which has
myriads of changes to family functions---their names, their
arguments, and their order thereof. Especially regarding
family functions for discrete and continuous distributions.

In a nutshell, I found lots of inconsistencies while writing
my book, and it was deemed necessary to standardize things.
I just had to bite the bullet, so to speak. I have tried
to summarize all changes in the NEWS file, however, a few
might have gone undocumented. Users of previous versions
of VGAM are cautioned to check their code. My apologies
for this inconvenience.

I have always tried to make it plain that while the
version number was less than 1.0-0, everything was subject
to change. But the book Vector Generalized Linear and
Additive Models, for Springer, should appear next year,
it is synchronized with version 1.0-0, so that should end
most of these disruptive changes :) Or at least, curtail them
(hopefully).

cheers

Thomas

ps. for this particular problem, only frechet() remains.




On 06/11/14 23:12, Rolf Turner wrote:


Dear Ms. Gobin,

There would appear to be a typo in the package manual that appears on 
CRAN.  Doing ?Frechet (it would be nice to have this aliased also to 
frechet) points you immediately to frechet.  With frechet2 
substituted for frechet your code, everything works.


cheers,

Rolf Turner

On 06/11/14 22:34, Katherine Gobin wrote:

Dear Mr Michael,

Thanks a lot for your guidance. The pdf file describing VGAM package 
has mentioned 'frechet' in the example, so I got the error.


Regards
Katherine


On Thursday, 6 November 2014 2:54 PM, Michael Dewey 
i...@aghmed.fsnet.co.uk wrote:






On 06/11/2014 06:04, Katherine Gobin wrote:

Dear R forum,

I am trying to execute following code (Page no 259 - VGAM.pdf)

# 
.


library(VGAM)

set.seed(123)
fdata - data.frame(y1 = rfrechet(nn - 1000, shape = 2 + exp(1)))
with(fdata, hist(y1))
fit2 - vglm(y1 ~ 1, frechet, data = fdata, trace = TRUE)

# 
.




Is it not called frechet2?



However, I receive following error

Error in vglm(y1 ~ 1, frechet, data = fdata, trace = TRUE) :
object 'frechet' not found


Earlier there used to be a function called frechet3 which I guess 
has been withdrawn by VGAM.


Kindly guide

Katherine




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Lme4 Package Help!

2014-11-06 Thread Daniel Mello
Hello, all! 

So, as stated in the title, the Lme4 package used to output p-values for the
fixed effects. What happened?!

Literally 2 weeks ago, I ran code, got output with no errors, and had
p-values listed for my fixed effects.

Now, running THE SAME CODE with THE SAME DATASET (nothing at all has
changed, not the data, not my computer, not R, nothing), I do not get
p-values.

I've tried other computers, I've tried resetting R.

Any ideas? I'd really need to get some p-values.

Thank you!

D

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R 2.14.2 installation on mac OS X yosemite

2014-11-06 Thread Deepansh Dalela
Hi, 

I noticed your email on the R support page. I am currently using SPSS 21 for 
mac, and need to install a macro plug-in which requires me o install R 2.14 (I 
already have R 3.0). When i download the R 2.14 package from the CRAN website, 
and try to install it on my Macintosh HD, it gives me an error message : “ R 
2.14.2 for Mac OS X 10.5 or higher (Leopard build) can’t be installed on this 
disk. Leopard build of R requires Mac OS X 10.5 or higher. Use Tiger build 
(available from CRAN) for older systems.” 

I dont understand this, since I have OS X Yosemite on my mac. I tried 
installing 2.14.0, but got the exact same error message.

Would appreciate your help greatly.

Deepansh
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R version 2.14.2 installation on mac OS X Yosemite

2014-11-06 Thread Dalela, Deepansh
Hi,

I noticed your email on the R support page. I am currently using SPSS 21 for 
mac, and need to install a macro plug-in which requires me o install R 2.14 (I 
already have R 3.0). When i download the R 2.14 package from the CRAN website, 
and try to install it on my Macintosh HD, it gives me an error message : “ R 
2.14.2 for Mac OS X 10.5 or higher (Leopard build) can’t be installed on this 
disk. Leopard build of R requires Mac OS X 10.5 or higher. Use Tiger build 
(available from CRAN) for older systems.”

I dont understand this, since I have OS X Yosemite on my mac. I tried 
installing 2.14.0, but got the exact same error message.

Would appreciate your help greatly.

Deepansh



CONFIDENTIALITY NOTICE: This email contains information from the sender that 
may be CONFIDENTIAL, LEGALLY PRIVILEGED, PROPRIETARY or otherwise protected 
from disclosure. This email is intended for use only by the person or entity to 
whom it is addressed. If you are not the intended recipient, any use, 
disclosure, copying, distribution, printing, or any action taken in reliance on 
the contents of this email, is strictly prohibited. If you received this email 
in error, please contact the sending party by reply email, delete the email 
from your computer system and shred any paper copies.

Note to Patients: There are a number of risks you should consider before using 
e-mail to communicate with us. See our Privacy  Security page on 
www.henryford.com for more detailed information as well as information 
concerning MyChart, our new patient portal. If you do not believe that our 
policy gives you the privacy and security protection you need, do not send 
e-mail or Internet communications to us.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R 2.14.2 installation on mac OS X yosemite

2014-11-06 Thread Uwe Ligges



On 06.11.2014 20:21, Deepansh Dalela wrote:

Hi,

I noticed your email on the R support page. I am currently using SPSS 21 for 
mac, and need to install a macro plug-in which requires me o install R 2.14 (I 
already have R 3.0). When i download the R 2.14 package from the CRAN website, 
and try to install it on my Macintosh HD, it gives me an error message : “ R 
2.14.2 for Mac OS X 10.5 or higher (Leopard build) can’t be installed on this 
disk. Leopard build of R requires Mac OS X 10.5 or higher. Use Tiger build 
(available from CRAN) for older systems.”

I dont understand this, since I have OS X Yosemite on my mac. I tried 
installing 2.14.0, but got the exact same error message.



Such old versions of R are not supported, particularly not on more 
recent OS.
If you need help, ask the company for support that tells you to install 
an obsolete version of R.


Best,
Uwe Ligges





Would appreciate your help greatly.

Deepansh
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Lme4 Package Help!

2014-11-06 Thread Ben Bolker
Daniel Mello dmello2 at ucmerced.edu writes:

 
 Hello, all! 
 
 So, as stated in the title, the Lme4 package used
 to output p-values for the
 fixed effects. What happened?!
 
 Literally 2 weeks ago, I ran code, got output with no errors, and had
 p-values listed for my fixed effects.
 
 Now, running THE SAME CODE with THE SAME DATASET (nothing at all has
 changed, not the data, not my computer, not R, nothing), I do not get
 p-values.
 
 I've tried other computers, I've tried resetting R.
 
 Any ideas? I'd really need to get some p-values.
 
 Thank you!
 
 D
 
 

  Applying my mind-reading skills, I'm going to guess that you are
running anova() and that you had previously loaded the lmerTest package
(which extends the anova() method from lme4 in several ways), and that
now you are loading only the base lme4 package and not the lmerTest 
package.

  If my guess isn't right, then you're going to have to provide more
information.

  Follow-ups to r-sig-mixed-mod...@r-project.org , please .

  Ben Bolker

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R version 2.14.2 installation on mac OS X Yosemite

2014-11-06 Thread Uwe Ligges



On 06.11.2014 20:20, Dalela, Deepansh wrote:

Hi,

I noticed your email on the R support page. I am currently using SPSS 21 for 
mac, and need to install a macro plug-in which requires me o install R 2.14 (I 
already have R 3.0). When i download the R 2.14 package from the CRAN website, 
and try to install it on my Macintosh HD, it gives me an error message : “ R 
2.14.2 for Mac OS X 10.5 or higher (Leopard build) can’t be installed on this 
disk. Leopard build of R requires Mac OS X 10.5 or higher. Use Tiger build 
(available from CRAN) for older systems.”

I dont understand this, since I have OS X Yosemite on my mac. I tried 
installing 2.14.0, but got the exact same error message.

Would appreciate your help greatly.




Such old versions of R are not supported, particularly not on more 
recent OS.
If you need help, ask the company for support that tells you to install 
an obsolete version of R.


Best,
Uwe Ligges



Deepansh



CONFIDENTIALITY NOTICE: This email contains information from the sender that 
may be CONFIDENTIAL, LEGALLY PRIVILEGED, PROPRIETARY or otherwise protected 
from disclosure. This email is intended for use only by the person or entity to 
whom it is addressed. If you are not the intended recipient, any use, 
disclosure, copying, distribution, printing, or any action taken in reliance on 
the contents of this email, is strictly prohibited. If you received this email 
in error, please contact the sending party by reply email, delete the email 
from your computer system and shred any paper copies.

Note to Patients: There are a number of risks you should consider before using 
e-mail to communicate with us. See our Privacy  Security page on 
www.henryford.com for more detailed information as well as information concerning 
MyChart, our new patient portal. If you do not believe that our policy gives you 
the privacy and security protection you need, do not send e-mail or Internet 
communications to us.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] speed issue in simulating a stochastic process

2014-11-06 Thread Rolf Turner


SNIP


On Thu, Nov 6, 2014 at 2:05 PM, Matteo Richiardi matteo.richia...@gmail.com

wrote:


SNIP


Final question: in your code you have mean(M[t-1L,]): what is the 'L'
for? I removed it at apparently the code produces the same output...


SNIP

The constant 1L is stored as an integer; the constant 1 is stored as 
double precision.  This sometimes makes no difference and sometimes 
makes a huge difference (especially in the context of numerical 
comparisons).  If something is supposed to be an integer it is safer to 
use the L form.


See ?NumericConstants.

cheers,

Rolf Turner

--
Rolf Turner
Technical Editor ANZJS

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R-es] Solo enteros en el eje Y de graficos con lattice

2014-11-06 Thread Oscar Perpiñan
Hola,

Los ejes los controlas con scales. Es una lista, y uno de sus
componentes puede ser y. Es a su vez otra lista en la que puedes
configurar el eje con detalle. En help(xyplot) está descrito en un
apartado que empieza así:  scales: Generally a list determining how
the x- and y-axes (tick marks and labels) are drawn.

Por ejemplo:

xyplot(1:3 ~1:3, scales = list(y = list(at = 1:3)))

Saludos.

Oscar.
-
Oscar Perpiñán Lamigueiro
Dpto. Ingeniería Eléctrica (ETSIDI-UPM)
Grupo de Sistemas Fotovoltaicos (IES-UPM)
URL: http://oscarperpinan.github.io

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] VI Jornadas de Usuarios de R [Materiales]

2014-11-06 Thread Miguel Fiandor Gutiérrez
Me uno a los agradecidos!

El 6 de noviembre de 2014, 10:35, Lorena Tudela Marco 
lorenatudelama...@gmail.com escribió:

 Muchas gracias por compartir! ;)

 Un abrazo, y buen día.

 Lore

 El 4 de noviembre de 2014, 22:33, Igor Sosa Mayor 
 joseleopoldo1...@gmail.com escribió:

  miguel.angel.rodriguez.mui...@sergas.es
  writes:
 
   Hola a todos.
  
   Ya están disponibles los materiales (videos y presentaciones) de las
   VI Jornadas de Usuarios de R que se celebraron en Santiago de
   Compostela los días 23 y 24 de Octubre.
   http://r-es.org/Programa+de+las+VI+Jornadas
 
  mil gracias!
 
  --
  :: Igor Sosa Mayor :: joseleopoldo1...@gmail.com ::
  :: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/  ::
  :: jabberid: rogorido  ::::
 
  ___
  R-help-es mailing list
  R-help-es@r-project.org
  https://stat.ethz.ch/mailman/listinfo/r-help-es
 

 [[alternative HTML version deleted]]

 ___
 R-help-es mailing list
 R-help-es@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-help-es


[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] Duda_Observed vs Predicted

2014-11-06 Thread Marcuzzi, Javier Rubén

Estimada Lorena Tudela

Voy a escribir algo por como yo lo aprendí (quizás mal redactado para un 
estadśitico), lo observado es lo que se mide a campo y lo predicho es lo 
que surge a partir del modelo estadístico. Luego aprendí como realizarlo 
con R, pero no siempre es posible en forma fácil, porque hay librerías 
que tienen dentro de sus algoritmos la forma adecuada para la 
predicción, en cambio otras no, y hay que realizarlo a mano.


Por lo cuál es necesario conocer que herramienta dentro de R está 
utilizando para sus modelos. Porque, puede ser que ella misma tenga la 
solución o se deba escribir en código R, y no siempre se pueden combinar 
una librería con la otra.


Javier Marcuzzi

El 06/11/14 a las 06:48, Lorena Tudela Marco escibió:

Buenos días a todxs,

Estoy comparando la predicción de los valores (0, 1, 2, 3,.hasta 13)
frente a los observados.
Con la idea de comparar el modelo Zero inflated y el Binomial negativo y
ver cual presenta mas distancia frente a las predicciones observadas.

Para ello introduzco los códigos en la consola:

#Modelo ZIM
pred-round(colSums(predict(zeroinfl, type=prob) [,1:14]))
#Valores observados realmente
obs-table(IB$nijt)[1:14]
#Tabla comparativa
rbind( pred, obs)

Y obtengo la siguiente tabla:

 0   1   2   3   4   5  6  7  8  9 10 11 12 13
pred 3600 589 349 224 151 105 75 55 42 32 25 20 16 13
obs  3529 743 300 203 135  81 76 44 33 37 30 12 14 13

La duda me surge al intentarlo con el Modelo Binomial negativo.¿Sabeis que
comando podría introducir para obtener los 13 valores predichos por el
modelo BN?

Muchas gracias por vuestra ayuda y buen día.

Lorena

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] Solo enteros en el eje Y de graficos con lattice

2014-11-06 Thread eric
Funciono perfecto, muchas gracias Oscar.

Debo decir, que lei esa parte de la ayuda de xyplot, pero jamas se me 
habria ocurrido que servia para controlar lo que necesitaba.

Slds y gracias,

Eric.






On Thu 06 Nov 2014 05:49:06 CLST, Oscar Perpiñan wrote:
 Hola,

 Los ejes los controlas con scales. Es una lista, y uno de sus
 componentes puede ser y. Es a su vez otra lista en la que puedes
 configurar el eje con detalle. En help(xyplot) está descrito en un
 apartado que empieza así:  scales: Generally a list determining how
 the x- and y-axes (tick marks and labels) are drawn.

 Por ejemplo:

 xyplot(1:3 ~1:3, scales = list(y = list(at = 1:3)))

 Saludos.

 Oscar.
 -
 Oscar Perpiñán Lamigueiro
 Dpto. Ingeniería Eléctrica (ETSIDI-UPM)
 Grupo de Sistemas Fotovoltaicos (IES-UPM)
 URL: http://oscarperpinan.github.io


--
Forest Engineer
Master in Environmental and Natural Resource Economics
Ph.D. student in Sciences of Natural Resources at La Frontera University
Member in AguaDeTemu2030, citizen movement for Temuco with green city 
standards for living

Nota: Las tildes se han omitido para asegurar compatibilidad con 
algunos lectores de correo.

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] Duda_Observed vs Predicted

2014-11-06 Thread Marcuzzi, Javier Rubén
Lorena

Ni idea:

Parte 1, nlme puede calcular con predict..., tendría que leer las 
especificaciones de nlme, porque dentro de las opciones puede ser que ...
Parte 2, tantas librerías juntas, ..., puede ser que la última que carga 
sobrepone una función a las anteriores.

Yo no puedo opinar sobre librerías que nunca use, de pronto lo que usted 
escribe es correcto, pero yo no puedo asegurarlo, el problema me supera.

Javier


El 06/11/14 a las 12:42, Lorena Tudela Marco escibió:
 Hola Javier,

 Si, cuando hablo de valor observado me refiero al valor real en campo 
 y el predicho al que estiman los modelos. Disculpa, que no lo 
 detallase así desde el principio.

 En mi caso trabajo con dos diferentes: Zero inflated y Binomial 
 Negativo y me gustaría comprobar que diferencia (distancia) existe 
 entre cada uno de ellos y la realidad.

 Estoy trabajando con los siguientes paquetes:

 library(pscl)
 library(MASS)
 library(AER)
 library(VGAM)
 library(truncreg)
 library(censReg)
 library(sampleSelection)
 library(ggplot2)
 library(boot)

 library(aod)
 library(lmtest)
 library(zoo)
 library(nlme)
 library(lmtest)
 library(boot)
 library(spatcounts)

 Mi duda es: ¿Que comando podría utilizar para calcular por valores 
 predichos por el Binomial negativo para los 14 primeros valores de la 
 variable dependiente?

 En el caso del ZIM utilizo: pred-round(colSums(predict(zeroinfl, 
 type=prob) [,1:14]))

 Gracias por vuestra ayuda! ;)

 Lore



 El 6 de noviembre de 2014, 12:30, Marcuzzi, Javier Rubén 
 javier.ruben.marcu...@gmail.com 
 mailto:javier.ruben.marcu...@gmail.com escribió:

 Estimada Lorena Tudela

 Voy a escribir algo por como yo lo aprendí (quizás mal redactado
 para un estadśitico), lo observado es lo que se mide a campo y lo
 predicho es lo que surge a partir del modelo estadístico. Luego
 aprendí como realizarlo con R, pero no siempre es posible en forma
 fácil, porque hay librerías que tienen dentro de sus algoritmos la
 forma adecuada para la predicción, en cambio otras no, y hay que
 realizarlo a mano.

 Por lo cuál es necesario conocer que herramienta dentro de R está
 utilizando para sus modelos. Porque, puede ser que ella misma
 tenga la solución o se deba escribir en código R, y no siempre se
 pueden combinar una librería con la otra.

 Javier Marcuzzi

 El 06/11/14 a las 06:48, Lorena Tudela Marco escibió:

 Buenos días a todxs,

 Estoy comparando la predicción de los valores (0, 1, 2,
 3,.hasta 13)
 frente a los observados.
 Con la idea de comparar el modelo Zero inflated y el Binomial
 negativo y
 ver cual presenta mas distancia frente a las predicciones
 observadas.

 Para ello introduzco los códigos en la consola:

 #Modelo ZIM
 pred-round(colSums(predict(zeroinfl, type=prob) [,1:14]))
 #Valores observados realmente
 obs-table(IB$nijt)[1:14]
 #Tabla comparativa
 rbind( pred, obs)

 Y obtengo la siguiente tabla:

  0   1   2   3   4   5  6  7  8  9 10 11 12 13
 pred 3600 589 349 224 151 105 75 55 42 32 25 20 16 13
 obs  3529 743 300 203 135  81 76 44 33 37 30 12 14 13

 La duda me surge al intentarlo con el Modelo Binomial
 negativo.¿Sabeis que
 comando podría introducir para obtener los 13 valores
 predichos por el
 modelo BN?

 Muchas gracias por vuestra ayuda y buen día.

 Lorena

 [[alternative HTML version deleted]]

 ___
 R-help-es mailing list
 R-help-es@r-project.org mailto:R-help-es@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-help-es


 ___
 R-help-es mailing list
 R-help-es@r-project.org mailto:R-help-es@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-help-es




[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] Duda_Observed vs Predicted

2014-11-06 Thread Víctor Granda García
Hola Lorena.

Trabajé hace tiempo con binomiales negativas y esta página me sirvió
bastante: http://www.ats.ucla.edu/stat/r/dae/nbreg.htm

Ahí tienes una manera de sacar los predicted values para una negbinom. No
se si es exactamente lo que buscas, pero te puede servir como punto de
partida para encontrar la solución en caso de que no lo sea.
Espero que te sirva.

Un saludo.

Víctor Granda García
Ph.D. Student
Dpto. BOS, Universidad de Oviedo

El 6 de noviembre de 2014, 18:06, Marcuzzi, Javier Rubén 
javier.ruben.marcu...@gmail.com escribió:

 Lorena

 Ni idea:

 Parte 1, nlme puede calcular con predict..., tendría que leer las
 especificaciones de nlme, porque dentro de las opciones puede ser que ...
 Parte 2, tantas librerías juntas, ..., puede ser que la última que carga
 sobrepone una función a las anteriores.

 Yo no puedo opinar sobre librerías que nunca use, de pronto lo que usted
 escribe es correcto, pero yo no puedo asegurarlo, el problema me supera.

 Javier


 El 06/11/14 a las 12:42, Lorena Tudela Marco escibió:
  Hola Javier,
 
  Si, cuando hablo de valor observado me refiero al valor real en campo
  y el predicho al que estiman los modelos. Disculpa, que no lo
  detallase así desde el principio.
 
  En mi caso trabajo con dos diferentes: Zero inflated y Binomial
  Negativo y me gustaría comprobar que diferencia (distancia) existe
  entre cada uno de ellos y la realidad.
 
  Estoy trabajando con los siguientes paquetes:
 
  library(pscl)
  library(MASS)
  library(AER)
  library(VGAM)
  library(truncreg)
  library(censReg)
  library(sampleSelection)
  library(ggplot2)
  library(boot)
 
  library(aod)
  library(lmtest)
  library(zoo)
  library(nlme)
  library(lmtest)
  library(boot)
  library(spatcounts)
 
  Mi duda es: ¿Que comando podría utilizar para calcular por valores
  predichos por el Binomial negativo para los 14 primeros valores de la
  variable dependiente?
 
  En el caso del ZIM utilizo: pred-round(colSums(predict(zeroinfl,
  type=prob) [,1:14]))
 
  Gracias por vuestra ayuda! ;)
 
  Lore
 
 
 
  El 6 de noviembre de 2014, 12:30, Marcuzzi, Javier Rubén
  javier.ruben.marcu...@gmail.com
  mailto:javier.ruben.marcu...@gmail.com escribió:
 
  Estimada Lorena Tudela
 
  Voy a escribir algo por como yo lo aprendí (quizás mal redactado
  para un estadśitico), lo observado es lo que se mide a campo y lo
  predicho es lo que surge a partir del modelo estadístico. Luego
  aprendí como realizarlo con R, pero no siempre es posible en forma
  fácil, porque hay librerías que tienen dentro de sus algoritmos la
  forma adecuada para la predicción, en cambio otras no, y hay que
  realizarlo a mano.
 
  Por lo cuál es necesario conocer que herramienta dentro de R está
  utilizando para sus modelos. Porque, puede ser que ella misma
  tenga la solución o se deba escribir en código R, y no siempre se
  pueden combinar una librería con la otra.
 
  Javier Marcuzzi
 
  El 06/11/14 a las 06:48, Lorena Tudela Marco escibió:
 
  Buenos días a todxs,
 
  Estoy comparando la predicción de los valores (0, 1, 2,
  3,.hasta 13)
  frente a los observados.
  Con la idea de comparar el modelo Zero inflated y el Binomial
  negativo y
  ver cual presenta mas distancia frente a las predicciones
  observadas.
 
  Para ello introduzco los códigos en la consola:
 
  #Modelo ZIM
  pred-round(colSums(predict(zeroinfl, type=prob) [,1:14]))
  #Valores observados realmente
  obs-table(IB$nijt)[1:14]
  #Tabla comparativa
  rbind( pred, obs)
 
  Y obtengo la siguiente tabla:
 
   0   1   2   3   4   5  6  7  8  9 10 11 12 13
  pred 3600 589 349 224 151 105 75 55 42 32 25 20 16 13
  obs  3529 743 300 203 135  81 76 44 33 37 30 12 14 13
 
  La duda me surge al intentarlo con el Modelo Binomial
  negativo.¿Sabeis que
  comando podría introducir para obtener los 13 valores
  predichos por el
  modelo BN?
 
  Muchas gracias por vuestra ayuda y buen día.
 
  Lorena
 
  [[alternative HTML version deleted]]
 
  ___
  R-help-es mailing list
  R-help-es@r-project.org mailto:R-help-es@r-project.org
  https://stat.ethz.ch/mailman/listinfo/r-help-es
 
 
  ___
  R-help-es mailing list
  R-help-es@r-project.org mailto:R-help-es@r-project.org
  https://stat.ethz.ch/mailman/listinfo/r-help-es
 
 


 [[alternative HTML version deleted]]

 ___
 R-help-es mailing list
 R-help-es@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-help-es


[[alternative HTML version deleted]]

___
R-help-es mailing list

Re: [R-es] diferentes escalas en el X de un grafico con varios paneles

2014-11-06 Thread eric
Hola Gerardo, antes hice algo parecido para una presentacion a publico 
general, y nadie se dio cuenta, pero ahora tengo que enviar ese grafico 
a una revista cientifica.

Gracias.

Slds,  eric.




On Thu 06 Nov 2014 14:20:39 CLST, Gerardo Gold-Bouchot wrote:
 Puedes sumarle 1 a todos tus valores, para que puedas usar la escala
 logarítmica.

 Saludos,

 Gerardo

 2014-11-06 11:07 GMT-06:00 eric ericconchamu...@gmail.com
 mailto:ericconchamu...@gmail.com:

 Estimados, tengo el siguiente problema:

 Tengo que graficar la concentracion de un metabolito en algunas
 muestras
 contra la concentracion del solvente con que fue extraido. Las
 concentraciones varian desde cero (para un control) hasta varios miles
 de unidades de concentracion (miliMolar).

 Para que se puedan diferenciar los puntos en el eje X, se ha usado una
 escala logaritmica. Hasta ahi todo bien. El problema se produce
 con los
 valores del control, que por tener una concentracion de solvente
 igual a
 cero, no puede aparecer en el grafico, pues, como saben, la escala
 logaritmica no admite un cero.

 Como podria hacer un grafico como el que se adjunta pero
 incluyendo los
 datos del control y manteniendo la escala logaritmica en el eje X ?

 Alguna idea ?




 Haaa aprovecho de preguntar porque aparecen dos marcas tan juntas
 en el
 grafico que adjunto. Este es el codigo con el que lo hice:

 xyplot(V1 ~ con | sol + dia
 , groups=nca
 , data=de.pgc
 , auto.key=list(space=right)
 , strip = strip.custom(strip.names = TRUE)
 , scales=list(x=list(log=10), equispaced.log=FALSE, y
 = list(at =
 1:3), cex=1.2)
 , xlab=list(Solvent concentration (mM), cex=1.2)
 , ylab=list(Numbers of samples with cis bonds, cex=1.2)
 , ylim=c(0.5,3.5)
 #, xlim=c(0,5000)
 )



 Slds, eric.



 --
 Forest Engineer
 Master in Environmental and Natural Resource Economics
 Ph.D. student in Sciences of Natural Resources at La Frontera
 University
 Member in AguaDeTemu2030, citizen movement for Temuco with green city
 standards for living

 Nota: Las tildes se han omitido para asegurar compatibilidad con
 algunos
 lectores de correo.

 ___
 R-help-es mailing list
 R-help-es@r-project.org mailto:R-help-es@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-help-es



--
Forest Engineer
Master in Environmental and Natural Resource Economics
Ph.D. student in Sciences of Natural Resources at La Frontera University
Member in AguaDeTemu2030, citizen movement for Temuco with green city 
standards for living

Nota: Las tildes se han omitido para asegurar compatibilidad con 
algunos lectores de correo.

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] diferentes escalas en el X de un grafico con varios paneles

2014-11-06 Thread Gerardo Gold-Bouchot
Es un truco muy com�n en varias disciplinas, particularmente en Ecolog�a,
as� que no deber�a haber problema. De hecho en la Biblia de Ecolog�a
Cuantitativa, de Legendre y Legendre, se recomienda sumar un n�mero que sea
del mismo orden de magnitud del valor de la media op mediana de la
variable, para no sesgar los resultados hacia arriba o hacia abajo, pero
dado que tu solo quieres un gr�fico creo que sumar 1 es ideal.

Saludos,

Gerardo

2014-11-06 11:48 GMT-06:00 eric ericconchamu...@gmail.com:

 Hola Gerardo, antes hice algo parecido para una presentacion a publico
 general, y nadie se dio cuenta, pero ahora tengo que enviar ese grafico
 a una revista cientifica.

 Gracias.

 Slds,  eric.




 On Thu 06 Nov 2014 14:20:39 CLST, Gerardo Gold-Bouchot wrote:
  Puedes sumarle 1 a todos tus valores, para que puedas usar la escala
  logar�tmica.
 
  Saludos,
 
  Gerardo
 
  2014-11-06 11:07 GMT-06:00 eric ericconchamu...@gmail.com
  mailto:ericconchamu...@gmail.com:
 
  Estimados, tengo el siguiente problema:
 
  Tengo que graficar la concentracion de un metabolito en algunas
  muestras
  contra la concentracion del solvente con que fue extraido. Las
  concentraciones varian desde cero (para un control) hasta varios
 miles
  de unidades de concentracion (miliMolar).
 
  Para que se puedan diferenciar los puntos en el eje X, se ha usado
 una
  escala logaritmica. Hasta ahi todo bien. El problema se produce
  con los
  valores del control, que por tener una concentracion de solvente
  igual a
  cero, no puede aparecer en el grafico, pues, como saben, la escala
  logaritmica no admite un cero.
 
  Como podria hacer un grafico como el que se adjunta pero
  incluyendo los
  datos del control y manteniendo la escala logaritmica en el eje X ?
 
  Alguna idea ?
 
 
 
 
  Haaa aprovecho de preguntar porque aparecen dos marcas tan juntas
  en el
  grafico que adjunto. Este es el codigo con el que lo hice:
 
  xyplot(V1 ~ con | sol + dia
  , groups=nca
  , data=de.pgc
  , auto.key=list(space=right)
  , strip = strip.custom(strip.names = TRUE)
  , scales=list(x=list(log=10), equispaced.log=FALSE, y
  = list(at =
  1:3), cex=1.2)
  , xlab=list(Solvent concentration (mM), cex=1.2)
  , ylab=list(Numbers of samples with cis bonds, cex=1.2)
  , ylim=c(0.5,3.5)
  #, xlim=c(0,5000)
  )
 
 
 
  Slds, eric.
 
 
 
  --
  Forest Engineer
  Master in Environmental and Natural Resource Economics
  Ph.D. student in Sciences of Natural Resources at La Frontera
  University
  Member in AguaDeTemu2030, citizen movement for Temuco with green city
  standards for living
 
  Nota: Las tildes se han omitido para asegurar compatibilidad con
  algunos
  lectores de correo.
 
  ___
  R-help-es mailing list
  R-help-es@r-project.org mailto:R-help-es@r-project.org
  https://stat.ethz.ch/mailman/listinfo/r-help-es
 
 

 --
 Forest Engineer
 Master in Environmental and Natural Resource Economics
 Ph.D. student in Sciences of Natural Resources at La Frontera University
 Member in AguaDeTemu2030, citizen movement for Temuco with green city
 standards for living

 Nota: Las tildes se han omitido para asegurar compatibilidad con
 algunos lectores de correo.



[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es