Re: [R] Generate random Bernoulli draws

2018-07-06 Thread Marino David
wrote: > >> > >> On 06/07/2018 1:18 PM, Berry, Charles wrote: > >>> A liitle math goes along way. See below. > >>>> On Jul 5, 2018, at 10:35 PM, Marino David > wrote: > >>>> > >>>> Dear Bert, > >>>> > &

Re: [R] Generate random Bernoulli draws

2018-07-06 Thread Marino David
> Ben > > On Jul 6, 2018, at 1:35 AM, Marino David wrote: > > Dear Bert, > > I know it is a simple question. But for me, at current, I fail to implement > it. So, I ask for help here. > > It is not homework. > > Best, > > David > > 2018-07-06 13:

Re: [R] Generate random Bernoulli draws

2018-07-05 Thread Marino David
Cheers, > Bert > > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > On Thu, Jul 5, 2018 at 10:23 PM, Ma

[R] Generate random Bernoulli draws

2018-07-05 Thread Marino David
Dear All, I would like to generate N random Bernoulli draws given a probability function F(x)=1-exp(-2.5*x) in which x follows uniform distribution, say x~U(0,2). Can some one leave me some code lines for implementing this? Thanks in advance. David [[alternative HTML version deleted]]

[R] Run an external software in R

2016-09-06 Thread Marino David
Hi all R users: Does anybody have the experience of running an external software in R? I try to use R to run ANSYS software, which is a engineering simulation package. I ever have done this task in Matlab platform by executing the following code line: system('"C:\Program Files\Ansys Inc\v100\ANSY

Re: [R] Partition of sums of squares (ANOVA)

2014-07-22 Thread Marino David
d here. > > Cheers, > Bert > > Bert Gunter > Genentech Nonclinical Biostatistics > (650) 467-7374 > > "Data is not information. Information is not knowledge. And knowledge > is certainly not wisdom." > Clifford Stoll > > > > > On Tue, Ju

[R] Partition of sums of squares (ANOVA)

2014-07-22 Thread Marino David
Hi all r-mailling listers: Can anyone explain the theory (or the formula) about computing Sum Sq (color highligh below) related to regression items? The link of Wikipedia ( http://en.wikipedia.org/wiki/Partition_of_sums_of_squares) gives an introduction on how to calculate the total, model, and r

Re: [R] How to choose data from two sets of data to ensure that the choosed data has a better normal feature?

2013-12-16 Thread Marino David
Anyway, thanks for all your response. These two sets of data are similar. let's assume them are obtained from two experimental setups but at the situation, so they are more similar but not the same because measure error may be involved. I hope I can chose a set of data with a better normal feature

[R] How to choose data from two sets of data to ensure that the choosed data has a better normal feature?

2013-12-15 Thread Marino David
Hi R mailing listers: Assume that there are two sets of data (denoted as A and B) with the same size, say 100X1. And I try to select a new set of data (100X1) that has a better normal feature from these two sets. Better normal feature means that the histogram shape of the constructed set of dat

Re: [R] How to use variables whose names are with number at end in R loop

2013-12-14 Thread Marino David
Thanks Hervé Pagès and A. K.. It works. Thank you! David 2013/12/14 Hervé Pagès > Hi David, > > > On 12/14/2013 01:06 PM, Marino David wrote: > >> Hi all: >> >> Assume that I have variables, say v1, v2,...,v100 and I want to use one >> variable in

[R] How to use variables whose names are with number at end in R loop

2013-12-14 Thread Marino David
Hi all: Assume that I have variables, say v1, v2,...,v100 and I want to use one variable in each roop. How can I do this? See below for (i in 1:100){ f(vi) } Thanks David [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] Geweke Diagnostic in CODA package

2013-11-08 Thread Marino David
Hi all: The CODA package provides Geweke Diagnostic method for convergence checking. The geweke.diag in CODA returns Z-score value but not give a conclustion that it is convergence or not. So I'd like to know how small/big the magnitude of Z-score is corresponding to the convergence of a chain. T

Re: [R] Gaussian Quadrature for arbitrary PDF

2013-10-21 Thread Marino David
Greatly enrich my mind. Thank you! David 2013/10/16 Spencer Graves > On 10/15/2013 5:37 PM, Marino David wrote: > > Hi Spencer: > > Thanks for your interpretation again and again. Your statement does > enable me to have a good understanding of Gaussian quadrature. > &

Re: [R] Gaussian Quadrature for arbitrary PDF

2013-10-15 Thread Marino David
unction you want using > the distr package to compute the distribution of f(X) and E{distrEx} to > compute the expected value? > > > Best Wishes, > Spencer > > > p.s. Could you please post a summary of this exchange to R-help, so > someone else with a similar

Re: [R] Gaussian Quadrature for arbitrary PDF

2013-10-10 Thread Marino David
erwise, as > described in the Wikipedia article on "orthogonal polynomials". > > > On 10/10/2013 5:02 PM, Marino David wrote: > > Hi all, > > We know that Hermite polynomial is for > Gaussian, Laguerre polynomial for Exponential > distribution, Legendre

[R] Gaussian Quadrature for arbitrary PDF

2013-10-10 Thread Marino David
Hi all, We know that Hermite polynomial is for Gaussian, Laguerre polynomial for Exponential distribution, Legendre polynomial for uniform distribution, Jacobi polynomial for Beta distribution. Does anyone know which kind of polynomial deals with the log-normal, Student’s t, Inverse gamma and Fis

Re: [R] A question about multivariate normal distribution with a diagonal covariance matrix

2013-08-29 Thread Marino David
You got the point. Thank you for pointing out the problem. Thanks again. David 2013/8/30 Duncan Murdoch > On 29/08/2013 1:37 PM, Marino David wrote: > >> Hi all R users: >> >> >> >> I am a little bit confused about the following results. See as

[R] A question about multivariate normal distribution with a diagonal covariance matrix

2013-08-29 Thread Marino David
Hi all R users: I am a little bit confused about the following results. See as follows: library(mvtnorm) xMean<-c(24.12,66.92,77.65,131.97,158.8) xVar<-c(0.01,0.06,0.32,0.18,0.95) xFloor<-floor(xMean) # use “mvtnorm” package p1<-dmvnorm(xFloor,mean=xMean,sigma=diag(xVar)) p2<-dmvnor

Re: [R] How to view the source of code?

2013-08-23 Thread Marino David
Thanks a lot. It works 2013/8/23 Berend Hasselman > > On 23-08-2013, at 07:40, Marino David wrote: > > > Hi all R mailing listers: > > > > I am using the coda package. I tried to view the source of HPDinterval > code > > by typing fix(HPDinterval), it d

[R] How to view the source of code?

2013-08-22 Thread Marino David
Hi all R mailing listers: I am using the coda package. I tried to view the source of HPDinterval code by typing fix(HPDinterval), it dispalys as follows: function (obj, prob = 0.95, ...) UseMethod("HPDinterval") Then I search the answers about this case (see below), it still failed. Thank you in

Re: [R] It seams that fast99 function (sensitivity package) does not work out for norm distribution.

2013-06-11 Thread Marino David
and 1. 2013/6/10 David Winsemius > > On Jun 9, 2013, at 4:08 PM, Marino David wrote: > > > The author has already gave the illustration and solution as well. > > > > Is that supposed to mean that you emailed the author and got a private > response? > > &g

Re: [R] It seams that fast99 function (sensitivity package) does not work out for norm distribution.

2013-06-09 Thread Marino David
The author has already gave the illustration and solution as well. Thanks. 2013/6/9 Uwe Ligges > > > On 08.06.2013 00:54, Marino David wrote: > >> Dear all mailing listers, >> >> Does Anyone have the same problem as mine when using the fast99 >> (extended

[R] It seams that fast99 function (sensitivity package) does not work out for norm distribution.

2013-06-07 Thread Marino David
Dear all mailing listers, Does Anyone have the same problem as mine when using the fast99 (extended-FAST method) to perform SA of model with norm distribution inputs? See the simple example given following. Any suggestion will be greatly appreciated. Thank you! Marino # Simple example # 1.

Re: [R] How to export data with defined decimal places

2013-03-07 Thread Marino David
atC(pi,digits=10,format="f") > > z > [1] "3.1415926536" > > If this still is not clear to you, I give up, as I do not know how to > make it any clearer. Perhaps someone else can. > > -- Bert > > > On Thu, Mar 7, 2013 at 4:24 PM, Marino David > wro

Re: [R] How to export data with defined decimal places

2013-03-07 Thread Marino David
that is 3.1415926536. How to do it? Thanks Marin 2013/3/8 Marino David > Hi Bert, > > I want to save the data into .txt file for another software process. > > Thanks for suggestion. > > 2013/3/8 Bert Gunter > >> ?write.table >> >> which says

Re: [R] How to export data with defined decimal places

2013-03-07 Thread Marino David
pen" (see options), but with the internal equivalent > of digits=15. For finer control, use format to make a character > matrix/data frame, and call write.table on that. " > > Not sure if this is what you want, as "export" is rather vague. > > -- Bert > > On

[R] How to export data with defined decimal places

2013-03-07 Thread Marino David
Hi all mailing listers, I want to export data with specified precision into .txt file. How can I make it? See below sprintf("%.10f",pi) [1] "3.1415926536" when carry out write.matrix(pi,"pi.txt"), 3.141592653589793115998 in pi.txt file not with 10 decimal places like using sprintf("%.10f",pi)

[R] How to install .tar.gz source package in Windows XP 32-bit operational system

2013-02-13 Thread Marino David
Dear all mailing listers, I failed in install source packages in Windows system. I have installed Rtools in order to install the source package based on the discussion available on the following link: http://r.789695.n4.nabble.com/Installing-a-Package-tar-gz-in-windows-td3411393.html. By the way,

[R] How to install .tar.gz source package in Windows XP 32-bit operational system

2013-02-12 Thread Marino David
Dear all mailing listers, I failed in install source packages in Windows system. I have installed Rtools in order to install the source package based on the discussion available on the following link: http://r.789695.n4.nabble.com/Installing-a-Package-tar-gz-in-windows-td3411393.html. By the way,