similar to: "firstthat"?

Displaying 20 results from an estimated 40000 matches similar to: ""firstthat"?"

2008 Mar 07
1
triple integral: adapt package question
Dear All, I have a function f(x,y,z)=exp(x^3+y^4+x^2*y+x*z^2+y/z) over D, where is D={ (x,y,z)| 0 <z<Inf, 0<y<c1*z, 0<x<c2*/y}. x,y,z are all vectors and c1 and c2 are constants. I tried the "adapt" package and I get some error. This is the error message: "Error in function (z, y, x) : argument "x" is missing, with no default" I included my R
2008 Dec 25
3
Percent damage distribution
R version: 2.7.0 Running on: WinXP I am trying to model damage from fire losses (given that the loss occurred). Since I have the individual insured amounts, rather than sampling dollar damage from a continuous distribution ranging from 0 to infinity, I want to sample from a percent damage distribution from 0-100%. One obvious solution is to use runif(n, min=0, max=1), but this does not seem to be
2009 Dec 25
2
[ how can sample from f(x)~x^(a-1)
Hello all how can sample from f(x)~x^(a-1)*ind(0,min(b,-log(u)) in R? where a and b is positive constand and 0<u<1 thanks khazaei
2006 Sep 19
1
-Need help with function
Hello everyone, I have a function here that I wrote but doesn't seem to work quite right. Attached is the code. In the calib funcion under the for loop Bt[i+2]<-(1-m)*Bt[i+1]+Rt[i]*Rerr-Ct[i+1] returns NA's for everything after years 1983 and 1984. However the code works when it reads Bt[i+2]<-(1-m)*Bt[i+1]+Rt[i]*Rerr-Ct[i]. I don't quite understand why since it should be
2011 Nov 18
1
How to fill irregular polygons with patterns?
Hi, I'm looking the best way to fill irregular polygons with patterns, Something like the function grid.pattern do, but my case is with irregular polygons. Whit this script I can get it, but I'm looking for an "elegant" solution.. library(grid) grid.polygon(x=c(0.2, 0.8, 0.6, 0.6, 0.8, 0.2), y=c(0.2, 0.2, 0.3, 0.5, 0.7,0.7), gp=gpar(fill="grey",
2006 Sep 20
1
help with function
Hello everyone, I have a function here that I wrote but doesn't seem to work quite right. Attached is the code. In the calib funcion under the for loop Bt[i+2]<-(1-m)*Bt[i+1]+Rt[i]*Rerr-Ct[i+1] returns NA's for everything after years 1983 and 1984. However the code works when it reads Bt[i+2]<-(1-m)*Bt[i+1]+Rt[i]*Rerr-Ct[i]. I don't quite understand why since it should be
2011 Apr 10
1
Help with basic loop
The loop is correct, you just need to make sure that your result is computed and stored as the n-th element that is returned by the loop. Pick up any manual of R, and looping will be explained there. Also, I would recommend that you draw a random number for every iteration of the loop. Defining the random vectors outside the loop make sense to me only if they are the same length as n.
2012 Feb 10
2
Discrete Event Simulation problem
Hi All, I am attempting to simulation an inventory model on R and I am having some problems. I believe the problem is when I define my demand rate is stays constant throughout so when I do need to reorder the model does not recognise it as I have the initial supply arrival time set to infinity at the start as no order has been played but I have an if statement saying, if the level falls below a
2006 Nov 03
1
[R] difference in using with() and the "data" argument in glm (PR#9338)
I've redirected this reply from r-help to the bugs list. On 11/3/2006 8:25 AM, vito muggeo wrote: > Dear all, > I am dealing with the following (apparently simple problem): > For some reasons I am interested in passing variables from a dataframe > to a specific environment, and in fitting a standard glm: > > dati<-data.frame(y=rnorm(10),x1=runif(10),x2=runif(10)) >
2008 May 23
1
van der Corput sequences
In package fOptions, there are functions that generate Halton sequences. The van der Corput sequence for base 2 is a particular case of the Halton sequence generated by: n <- 8 # anything here... x <- runif.halton(n, 1) In fact, x <- runif.halton(n, dim) will generate the van der Corput sequences for the base b as the i-th prime number in x[,i]. (in other words, if I want the van der
2011 Mar 18
1
points() rendering points outside of input
As a followup to pi-day, I attempted to make a .gif of a simulation based estimation of pi by plotting points inside a single quadrant of a circle (a la?http://www.drewconway.com/zia/?p=2667 ). ?When rendering the individual x,y pairs with points() I intermittently see points crop up around (2,0.5) but the input values for x and y are bounded between 0 and 1. square<-structure(c(0, 0, 1, 1, 0,
2010 Mar 11
2
about IRT simulation
hello R: we have a two-parameter IRT simulation code. The goal is to generate a response matrix.But the "for" part doesn't run. we don't know what is wrong with it. Thanks so much~~~ I <- 10 J <- 5 response <- matrix(0, 10, 5) pij <- function(a,b,theta) { a <- rnorm(J, 0.8, 0.04) a b <- rnorm(J, 0, 1) b theta <- rnorm(I, 0,1) theta for( i in 1:I ) { for(
2011 Jul 25
1
Problem with random number simulation
Hi this is my first post. I am trying to run a simulation for a computer playing Von Neumann poker and adjusting it's expectation of an opponent's behavior according to how the opponent plays. This program involves random generation of "hands" and shifting of parameters. However, when I run the code, no errors come up, but the program doesn't do anything. Could someone
2010 Aug 31
1
Speeding up prediction of survival estimates when using `survifit'
Hi, I fit a Cox PH model to estimate the cause-specific hazards (in a competing risks setting). Then , I compute the survival estimates for all the individuals in my data set using the `survfit' function. I am currently playing with a data set that has about 6000 observations and 12 covariates. I am finding that the survfit function is very slow. Here is a simple simulation example
2012 Nov 30
3
protentially serious R error
Hi guy, I have recently encountered a problem while I was just trying to generate some random numbers with the function "rnorm", the problem is shown below: ########case 1############ > rnorm(20*0.2) [1] -1.2765922 -0.5732654 -1.2246126 -0.4734006 ########case 2########### *> rnorm(20*(1-0.8)) [1] -0.62036668 0.04211587 -0.91092165* #########case 3############ > a<-0.2 >
2005 Jun 08
6
Random seed problem in MCMC coupling of chains
Hello! I am performing coupling of chains in MCMC and I need the same value of seed for two chains. I will show demo of what I want: R code, which might show my example is: niter <- 3 nchain <- 2 tmpSeed <- 123 for (i in 1:niter) { # iterations for (j in 1:nchain) { # chains set.seed(tmpSeed) a <- runif(1) cat("iter:", i, "chain:", j,
2005 Aug 16
2
data manipulation help
Hellow everybody, I have a dataframe with 468 individuals (rows) that I captured at least once during 28 visits (columns), it looks like: mortality[1:10,] X18.10.2004 X20.10.2004 X22.10.2004 X24.10.2004 X26.10.2004 X28.10.2004 X30.10.2004 X01.11.2004 X03.11.2004 X07.11.2004 1 1 0 0 0 1 1 1 0 0
2011 Oct 19
1
Subsetting data by eliminating redundant variables
Dear All, I am new to R, I have one question which might be easy. I have a large data with more than 250 variable, i am reducing number of variables by redun function as in the example below, n <- 100 x1 <- runif(n) x2 <- runif(n) x3 <- x1 + x2 + runif(n)/10 x4 <- x1 + x2 + x3 + runif(n)/10 x5 <- factor(sample(c('a','b','c'),n,replace=TRUE)) x6 <-
2017 Nov 15
0
lapply and runif issue?
Hi Bert, On Tue, Nov 14, 2017 at 8:11 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > Could someone please explain the following? I did check bug reports, but > did not recognize the issue there. I am reluctant to call it a bug, as it > is much more likely my misunderstanding. Ergo my request for clarification: > > ## As expected: > >> lapply(1:3, rnorm, n = 3)
2006 Oct 16
5
Re : Generate a random bistochastic matrix
Thanks, I tried someting like this, but computation takes times for large matrices btransf <- function(y,X=length(y)^4) { N <- length(y) bm <- matrix(rep(1/N,N^2),N,N) for(j in 1:X){ coord <- sample(1:N,4,replace=T) d <- runif(1,0,min(bm[coord[1],coord[2]],bm[coord[3],coord[4]]))