Re: [R] Why does R do this? (Duncan Murdoch)

2019-01-09 Thread Hamed Ha
Well, your question looks quite interesting to me. *which *function normally returns a non-negative *integer *and if fails to find the case, then returns integer(0) that is an integer with the zero length. Logically it returns the right answer. Then, doing an operation on nothing is pointless, how

Re: [R] Ignoring the domain of RV in punif()

2018-10-23 Thread Hamed Ha
t; Then X is uniformly distributed on [0,1], the domain of X is Q. > Then for x <= 0 _Prob[X <= x] = 0, for 0 <= x <= 1 Prob(X >=x] = x, > for x >= 1 Prob(X <= x] = 1. These define the CDF. The set of poaaible > values of X is 1-dimensional, and is not the same as the

Re: [R] Ignoring the domain of RV in punif()

2018-10-23 Thread Hamed Ha
.org/wiki/Cumulative_distribution_function > and in particular the first example which deals with a Unif[0,1] r.v. > > Best, > Eric > > > On Tue, Oct 23, 2018 at 12:35 PM Hamed Ha wrote: > >> Hi Eric, >> >> Thank you for your reply. >> >> I should say that your justification

Re: [R] Ignoring the domain of RV in punif()

2018-10-23 Thread Hamed Ha
;= (z-a)/(b-a) if a <= z <= b >= 1 if 1 <= z > > HTH, > Eric > > > > > On Tue, Oct 23, 2018 at 12:05 PM Hamed Ha wrote: > >> Hi All, >> >> I recently discovered an interesting issue with the punif() function. Let >> X

[R] Ignoring the domain of RV in punif()

2018-10-23 Thread Hamed Ha
Hi All, I recently discovered an interesting issue with the punif() function. Let X~Uiform[a,b] then the CDF is defined by F(x)=(x-a)/(b-a) for (a<= x<= b). The important fact here is the domain of the random variable X. Having said that, R returns CDF for any value in the real domain. I underst

Re: [R] Problem with lm.resid() when weights are provided

2018-09-17 Thread Hamed Ha
lon, you can't expect numerically stable results. I suppose that > lm.wfit() could check for 0 weights to a tolerance rather than exactly. > > John > > > -Original Message- > > From: Hamed Ha [mailto:hamedhas...@gmail.com] > > Sent: Friday, September 14,

[R] Problem with lm.resid() when weights are provided

2018-09-11 Thread Hamed Ha
Dear R Help Team. I get some weird results when I use the lm function with weight. The issue can be reproduced by the example below: The input data is (weights are intentionally designed to reflect some structures in the data) > df y x weight 1.51156139 0.55209240 2.117337e-34 -0.63653132 -0

[R] Issue with R write() function

2018-06-23 Thread Hamed Ha
I am recently updated to R 3.5.0 and noticed some weird errors in write() function. Further, I noticed that write.csv, write.table and generally the functions that derive from write() are all weird. 1. write() function does not accept a path longer than 256 characters neither on Windows or U