Displaying 20 results from an estimated 90 matches similar to: "sample.int() algorithms"
2011 Apr 19
0
doSMP package works better than perfect, at least sometimes.
Some might have noticed that REvolution Computing released the doSMP
package to the general public about a month and a half ago, which allows
multiple cores to be accessed for parallel computation in R. Some of our
physical habitat calculations were taking an extraordinary amount of time
to complete and required over-weekend runs, which prompted our interest in
this package. What follows
2019 Mar 01
1
issue with sample in R 3.6.0.
Hello,
I think there is an issue in the sampling rejection algorithm in R 3.6.0.
The do_sample2 function in src/main/unique.c still has 4.5e15 as an
upper limit, implying that numbers greater than INT_MAX are still to
be supported by sample in base R.
Please review the examples below:
set.seed(123)
max(sample(2^31, 1e5))
[1] 2147430096
set.seed(123)
max(sample(2^31 + 1, 1e5))
[1] 1
2012 Jul 13
1
functions of vectors : loop or vectorization
I have a read a lot about the benefits of vectorization in R. I have a
program that takes "almost forever" to run. A good way to see if I have
learned something ... My problem can be summarized like this : I have a
nonlinear function of several variables that I want to optimize over one
letting the other describe a family of curves. In short, I wan't to optimize
f(x,a,b) for several
2009 Apr 26
3
3 questions regarding matrix copy/shuffle/compares
Hello all,
I have the following function call to create a matrix of POP_SIZE rows
and fill it with bit strings of size LEN:
pop=create_pop_2(POP_SIZE, LEN)
I have 3 questions:
(1) If I did
keep_pop[1:POP_SIZE] == pop[1:POP_SIZE]
to keep a copy of the original data structure before manipulating
'pop' potentially, would this make a deep copy or just shallow? Ie
2008 Sep 29
4
RJS is not loaded
Hello,
I have here an issue which is really critical for me (it for my
university work and I would like to not delete this feature). It based
on a Rails 1.x tutorial which I use now under Rails 2.x. It contains the
refreshment (adding content or records) of an div via RJS/JS.
I access the RJS via (Controller):
respond_to do |format|
format.html { redirect_to :controller =>
2010 Mar 11
2
Comparing matrices
Hello all,
I have two matrices, pop and pop2, each the same number of rows and
columns that I want to compare for equality. I am concerned about
efficiency in this operation.
I've tried a few things without success so far. Doing something simple like:
if (pop==pop2) { cat('equal') } else { cat('NOT equal') }
results in the warning:
1: In if (pop == pop2) { :
the
2025 May 07
1
How to get the same result for GA optimization?
I am using *Genetic Algorithm* to maximize some function which use data.
I use GA package in R for this (
https://cran.r-project.org/web/packages/GA/index.html)
Below is my code
library(GA)
set.seed(1)
Dat = data.frame(rnorm(1000), matrix(rnorm(1000 * 30), nc = 30))
Fitness_Fn = function(x) {
return(cor(Dat[, 1], as.matrix(Dat[, -1]) %*% matrix(x, nc = 1))[1,1])
}
ga(type =
2007 Nov 15
3
Ancova doesn't return test statistics
Dear all,
I'm quite sure that this is a stupid question, but I'll ask anyway.
I want to perform an ANCOVA with two continuous factors and three
categorical factors.
Plant population growth rate (GR) = dependent variable
Seed reduction due to herbivory (SR) = continuous explanatory variable
Herbivore species (HS, 2 levels) = categorical explanatory variable
Population (Pop, 24 levels) =
2025 May 07
1
How to get the same result for GA optimization?
Dear Daniel
As far as I can see you have re-generated the data before calling ga()
so the data is not just a permutation of the first set.
Michael
On 07/05/2025 15:36, Daniel Lobo wrote:
> I am using *Genetic Algorithm* to maximize some function which use data.
>
> I use GA package in R for this (
> https://cran.r-project.org/web/packages/GA/index.html)
>
> Below is my code
2010 Jan 17
2
For loops in R
Hello.
I've just started using R and am trying to figure out if the two codes
snippets below have the same output
gBest<-floor(runif(popsize,min=1,max=top))
velocity[i,j]<<-.4* velocity[i,j] + 1 * runif(1) * (pbestsVar[i,j] -
popVar[i,j]) + 1 * runif(1) * (archiveVar[gBest,j] - popVar[i,j])
and
for (i in 1:popsize) {
for (j in 1:maxvar) {
gBest<-sample(top,size=1)
2011 Dec 02
1
Error in Genetic Matching
Dear R Users,
I am a novice learner of R software. I am working with Genetic Matching - GenMatch(), but I am getting an Error message as follows:
Error in GenMatch(Tr = Tr, X = X.binarynp, BalanceMatrix = BalanceMatrix.binarynp, :
GenMatch(): input includes NAs
Could you please suggest me correcting the above problem?
My GenMatch command is,
> gen1 <- GenMatch(Tr = Tr, X =
2011 Dec 02
0
Error message in Genetic Matching
Dear R Users,
I am a novice learner of R software. I am working with Genetic Matching - GenMatch(), but I am getting an Error message as follows:
Error in GenMatch(Tr = Tr, X = X.binarynp, BalanceMatrix = BalanceMatrix.binarynp, :
GenMatch(): input includes NAs
Could you please suggest me correcting the above problem?
My GenMatch command is,
> gen1 <- GenMatch(Tr = Tr, X =
2006 Aug 24
1
how to constrast with factorial experiment
Hello, R users,
I have two factors (treat, section) anova design experiment where
there are 3 replicates. The objective of the experiment is to test if
there is significant difference of yield between top (section 9 to 11)
and bottom (section 9 to 11) of the fruit tree under treatment. I
found that there are interaction between two factors. I wonder if I
can contrast means from levels of
2010 Mar 14
1
Segfault Problem c++ R interface (detailed)
Hello R Community,
I've been working on a project that uses pre-made C++ libraries (using STL)
in R and build a package. However, I've been getting an unusual segfault
that I'm unable to trace its origin. After many attempts of debugging using
gdb, commenting out parts (or all of my code) and valgrind, I'm unable to
make heads or tails about what I'm doing wrong. In fact, when
2009 Feb 25
3
Saving rich text to the database
I''ve started trying to use the wysihat rich text editor from 37-
signals and everything is going well except that I get an error when
trying to save the text from the enhanced field to the database. This
is from my log:
Processing InstructionsController#new (for 127.0.0.1 at 2009-02-25
06:04:57) [POST]
Session ID:
BAh7CCIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo
2007 Oct 01
1
saving and loading complex objects
Dear Sir:
When I try to save large and very complex recursive objects with some components containing models (such as the output from arima or lm ),
the resulting file sizes increase by 4 meg per save.
example directory:
amex 8 meg
argentina 12 meg
australia 16 meg
...
Moreover, I am unable to read these file objects back into R.
I note that readBin and writeBin
2008 Nov 15
4
data not being saved
I am trying to save data entered in a form and nothing seems to be
saving. What do you I have to look at to ensure everything is set-up
correctly? I have looked in my database.yml file and all looks good and
the database that I am trying to use exist. Thanks,
-S
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you
2006 Aug 29
0
how to contrast with factorial experiment
Hello, R experts,
If I understand Ted's anwser correctly, then I can not contrast the
mean yields between sections 1-8 and 9-11 under "Trt" but I can
contrast mean yields for sections 1-3 and 6-11 because there exists
significant interaction between two factors (Trt:section4,
Trt:section5). Could I use the commands below to test
the difference between sections 1-3 and 6-11 ?
2009 Sep 27
3
CRAN (and crantastic) updates this week
CRAN (and crantastic) updates this week
New packages
------------
* bdoc (1.0)
Michael Anderson
http://crantastic.org/packages/bdoc
This package contains a function that will classify DNA barcodes as
well as a few test and reference data sets.
* bdsmatrix (1.0)
Terry Therneau
http://crantastic.org/packages/bdsmatrix
This is a special case of sparse matrices, used by coxme and
2014 Jan 31
1
libguestfs-test-tool hangs on Btrfs
A simple libguestfs-test-tool invocation on Btrfs machine hangs as noted
below.
Versions and related details here:
https://bugzilla.redhat.com/show_bug.cgi?id=1060126
Complete strace:
http://kashyapc.fedorapeople.org/temp/qemu-strace.log
----------------
$ libguestfs-test-tool
************************************************************
* IMPORTANT NOTICE