[R] How to make a deep copy of a list?

2022-11-12 Thread Giovanni Petris
end up with a modified version of the list argument. I believe passing to the function a deep copy of the list argument would solve my problem. Thank you in advance for the help! Giovanni -- Giovanni Petris Professor and Director of Statistics Department of Mathematical Sciences University

[R] Calling a LAPACK subroutine from R

2019-09-10 Thread Giovanni Petris
hods base loaded via a namespace (and not attached): [1] compiler_3.6.0 tools_3.6.0 Thank you in advance for your help! Best, Giovanni Petris -- Giovanni Petris, PhD Professor Director of Statistics Department of Mathematical Sciences University of Arkansas - Fayetteville,

Re: [R] Ajdustment of data symbols

2016-12-01 Thread Giovanni Petris
That's exactly what I was looking for! Thank you, Giovanni From: David L Carlson <dcarl...@tamu.edu> Sent: Thursday, December 1, 2016 10:18 To: Giovanni Petris; r-help@r-project.org Subject: RE: Ajdustment of data symbols Try this. The par("

[R] Ajdustment of data symbols

2016-12-01 Thread Giovanni Petris
oints(0.25, par("usr")[3], pch = 17, col = "red", cex = 2, xpd = TRUE) I would like to draw the triangle completely outside the plotting area, with the upper vertex touching the x-axis... Thank you in advance! Best, Giovanni -- Giovanni Petris, PhD Professor Director

[R] Generating unordered, with replacement, samples

2014-09-17 Thread Giovanni Petris
not matter, is choose(n + k -1, k). Does anyone have a suggestion about how to simulate (uniformly!) one of these possible samples? In a Monte Carlo framework I would like to do it repeatedly, so efficiency is of some relevance. Thank you in advance! Best, Giovanni Giovanni Petris Associate

Re: [R] Generating unordered, with replacement, samples

2014-09-17 Thread Giovanni Petris
13:49 To: Giovanni Petris; r-help@R-project.org Subject: Re: [R] Generating unordered, with replacement, samples Hello, Try function ?sample. Something like, if 'x' is a vector of size n, sample(x, k, replace = TRUE) If you want indices into 'x', try instead sample(n, k, replace = TRUE) Hope

Re: [R] Generating unordered, with replacement, samples

2014-09-17 Thread Giovanni Petris
, 2014 14:07 To: Giovanni Petris; r-help@R-project.org Subject: Re: [R] Generating unordered, with replacement, samples On 17/09/2014 2:25 PM, Giovanni Petris wrote: Hello, I am trying to interface in my teaching some elementary probability with Monte Carlo ideas. In sampling from a finite

Re: [R] Generating unordered, with replacement, samples

2014-09-17 Thread Giovanni Petris
Thank you! That does exactly what I was looking for. Best, Giovanni From: Duncan Murdoch [murdoch.dun...@gmail.com] Sent: Wednesday, September 17, 2014 15:02 To: Giovanni Petris; r-help@R-project.org Subject: Re: [R] Generating unordered

Re: [R] KalmanForecast (stats)

2013-07-02 Thread Giovanni Petris
. Best, Giovanni From: Bert Gunter [gunter.ber...@gene.com] Sent: Monday, July 01, 2013 10:25 PM To: Giovanni Petris Cc: Csima Gabriella; r-help@r-project.org Subject: Re: [R] KalmanForecast (stats) Below... On Mon, Jul 1, 2013 at 7:24 PM, Giovanni Petris

Re: [R] KalmanForecast (stats)

2013-07-01 Thread Giovanni Petris
Gabriella, There is no function KalmanForecast in package stats, so I am not quite sure about what you are talking about. That said, it may help a review paper that I wrote a couple of years ago about the different packages available in R for state space modeling (Petris Petrone, State space

Re: [R] KalmanForecast (stats)

2013-07-01 Thread Giovanni Petris
Oops... Correction: The function KalmanForecast does exist in package stats. The references that I gave in my other reply are still valid, though. It is my impression that Kalman filtering facilities in stats are not meant to be used directly by the end user of R, but their main purpose is to

Re: [R] Tracking time-varying objects with the DLM package (dynamic linear models in R)

2013-02-20 Thread Giovanni Petris
Hi Samantha, I had not anticipated such kind of requests, so getting what (I believe) you want is not totally trivial. However, what 'dlmFilter' does, when dealing with a time-varying DLM, is to build, at each time, the appropriate matrix W from 'JW' and 'X'. So, I suggest that you look at

Re: [R] How to stack row vector on top of each other?

2013-02-15 Thread Giovanni Petris
How about c(a, b) ? HTH, Giovanni From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] on behalf of Nordlund, Dan (DSHS/RDA) [nord...@dshs.wa.gov] Sent: Thursday, February 14, 2013 7:19 PM To: r-help Subject: Re: [R] How to stack row

Re: [R] State Space + Kalman Filter

2012-10-18 Thread Giovanni Petris
Package dlm does it, as well as other contributed packages (KFAS, sspir, dse,...) Best, Giovanni From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] on behalf of nserdar [snes1...@hotmail.com] Sent: Thursday, October 18, 2012 8:40 AM To:

[R] knitr customization

2012-05-25 Thread Giovanni Petris
would do \fvset{listparameters={\setlength{\topsep}{0pt}}} \renewenvironment{Schunk}{\vspace{\topsep}}{\vspace{\topsep}} Sorry for the many questions and thank you in advance for any help and insight you can give me. Best, Giovanni -- Giovanni Petris gpet...@uark.edu Associate Professor

Re: [R] Implementing a Kalman filter in R

2012-05-21 Thread Giovanni Petris
In addition to the papers suggested by Roy, if you are interested in a book-length treatment of state space models and Kalman filter in R, I would look at http://www.springer.com/978-0-387-77237-0 And I would carry out the implementation in R using package dlm Just my (biased) 2 cents

[R] Sweave, beamer and alert within code chunks

2012-05-09 Thread Giovanni Petris
)) \alert2{# V must be positive} mleOut$convergence \alert3{# always check this!!!} [1] 0 \end{semiverbatim} How can I get a similar effect using Sweave? Thank you in advance! Best, Giovanni Petris -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences

Re: [R] grouping

2012-04-03 Thread Giovanni Petris
-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. -- Giovanni Petris gpet...@uark.edu Associate Professor Department

Re: [R] Ensuring a matrix to be positive definite, case involving three matrices

2011-11-18 Thread Giovanni Petris
://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http

Re: [R] package dlm: dlmForecast()

2011-10-10 Thread Giovanni Petris
I haven't tried this, but I am pretty confident that using dlmFilter() with fictitious future values of the observations set to NA should do the job. Hope this helps, Giovanni Petris On Sat, 2011-10-08 at 13:21 +, YuHong wrote: May I have a question about dlmForecast() function

Re: [R] Hessian matrix issue

2011-09-06 Thread Giovanni Petris
About the numerical calculation of the Hessian matrix, I have found numDeriv:::hessian to be often more accurate than the Hessian returned by optim. Best, Giovanni Petris On Sat, 2011-09-03 at 13:39 -0400, John C Nash wrote: Unless you are supplying analytic hessian code, you are almost

Re: [R] Synchronizing R libraries on N machines?

2011-08-26 Thread Giovanni Petris
, Giovanni Petris gpet...@uark.edu wrote: Hello! I am using R on two different machines (under Ubuntu and OS X, but this is probably irrelevant) and I would like to keep the two installations 'synchronized', in particular in terms

Re: [R] Setting up a State Space Model in dlm

2011-08-26 Thread Giovanni Petris
. Hope this clarifies the issue. Best, Giovanni Petris On Thu, 2011-08-25 at 19:30 -0700, quantguy wrote: I get the identical error even when applying the sample code from the dlm vignette on state space models: http://www.jstatsoft.org/v41/i04/paper The sample code is here: tmp - ts

Re: [R] Setting up a State Space Model in dlm

2011-08-26 Thread Giovanni Petris
values for the optimizer. Best, Giovanni Petris Michael Ash-2 wrote: This question pertains to setting up a model in the package dlm (dynamic linear models, http://cran.r-project.org/web/packages/dlm/index.html I have read both the vignette and An R Package for Dynamic Linear Models (http

Re: [R] Setting up a State Space Model in dlm

2011-08-26 Thread Giovanni Petris
), start = start(market), freq = frequency(market)) On Fri, Aug 26, 2011 at 9:41 AM, Giovanni Petris [via R] ml-node+3770873-1409921251-254...@n4.nabble.com wrote: Oops.. You need to add the following line, right after the m - NCOL(y) statement: k - m * (m+1) / 2 'k

[R] Synchronizing R libraries on N machines?

2011-08-25 Thread Giovanni Petris
it installed also on my Mac, and vice versa. I imagine this to be a fairly common problem, so I would like to ask if anybody has suggestions to share about it. Is there a way to make the synchronization automatic? Painless? Thank you in advance for the suggestions. Best, Giovanni -- Giovanni

Re: [R] how to generate a normal distribution with mean=1, min=0.2, max=0.8

2011-04-29 Thread Giovanni Petris
read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575

Re: [R] How to generate normal mixture random variables with given covariance function

2011-04-22 Thread Giovanni Petris
suppose these m random variables are jointly m-dimensional normal This is not related to R, so you should probably ask the question somewhere else. The short answer is that the Z_i cannot be jointly Normally distributed, since they are not marginally Normally distributed. Giovanni Petris

Re: [R] Help with read.csv

2011-03-10 Thread Giovanni Petris
. Thanks again for the help from this great list! Best, Giovanni On Wed, 2011-03-09 at 15:10 -0800, David Wolfskill wrote: On Wed, Mar 09, 2011 at 04:32:29PM -0600, Giovanni Petris wrote: Hello, I have a file that looks like this: Date,Hour,DA_DMD,DMD,DA_RTP,RTP,, 1/1

[R] Help with read.csv

2011-03-09 Thread Giovanni Petris
data into R? Thanks in advance, Giovanni -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris

Re: [R] bootstrap resampling question

2011-03-02 Thread Giovanni Petris
wrote on 03/01/2011 09:37:31 AM: [image removed] Re: [R] bootstrap resampling question Giovanni Petris to: Bodnar Laszlo EB_HU 03/01/2011 11:58 AM Sent by: r-help-boun...@r-project.org Cc: 'r-help@r-project.org' A simple way of sampling

[R] Line numbering in Sweave

2011-03-02 Thread Giovanni Petris
Is there a way of getting line numbers in Schunks? Ideally, I would like to have numbers printed every two or five lines. Thank you in advance, Giovanni -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Giovanni Petris
But this seems to me to be equivalent to sample(rep(1:20, 5), 20), which I previously suggested and was pointed out to be wrong Giovanni On Wed, 2011-03-02 at 11:05 -0700, Vokey, John wrote: On 2011-03-02, at 4:00 AM, r-help-requ...@r-project.org wrote: Hello there, I have a

Re: [R] bootstrap resampling question

2011-03-01 Thread Giovanni Petris
}} __ 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. -- Giovanni Petris gpet...@uark.edu

Re: [R] Markov chain transition model, data replication project

2011-02-25 Thread Giovanni Petris
. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris/ __ R-help@r-project.org mailing list https

Re: [R] Saturated model in binomial glm

2011-02-17 Thread Giovanni Petris
this issue, but probably not well enough. Bill Venables. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Giovanni Petris Sent: Thursday, 17 February 2011 7:58 AM To: r-help@r-project.org Subject: [R] Saturated model in binomial

[R] Saturated model in binomial glm

2011-02-16 Thread Giovanni Petris
in advance, Giovanni -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris/ __ R-help@r-project.org

Re: [R] Estimation and Forecast of Seasonal Component

2011-02-04 Thread Giovanni Petris
I would probably use a Dynamic Linear Model, combining seasonal component and regression. See package dlm and its vignette for examples. HTH, Giovanni On Tue, 2011-02-01 at 11:01 +, Paolo Rossi wrote: Hi list, I would like to estimate and forecast the seasonal component of a series.

Re: [R] VARMA

2010-12-09 Thread Giovanni Petris
Package dse does. HTH, Giovanni On Wed, 2010-12-08 at 17:45 +0100, Garten Stuhl wrote: Hi all, I want to estimate parameters from a VARMA(p,q)-Modell. The equations of the model or the model structures is given by: Xt=beta1+beta2*Xt-1+beta3*Yt-1+epsilon1

Re: [R] StructTS with 2 seasons

2010-11-30 Thread Giovanni Petris
read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324

Re: [R] Non-positive definite cross-covariance matrices

2010-11-15 Thread Giovanni Petris
What made you think that a cross-covariance matrix should be positive definite? Id does not even need to be a square matrix, or symmetric. Giovanni Petris On Mon, 2010-11-15 at 12:58 -0500, Jeff Bassett wrote: I am creating covariance matrices from sets of points, and I am having frequent

Re: [R] simulation from pareto distn

2010-11-10 Thread Giovanni Petris
For a Pareto distribution, even a truncated one, the inverse CDF method should be straightforward to implement. Giovanni Petris On Tue, 2010-11-09 at 10:50 -0600, cassie jones wrote: Dear all, I am trying to simulate from truncated Pareto distribution. I know there is a package called

Re: [R] Computing ergodic mean with CODA

2010-11-08 Thread Giovanni Petris
Hola Raquel, As Ben already told you, ergodic means are pretty easy to compute from scratch. If you are lazy, or you want something more, like estimated standard errors, you can check out the functions ergMean and mcmcMean in package dlm. Best, Giovanni Petris On Sun, 2010-11-07 at 14:34 -0200

Re: [R] conditional probability

2010-11-08 Thread Giovanni Petris
more carefully. Giovanni Petris On Mon, 2010-11-08 at 19:31 +1100, Michael Bedward wrote: Hello Jumlong, For Normal distribution see the help page for pnorm. For dealing with unknown (empirical) distributions, look at ecdf. Hope this helps Michael On 8 November 2010 16:29, Jumlong

Re: [R] Random Sample

2010-11-08 Thread Giovanni Petris
0.4973270 0.6544219 [8] 0.1257485 0.2756357 0.5672207 .Random.seed - x runif(10) [1] 0.5610780 0.5911841 0.5868183 0.3833801 0.7397059 0.4973270 0.6544219 [8] 0.1257485 0.2756357 0.5672207 Best, Giovanni Petris On Mon, 2010-11-08 at 16:05 -0500, Jorge Ivan Velez wrote: Hi Xiaoxi, Take a look

Re: [R] dlm package: how to specify state space model?

2010-10-06 Thread Giovanni Petris
the observation variance for u_t and/or r_t to be a parameter and you will end up with a random walk plus noise model (local level model) for u_t (and/or r_t). HTH, Giovanni Petris On Tue, 2010-10-05 at 22:30 -0400, Christian Schoder wrote: Dear r-users! I have another question regarding the dlm package

Re: [R] time series

2010-09-28 Thread Giovanni Petris
Unless you tell us what model or what forecasting technique you want to use, it seems to me that this is more a question about Statistics than about using R. Best, Giovanni Petris On Mon, 2010-09-27 at 23:02 +0100, Dr. Alireza Zolfaghari wrote: Hi list, I have a set of data which I want

[R] Installation problem

2010-08-13 Thread Giovanni Petris
:6787: gcc -E -I/usr/local/include conftest.c conftest.c:17:28: error: ac_nonexistent.h: No such file or directory ...other stuff here... Could anybody help me? I am also attaching the file config.log for more info. Thank you in advance, Giovanni Petris -- Giovanni Petris gpet...@uark.edu

Re: [R] Kalman Filter

2010-05-26 Thread Giovanni Petris
model, a model state space. I am wondering all the commands in R, to represent the linear dynamic model and Kalman filter. I am available for any questions. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR

Re: [R] Random walk

2010-05-12 Thread Giovanni Petris
. finally I solve my problem with a brute-force algorithm. Searching in the web I found some pages about random walks and neural networks where people said that this task is very difficult and is in a exploratory step nowadays. Thank you very much for your help Sergio Giovanni

Re: [R] Random walk

2010-05-11 Thread Giovanni Petris
Hi Sergio, Your function does not estimate what you want. In fact it does not estimate anything useful. A random walk is not stationary; in particular, the variance at time t is t. Therefore, estimating variances based on one run, averaging over time, does not make any sense. This is what you are

Re: [R] StructTS standard errors

2009-12-22 Thread Giovanni Petris
, Giovanni Petris wrote: Sorry for asking again, but I did not receive any answers - I know it's a busy time... ;-) Shell I conclude that it is not possible to obtain standard errors from StructTS() or its output? Thanks, Giovanni Petris - Original Message - From

Re: [R] StructTS standard errors

2009-12-21 Thread Giovanni Petris
Sorry for asking again, but I did not receive any answers - I know it's a busy time... ;-) Shell I conclude that it is not possible to obtain standard errors from StructTS() or its output? Thanks, Giovanni Petris - Original Message - From: Giovanni Petris gpet...@uark.edu Date

[R] StructTS standard errors

2009-12-17 Thread Giovanni Petris
Hello, Does anybody know if (and how) it is possible to obtain standard errors of estimated variances from StructTS? (R 2.10.0). Thank you in advance, Giovanni __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Antw: Re: Density estimate with bounds

2009-11-05 Thread Giovanni Petris
__ 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. -- Giovanni Petris gpet

Re: [R] Efficient way to code using optim()

2009-10-30 Thread Giovanni Petris
Unless this is a homework problem, you would be much better off using glm(). Giovanni Date: Fri, 30 Oct 2009 12:23:45 -0700 From: parkbomee bbom...@hotmail.com Sender: r-help-boun...@r-project.org Importance: Normal Precedence: list --Boundary_(ID_/D+lL9iK1qLhrkPBeoxH+Q)

Re: [R] Problem using the source-function within R-functions

2009-10-20 Thread Giovanni Petris
-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. --===0554064772==-- -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630

Re: [R] different time series in one plot

2009-10-09 Thread Giovanni Petris
__ 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. -- Giovanni Petris gpet

Re: [R] Evaluating/comparing dynamic linear model

2009-10-08 Thread Giovanni Petris
The standard asymptotic theory of likelihood ratio tests assumes that you are testing a submodel, which is not the case here. Moreover, even when testing submodels, there are other assumptions that often are not met in the case of DLMs - the typical example being hypothesised values on the

Re: [R] how to fit time varying coefficient regression model?

2009-10-06 Thread Giovanni Petris
, reproducible code. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris/ __ R-help@r-project.org

Re: [R] Text editors for Sweave (rnw) files

2009-10-06 Thread Giovanni Petris
Emacs + ESS does too. Giovanni Date: Tue, 06 Oct 2009 12:34:28 -0400 From: Gabor Grothendieck ggrothendi...@gmail.com Sender: r-help-boun...@r-project.org Cc: r-help@r-project.org Precedence: list DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;

Re: [R] How to refer to the last a few rows?

2009-09-14 Thread Giovanni Petris
and provide commented, minimal, self-contained, reproducible code. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris

[R] State Space models in R

2009-09-11 Thread Giovanni Petris
) and opinions about the different packages, but I would also like to summarize in my paper the feedback I get from the R community. Thank you in advance. Best, Giovanni Petris -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas

Re: [R] vector of Vectors

2009-09-09 Thread Giovanni Petris
the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630

Re: [R] how to generate a random correlation matrix with restrictions

2009-08-31 Thread Giovanni Petris
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. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical

Re: [R] mixed normal distriburtion

2009-08-25 Thread Giovanni Petris
With n = 100 I can see the two modes well separated in a density plot. However, I don't see why you cannot plot the density function, if that's what you need: curve(0.6 * dnorm(x, 0.4, 0.1) + 0.4 * dnorm(x, 0.8, 0.1), 0, 1.2) Best, Giovanni Date: Tue, 25 Aug 2009 13:55:26 +0100 From:

Re: [R] Time Series smoothing

2009-08-07 Thread Giovanni Petris
periods Thanks. Giovanni Petris wrote: Please do read the posting guides and give us a reproducible example. We don't know what the errors you get from HoltWinters are. I guess we need to see the data you are using etc. Giovanni Petris Date: Thu, 06 Aug 2009 11:33:58 -0700

Re: [R] Time Series smoothing

2009-08-06 Thread Giovanni Petris
Please do read the posting guides and give us a reproducible example. We don't know what the errors you get from HoltWinters are. I guess we need to see the data you are using etc. Giovanni Petris Date: Thu, 06 Aug 2009 11:33:58 -0700 (PDT) From: voidobscura nshah...@gmail.com Sender: r-help

Re: [R] Why is 0 not an integer?

2009-08-06 Thread Giovanni Petris
I ran an instant experiment... typeof(0) [1] double typeof(-0) [1] double identical(0, -0) [1] TRUE Best, Giovanni By the way: Are there difference between -0 and 0? __ R-help@r-project.org mailing list

Re: [R] Systematic resampling

2009-07-31 Thread Giovanni Petris
12.887 ### ...while using multinomial resampling: system.time( + index - sample(N, N, replace = TRUE, prob = w) + ) user system elapsed 0.344 0.020 0.366 Date: Wed, 29 Jul 2009 13:32:14 -0500 (CDT) From: Giovanni Petris gpet...@uark.edu Sender: r-help-boun...@r-project.org

[R] Systematic resampling (in sequential Monte Carlo)

2009-07-29 Thread Giovanni Petris
Dear all, Here is a little coding problem. It falls in the category of how can I do this efficiently? rather than how can I do this? (I know how to do it inefficiently). So, if you want to take the challenge, keep reading, otherwise just skip to the next post - I won't be offended by that ;-)

Re: [R] list of lm() results

2009-07-21 Thread Giovanni Petris
, self-contained, reproducible code. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris

Re: [R] Solving quadratic equations with covariance term

2009-07-07 Thread Giovanni Petris
It is not clear to me whether you are talking about a covariance (a theoretical quantity depending on the distribution of A and x) or an empirical covariance, estimated from some data. In the first case you don't need to solve anything because, as long as A is fixed, i.e. non-random, its

Re: [R] Uncorrelated random vectors

2009-07-07 Thread Giovanni Petris
Here is one way: x - rnorm(100) y - rnorm(100) z - residuals(lm(y ~ x)) cor(x, z) [1] 3.610290e-17 Best, Giovanni Date: Tue, 07 Jul 2009 16:26:02 +0200 From: Stein, Luba (AIM SE) luba.st...@allianz.com Sender: r-help-boun...@r-project.org Accept-Language: en-US, de-DE Precedence: list

Re: [R] how to count number of elements in a vector that are not NA ?

2009-07-07 Thread Giovanni Petris
sum(!is.na(x)) Date: Tue, 07 Jul 2009 14:56:54 -0400 From: Godmar Back god...@gmail.com Sender: r-help-boun...@r-project.org Precedence: list DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; Hi,

Re: [R] mode(x) - double

2009-04-30 Thread Giovanni Petris
-guide.html and provide commented, minimal, self-contained, reproducible code. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris

[R] Combining Sweave and fancyvrb

2009-03-17 Thread Giovanni Petris
in advance for your suggestions! Giovanni -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris

Re: [R] Forecasting with dlm

2009-03-11 Thread Giovanni Petris
Hi Michael, There was a bug in dlmForecast that I have fixed. While the new version of the package makes its way to CRAN, you can source the attached file, which contains the amended version of dlmForecast. Best, Giovanni Petris Date: Wed, 11 Mar 2009 13:39:36 + From: Michael Pearmain

Re: [R] ARIMA question

2009-02-23 Thread Giovanni Petris
://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. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University

Re: [R] Normal cdf modified function

2009-02-18 Thread Giovanni Petris
elementary algebra, is enough to compute the probability you are interested in. two types of inequalities ( and ) can be mixed? (The user would have to specify the set of indexes with inequalities of the type ) Giovanni -- Giovanni Petris gpet...@uark.edu Associate Professor Department

Re: [R] R solve equation

2009-02-09 Thread Giovanni Petris
commented, minimal, self-contained, reproducible code. -- Giovanni Petris gpet...@uark.edu Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris

[R] line length in legend

2008-12-10 Thread Giovanni Petris
with a legend in which the dot-dash patterns of the different line types are hard to distinguish. With a longer piece of line that would be easier. Thank you in advance, Giovanni -- Giovanni Petris [EMAIL PROTECTED] Associate Professor Department of Mathematical Sciences University of Arkansas

Re: [R] package plm

2008-12-09 Thread Giovanni Petris
-guide.html and provide commented, minimal, self-contained, reproducible code. -- Giovanni Petris [EMAIL PROTECTED] Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris

Re: [R] DLM - Covariates in the system equation

2008-12-08 Thread Giovanni Petris
be addressed to the package maintainer first. Best, Giovanni Petris (author of package dlm) Date: Mon, 08 Dec 2008 00:17:29 -0500 From: [EMAIL PROTECTED] Sender: [EMAIL PROTECTED] Precedence: list Is there a way to add covariates to the system equation in a time-varying approach: Y[t] = F'[t

Re: [R] Breakdown of Vector

2008-11-21 Thread Giovanni Petris
Also something along the following lines: x - 1:100 y - split(x, (seq(along = x) - 1) %/% 5) HTH, Giovanni Petris Date: Fri, 21 Nov 2008 07:48:09 -0800 (PST) From: Rajasekaramya [EMAIL PROTECTED] Sender: [EMAIL PROTECTED] Precedence: list Hi, I have a vector of Size 7420. I wanna

Re: [R] TIme Series AR to MA and (viceversa)

2008-11-04 Thread Giovanni Petris
code. -- Giovanni Petris [EMAIL PROTECTED] Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris/ __ R-help@r-project.org

Re: [R] Kalman Filter

2008-11-03 Thread Giovanni Petris
-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ^ Please do so. It makes much more easy to understand and answer your questions. Best, Giovanni Petris -- Giovanni Petris [EMAIL

[R] Two math expressions in plot

2008-10-09 Thread Giovanni Petris
= substitute(n == k, list(k = k))) ### this works plot(0,0, main = substitute(N[eff] == neff, list(neff = n.eff[k]))) ### this doesn't work plot(0,0, main = substitute(n == k * N[eff] == neff, list(k = k, neff = n.eff[k]))) Thanks in advance, Giovanni -- Giovanni Petris [EMAIL PROTECTED

[R] Quantiles of weighted sample

2008-10-08 Thread Giovanni Petris
that applies to a discrete distribution specified by values and their probabilities. Thanks in advance. Best, Giovanni Petris -- Giovanni Petris [EMAIL PROTECTED] Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630

Re: [R] more efficient double summation...

2008-08-29 Thread Giovanni Petris
*mu)/sqrt(2*sig))/ sqrt(2*sig)) Best, Giovanni Petris Date: Thu, 28 Aug 2008 21:47:38 -0700 (PDT) From: kathie [EMAIL PROTECTED] Sender: [EMAIL PROTECTED] Precedence: list Dear R users... I made the R-code for this double summation computation http://www.nabble.com/file/p19213599

Re: [R] Exponential smoothing?

2008-08-19 Thread Giovanni Petris
, minimal, self-contained, reproducible code. -- Giovanni Petris [EMAIL PROTECTED] Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris

Re: [R] Question: Beginner stuck in a R cycle

2008-07-08 Thread Giovanni Petris
/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Giovanni Petris [EMAIL PROTECTED] Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http://definetti.uark.edu/~gpetris

Re: [R] A Very Simple Question

2008-05-13 Thread Giovanni Petris
__ 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. -- Giovanni Petris [EMAIL PROTECTED] Associate

Re: [R] hessian in constrained optimization (constrOptim)

2008-05-13 Thread Giovanni Petris
read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Giovanni Petris [EMAIL PROTECTED] Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575

Re: [R] dlm with constant terms

2008-05-07 Thread Giovanni Petris
] [0 e 0 ] [0 0 C_0] The 'e' on the diagonal of C^*_0 should be zero, but since the matrix must be nonsingular youcan put a very small number, such as e = 1e-8. Best, Giovanni Petris Thanks, Tsvetan

[R] GLMM and data manipulation (2nd try)

2008-05-02 Thread Giovanni Petris
? If this is the case, what is a clean way of doing it? Thank you in advance, Giovanni Petris -- Giovanni Petris [EMAIL PROTECTED] Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6324, 575-8630 (fax) http

Re: [R] GLMM and data manipulation (2nd try)

2008-05-02 Thread Giovanni Petris
Thank you again, Giovanni Date: Sat, 03 May 2008 06:43:22 +1000 From: Andrew Robinson [EMAIL PROTECTED] Cc: r-help@r-project.org User-Agent: Mutt/1.4.2.3i On Fri, May 02, 2008 at 03:06:31PM -0500, Giovanni Petris wrote: Hello, I posted a question yesterday but I got no replies, so

Re: [R] Forecasting observations in ARFIMA

2008-05-01 Thread Giovanni Petris
-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. -- Giovanni Petris [EMAIL PROTECTED] Associate Professor Department

[R] Data manipulation for random intercept GLMM

2008-05-01 Thread Giovanni Petris
32 19 356 Female 440 25 14 18 14 47 22 457 (Here '111' means (Yes, Yes, Yes) on the three items, etc.) How can I tranform elegantly this table into a dataframe that I can feed to lmer? Thank you in advance for your replies! Giovanni Petris -- Giovanni Petris [EMAIL PROTECTED

Re: [R] Multidimensional contingency tables

2008-04-23 Thread Giovanni Petris
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Giovanni Petris [EMAIL PROTECTED] Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph

  1   2   >