Displaying 20 results from an estimated 1000 matches similar to: "Hypercube in R"
2006 Jan 17
6
For each element in vector do...
Dear R useRs,
I have a vector with positive and negative numbers:
A=c(0,1,2,3,0,4,5)
Now if i-th element in vector A is > 0, then i-th element in vector B
is a+1
else i-th element in vector b=a (or 0)
vector A: 0 1 2 3 0 4 5
vector B: 0 2 3 4 0 5 6
What's the right way to do this. I still have some problems with for and
if statements...
Cheers, Andrej
2006 May 26
3
Vector elements and ratios
Dear useRs,
I have two different length vectors: one column (1...m) and one row
vector (1...n):
20
40
20
60
5 4 2
Now I have to calculate ratios between column vector elements and each
row vector elements:
4 5 10
8 10 20
4 5 20
15 12 30
Thank's in advance for any suggestions,
Andrej
2006 Jan 25
3
read.table problem
Dear R useRs,
I have big (23000 rows), vertical bar delimited file:
e.g.
A00001|Text a,Text b, Text c|345
A00002|Text bla|456
...
..
.
Try using
A <- read.table('filename.txt', header=FALSE,sep='\|')
process stop at line 11975 with warning message:
number of items read is not a multiple of the number of columns
I have no problems with processing similar file, which is
2007 Jun 25
3
How to shadow 'power' area?
Dear all,
Suppose I plot two normal distributions (A and B) side by side and add
vertical line which hipotheticaly represent alpha value; e.g.:
x <- seq(-3.5,5, length=1000)
y <- dnorm(x)
# Plot distribution A
plot(y~x, type='l',axes=F,xlab="",ylab="",lwd=2)
# Plot distribution B
y2 <- dnorm(x-1.5)
lines(y2~x,lwd=2)
# Plot vertical line for alpha value
2006 Jan 28
1
Regex question
Dear R useRs,
is there any simple, build in function to match specific regular
expression in data file and write it to a vector. I have the following
text file:
*NEW RECORD
*ID-001
*AB-text
*NEW RECORD
*ID-002
*AB-text
etc.
Now I have to match all ID fields and print them to a vector:
001
002
etc.
I know that this is very simple with Perl or R-Perl interface, but if
possible, I want to do
2011 May 31
2
Latin Hypercube Sampling with a condition
Hello all,
I am trying to do a Latin Hypercube Sampling (LHS) to a 5-parameter
design matrix. I start as follows:
library(lhs)
p1<-randomLHS(1000, 5)
If I check the distribution of each parameter (column), they are
perfectly uniformly distributed (as expected).For example,
hist(p1[,1])
Now the hard (maybe strange) question. I want the combination of the
first three parameters to sum up to
2011 Nov 14
2
Checkinstall and R-2.14.0
Dear all,
I try to install the latest R version using checkinstall (v. 1.6.2) on
Ubuntu 11.10. After solving all the dependencies (installed using
apt-get build-dep r-base) checkinstall fails to build and install R
package with the following error (the same commands build and install
R-2.13.2 on the same machine without any problem):
wget
2012 Jun 20
2
Conditioned Latin Hypercube Sampling within determined distance
Hi all,
I am a begginer in R and I have been trying to use the Conditioned Latin
Hypercube to choose sample points only in areas close to roads due to the
difficult thorough access in the study area. I could use a code to create
the points throughout the area, but I need to create a code to make the R
only comes up with points close to this road. I've been using the packages
2008 Sep 18
2
Ability estimates for partial credit model
Dear all,
I'm working on ability estimates using Rasch model. Using the "ltm"
package, the procedure is quite simple:
## Factor Scores for the Rasch model
fit <- rasch(LSAT)
factor.scores(fit)
What about Partial Credit Model (PCM)? For PCM I use PCM function from
eRm package. Is there any similar function like factor.scores to
estimate ability scores using PCM model?
Best,
2017 Aug 04
2
Latin hypercube sampling from a non-uniform distribution
Hello,
I am performing a sensitivity analysis using a Latin Hypercube sampling. However, I have difficulty to draw a Hypercube sample for one variable. I?ve generated this variable from a Poisson distribution as follows:
set.seed(5)
mortality_probability <- round(ppois(seq(0, 7, by = 1), lambda = 0.9), 2)
barplot(mortality_probability, names.arg = seq(0, 7, by = 1), xlab = "Age
Latin Hypercube Sampling when parameters are defined according to specific probability distributions
2017 May 27
2
Latin Hypercube Sampling when parameters are defined according to specific probability distributions
>May 26, 2017; 11:41am Nelly Reduan Latin Hypercube Sampling when parameters are >defined according to specific probability distributions
>Hello,
> I would like to perform a sensitivity analysis using a Latin Hypercube Sampling (LHS).
>Among the input parameters in the model, I have a parameter dispersal distance which is defined according to an exponential probability
2008 Nov 23
2
Latin Hypercube with condition sum = 1
Hi
I want to du a sensitivity analysis using Latin Hypercubes. But my
parameters have to fulfill two conditions:
1) ranging from 0 to 1
2) have to sum up to 1
So far I am using the lhs package and am doing the following:
library(lhs)
ws <- improvedLHS(1000, 7)
wsSums <- rowSums(ws)
wss <- ws / wsSums
but I think I can't do that, as after the normalization
> min(wss)
[1]
2011 Sep 09
1
conditional Latin hypercube sampling
Hello,
I got one question on the Latin hypercube sampling.
suppose
there are three variables a, b, c, all of them follow the normal
distribution. the mean value and standard deviation for each areĀ a(32,
2), b(35,5), c(37,3). I would like to use Latin hypercube sampling to
random generate 1000 samples. but it needs to satisfy the condition that
a<b<c.
How can I implement this
2017 Aug 07
0
Latin hypercube sampling from a non-uniform distribution
> How can I draw a Hypercube sample for the variable mortality_probability so
> that this variable exhibits the same pattern as the observed distribution?
One simple way is to use the uniform random output of randomLHS as input to the quantile function for your desired distribution(s).
For example:
q <- randomLHS(1000, 3)
colnames(q) <- c("A", "B",
2006 Jan 15
1
Multiple comparison and two-way ANOVA design
Dear useRs,
I'm working on multiple comparison design on two factor (2 3 levels)
ANOVA. Each of the tests I have tried (Tukey, multcomp package) seem to
do only with one factor at a time.
fm1 <- aov(breaks ~ wool * tension, data = warpbreaks)
tHSD <- TukeyHSD(fm1, "tension", ordered = FALSE)
$tension
diff lwr upr p adj
M-L -10.000000 -19.35342
2017 Aug 08
0
Latin hypercube sampling from a non-uniform distribution
> However, my variable is simulated from the cumulative distribution function
> of the Poisson distribution.
Then I am afraid I don't know what you're trying to achieve.
Or why.
However, the principle holds; write a function that maps [0,1] to the 'pattern' you want, do that and apply it to the result from randomLHS.
It happens that for generating data that follow a given
2013 Feb 19
1
latin hypercube sampling
Hi all,
I am attempting to use latin hypercube sampling to sample different
variable functions in a series of simultaneous differential equations.
There is very little code online about lhs or clhs, so from different
other help threads I have seen, it seems I need to create a
probability density function for each variable function, and then use
latin hypercube sampling on this pdf.
So far, I
2017 Aug 07
2
Latin hypercube sampling from a non-uniform distribution
Thanks for your answer.
However, my variable is simulated from the cumulative distribution function of the Poisson distribution. So, the pattern obtained from the function "qpois" is not the same as the observed pattern (i.e., obtained from the function "ppois")
set.seed(5)
mortality_probability <- round(ppois(seq(0, 7, by = 1), lambda = 0.9), 2)
2013 Oct 08
3
Latin Hypercube Sample and transformation to uniformly distributed integers or classes
Hi,
I'd like to use Latin Hypercube Sampling (LHC) in the the context of
uncertainty / sensitivity analysis of a complex model with approximately 10
input variables. With the LHC approach I'd like to generate parameter
combinations for my model input variables.
Therefore I came across an simple example here on the mailing list (
Latin Hypercube Sampling when parameters are defined according to specific probability distributions
2017 Jun 01
1
Latin Hypercube Sampling when parameters are defined according to specific probability distributions
Thank you very much Rob for your answer. I have some difficulties to understand how to apply my agent-based model to each parameter combination generated by the LHS, in particular when parameters are defined by probability distributions. Indeed, I have multiple parameters in my model: parameters which are defined by a single value (like ?temperature", "pressure?) and parameters which are