similar to: creating a function

Displaying 20 results from an estimated 2000 matches similar to: "creating a function"

2013 Jan 03
2
simulation
Dear R users, suppose we have a random walk such as: v_t+1 = v_t + e_t+1 where e_t is a normal IID noise pocess with mean = m and standard deviation = sd and v_t is the fundamental value of a stock. Now suppose I want a trading strategy to be: x_t+1 = c(v_t – p_t) where c is a costant. I know, from the paper where this equations come from (Farmer and Joshi, The price dynamics of common
2020 Oct 06
4
Solving a simple linear equation using uniroot give error object 'x' not found
Colleagues, I am trying to learn to use uniroot to solve a simple linear equation. I define the function, prove the function and a call to the function works. When I try to use uniroot to solve the equation I get an error message, Error in yfu n(x,10,20) : object 'x' not found. I hope someone can tell we how I can fix the problem
2019 Apr 12
2
integrate over an infinite region produces wrong results depending on scaling
Dear all, This is the first time I am posting to the r-devel list. On StackOverflow, they suggested that the strange behaviour of integrate() was more bug-like. I am providing a short version of the question (full one with plots: https://stackoverflow.com/q/55639401). Suppose one wants integrate a function that is just a product of two density functions (like gamma). The support of the
2020 Oct 06
0
Solving a simple linear equation using uniroot give error object 'x' not found
On 06/10/2020 11:00 a.m., Sorkin, John wrote: > Colleagues, > I am trying to learn to use uniroot to solve a simple linear equation. I define the function, prove the function and a call to the function works. When I try to use uniroot to solve the equation I get an error message, > Error in yfu n(x,10,20) : object 'x' not found. > > I hope someone can tell we how I can fix
2005 Apr 18
2
Construction of a large sparse matrix
Dear List: I'm working to construct a very large sparse matrix and have found relief using the SparseM package. I have encountered an issue that is confusing to me and wonder if anyone may be able to suggest a smarter solution. The matrix I'm creating is a covariance matrix for a larger research problem that is subsequently used in a simulation. Below is the latex form of the matrix if
2009 Jul 16
1
Error with r2winbugs
Hi, I am trying to do run the following model saved in "C:/bugs/sus.bug" model { for (i in 1:n){ y[i] ~ dpois(lamdba[i]) log(lambda[i]) <- mu+bmale[male[i]]+bschn[schn[i]]+epsilon[i] # epsilon[i] ~ dnorm(0,tau.epsilon) } mu ~ dnorm(0,.0001) bmale ~ dnorm(0,.0001) tau.epsilon <- pow(sigma.epsilon, -2) sigma.epsilon ~ dunif(0,100) for (j in
2004 Dec 01
1
tuning SVM's
Hi I am doing this sort of thing: POLY: > > obj = best.tune(svm, similarity ~., data = training, kernel = "polynomial") > summary(obj) Call: best.tune(svm, similarity ~ ., data = training, kernel = "polynomial") Parameters: SVM-Type: eps-regression SVM-Kernel: polynomial cost: 1 degree: 3 gamma: 0.04545455 coef.0: 0
2005 May 11
1
2 factor ANOVA and sphericity
With respect to calculating the epsilon index of sphericity for ANOVA, discussed on pp. 45-47 of: http://www.psych.upenn.edu/~baron/rpsych.pdf It notes that epsilon is not required for a repeated measures design with only k=2 levels, as the minimum value of epsilon (e) is given by: e = 1/(k-1) so for k=2, we have e = 1 (ie, no correction of the F test df; see p. 46). These notes apply to a
2014 Jan 24
1
Installation of R-3.0.2 failed Fortran error
Dear all, I have a big problem to compile R-3.0.2 on our SUSE SLES 11 Server. Make breaks up with fortran errors and so the installation isn't successful This is a part from the make run output.: gcc-3.3 -fpic -L/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3-hammer/ -lg2c -ffloat-store -c dlamch.f -o dlamch.o dlamch.f: In function `dlamch': dlamch.f:89: warning: INTRINSIC
2019 Mar 03
2
bug: sample( x, size, replace = TRUE, prob= skewed.probs) produces uniform sample
When `length( skewed.probs ) > 200' uniform samples are generated in R-devel. R-3.5.1 behaves as expected. `epsilon` can be a lot bigger than illustrated and still the uniform distribution is produced. Chuck > set.seed(123) > > epsilon <- 1e-10 > > ## uniform to 200 then small > p200 <- prop.table( rep( c(1, epsilon), c(200, 999-200))) > ## uniform to 201
2013 Mar 31
1
Creating new instances from original ones
I have a question about data mining. I have a dataset of 70 instances with 14 features that belong to 4 classes. As the number of each class is not enough to obtain a good accuracy using some classifiers( svm, rna, knn) I need to "oversampling" the number of instances of each class. I have heard that there is a method to do this. It consists in generating these new instances as follows:
2019 Oct 26
2
ls permissions format changed in CentOS 8
It's not a ls bug. I've stepped through the code with gdb and it looks just fine. At this point I think Epsilon (a 32-bit app) is corrupting the image of its child process in a strange way. I'm working with the author at Lugaru (who's very responsive) to track it down. He couldn't reproduce it right away. I just reproduced it on a virgin CentOS 8 image at Linode with
2009 Apr 07
1
Simulate binary data for a logistic regression Monte Carlo
Hello, I am trying to simulate binary outcome data for a logistic regression Monte Carlo study. I need to eventually be able to manipulate the structure of the error term to give groups of observations a random effect. Right now I am just doing a very basic set up to make sure I can recover the parameters properly. I am running into trouble with the code below. It works if you take out the object
2006 Jan 15
1
problems with glm
Dear R users, I am having some problems with glm. The first is an error message "subscript out of bounds". The second is the fact that reasonable starting values are not accepted by the function. To be more specific, here is an example: > success <- c(13,12,11,14,14,11,13,11,12) > failure <- c(0,0,0,0,0,0,0,2,2) > predictor <- c(0,80*5^(0:7)) >
2007 Oct 17
1
correlated data
Hi!! I am trying to generate data with specific correlation using corgen method from the ecodist package. It does not seem to generate the data properly. I am listing the code below. Secondly, when I put the code given below all in one file and source it, it is unable to complete the task. But when I execute it one at a time it is able to complete it. Can someone point out any mistake that I may
2006 Aug 06
1
How to use omega to search remote back end?
Folks, Having trouble getting this to work. OMEGA cgi is not reading my stub file properly because it is trying to read it as a directory instead of a file. Is there an easy fix? Here is a transcript. Thanks, OSC oscar@epsilon:/svr/xapian/beta$ ls -aFl total 21335200 drwxr-xr-x 2 oscar oscar 4096 Aug 6 10:15 ./ drwxr-xr-x 5 oscar oscar 4096 Aug 6 12:59 ../ lrwxrwxrwx 1 oscar
2007 May 08
2
statistics/correlation question NOT R question
This is not an R question but if anyone can help me, it's much appreciated. Suppose I have a series ( stationary ) y_t and a series x_t ( stationary )and x_t has variance sigma^2_x and epsilon is normal (0, sigma^2_epsilon ) and the two series have the relation y_t = Beta*x_t + epsilon My question is if there are particular values that sigma^2_x and sigma^2_epsilon have to take in
2007 Feb 21
1
loops in R help me please
I am trying to make the following Kalman filter equations work and therefore produce their graphs. v_t=y_t - a_t a_t+1=a_t+K_t*v_t F_t=P_t+sigma.squared.epsilon P_t+1=P_t*(1-K_t)+sigma.squared.eta K_t=P_t/F_t Given: a_1=0,P_1=10^7,sigma.squared.epsilon=15099, sigma.squared.eta=1469.1 I have attached my code,which of course doesnt work.It produces NAs for the Fs,Ks and the a. Can somebody tell me
2011 Feb 12
1
how to improve the precison of this calculation?
Hello T I want to order some calculation "result", there will be lots of "result" that need to calculate and order PS: the "result" is just a intermediate varible and ordering them is the very aim # problem: # For fixed NT and CT, and some pair (c,n). order the pair by corresponding result # c and n are both random variable CT<-6000 #assignment to CT
2005 Feb 18
1
Two-factorial Huynh-Feldt-Test
Hi, I'm currently working on porting some SAS scripts to R, and hence need to do the same calculation (and get the same results) as SAS in order to make the transition easier for users of the script. In the script, I'm dealing with a two-factorial repeated-measures anova. I'll try to give you a short overview of the setup: - two between-cell factors: facBetweenROI (numbering