Displaying 20 results from an estimated 24 matches for "andreas_wittmann".
2008 Dec 07
4
Finding the first value without warning in a loop
Dear R useRs,
with the following piece of code i try to find the first value which can
be calculated without warnings
`test` <- function(a)
{
repeat
{
## hide warnings
suppressWarnings(log(a))
if (exists("last.warning", envir = .GlobalEnv))
{
a <- a + 0.1
## clear existing warnings
rm("last.warning", envir = .GlobalEnv)
}
2010 Jan 17
3
enty-wise closest element
Dear R-users,
i have a simple problem maybe, but i don't see the solution. i want to
find the entry-wise closest element of an vector compared with another.
ind1<-c(1,4,10)
ind2<-c(3,5,11)
for (i in length(ind2):1)
{
print(which.min(abs(ind1-ind2[i])))
}
for ind2[3] it should be ind1[3] 10, for ind2[2] it should be ind1[2] 4
and for ind2[1] it should be ind1[1] 1. but with the
2009 Apr 22
2
integrate lgamma from 0 to Inf
Dear R users,
i try to integrate lgamma from 0 to Inf. But here i get the message "roundoff error is detected in the extrapolation table", if i use 1.0e120 instead of Inf the computation works, but this is against the suggestion of integrates help information to use Inf explicitly. Using stirlings approximation doesnt bring the solution too.
## Stirlings approximation
lgammaApprox
2008 Nov 02
1
ESS Toolbar missing after Ubuntu Update
Dear R useRs,
yesterday i updated my system from ubuntu 8.04 to 8.10. I use emacs-
snapshot, this is emacs 23.0.60.1 and ess 5.3.8. Before the update i
had when starting emacs with an R file an ess-toolbar with little
icons to start R or to evaluate a line or a region of my R file, but
no this toolbar is lost and i don't know how to get it again. I tried
a lot of changes in the ess options
2010 May 14
1
Replacing double loop by apply
Dear R-users,
after trying and searching a long time i have the following question.
is it possible to replace to following double loop by some apply calls?
#######################################################################
m1 <- data.frame(v1=factor(letters[1:5]),
v2=factor(letters[2:6]),
v3=factor(letters[3:7]))
m2 <-
2009 Dec 04
2
Solve linear program without objective function
Dear R-users,
i try to solve to following linear programm in R
0 * x_1 + 2/3 * x_2 + 1/3 * x_3 + 1/3 * x_4 = 0.3
x_1 + x_2 + x_3 + x_4 = 1
x_1, x_2, x_3, x_4 > 0,
x_1, x_2, x_3, x_4 < 1
as you can see i have no objective function here besides that i use the
following code.
library(lpSolve)
f.obj<-c(1,1,1,1)
f.con<-matrix(c(0,2/3,1/3,1/3,
1,1,1,1,
2010 Jan 12
1
parsing protocol of states
Dear R-users,
actually i try to parse some state protocols for my work. i an easy
stetting the code below works fine, if states are reached only once. in
harder settings it could be possible that one state gets visited more
times. in this case for me its interesting to see how much waiting time
lies between to states on the whole.
by the way i didn't use R as a parsing tool so far, so
2010 Dec 11
0
is there a packge or code to generate markov chains in R
...z.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
------------------------------
Message: 59
Date: Fri, 10 Dec 2010 20:07:40 +0100
From: Andreas Wittmann <andreas_wittmann at gmx.de>
To: r-help <r-help at r-project.org>
Subject: [R] survival package - calculating probability to survive a
given time
Message-ID: <4D027A7C.2020804 at gmx.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Dear R users,
i try to calculate the probabilty to s...
2006 Oct 19
0
New package CreditMetrics
Dear R useRs,
A new package 'CreditMetrics' is now available on CRAN. It is mainly a
set of
functions for computing the CreditMetrics risk model.
This is the first version of the package and it is also my first try to
build a package for R.
The canonical reference is:
Glasserman, Paul, Monte Carlo Methods in Financial Engineering, Springer
2004
Suggestions, bug reports and other
2007 May 06
0
New Package Reliability
Dear R useRs,
A new package 'Reliability' is now available on CRAN. It is mainly a set
of functions functions for estimating parameters in software reliability
models. Only infinite failure models are implemented so far.
This is the first version of the package.
The canonical reference is:
J.D. Musa, A. Iannino, and K. Okumoto. Software Reliability:
Measurement, Prediction,
2007 Aug 31
1
Day Count Convention
Hi everybody,
i'm working on the next version of the CreditMetrics package. So i have
the question, are there any functions or packages which have have the
functionality to calculate dates with a certain day count convention
like act/360 or 30/360? Intensive search in the r-help archive or in the
manuals did not bring any solution.
thanks everybody for some help.
best regards
Andreas
2008 Oct 20
2
folded normal distribution in R
Dear R useRs,
i wanted to ask if the folded normal destribution (Y = abs(X) with X
normal distributed)
with density and random number generator is implemented in R or in any
R-related package
so far? Maybe i can use the non-central chi-square distribution and
rchisq(n, df=1, ncp>0) here?
Thanks and best regards
Andreas
2009 Dec 02
1
Generate missing data patterns
Dear R-users,
i try to generate missing values in a matrix X according to a given
missingnes pattern R with the probabilities p per row.
X<-matrix(rnorm(3*100),ncol=3)
## indicator matrix for missingnes (1 observed, 0 missing)
R<-matrix(c(1,1,1,
0,0,1,
1,1,0,
0,1,1),ncol=3,byrow=TRUE)
## probabilities for row 1, row 2, row 3 and row 4
2010 Dec 10
2
survival package - calculating probability to survive a given time
Dear R users,
i try to calculate the probabilty to survive a given time by using the
estimated survival curve by kaplan meier.
What is the right way to do that? as far as is see i cannot use the
predict-methods from the survival package?
library(survival)
set.seed(1)
time <- cumsum(rexp(1000)/10)
status <- rbinom(1000, 1, 0.5)
## kaplan meier estimates
fit <- survfit(Surv(time,
2006 Oct 17
1
Review process for new packages
Hi all,
i'm currently working on a creditmetrics package which includes functions for computing the credit risk model creditmetrics. I guess it would be finished in a few days.
My question now is, does there exist some review process before sending it to ctan or is it reviewed after having sended it?
best regards
Andreas
--
NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl
2008 Sep 20
1
lower and upper limits in integrate as vectors
Dear R useRs,
i try to integrate the following function for many values
"integrand" <- function(z)
{
return(z * z)
}
i do this with a for-loop
for(i in 2:4)
{
z <- integrate(integrand, i-1, i)$value
cat("z", z, "\n")
}
to speed up the computation for many values i tried vectors
in integrate to do this.
vec1<-1:3
vec2<-2:4
2010 Feb 23
0
Name for factor's levels with contr.sum
Hi R-useRs,
after having read
http://tolstoy.newcastle.edu.au/R/help/05/07/8498.html
with the same topic but five years older. the solution for a contr.sum
with names for factor levels for R version 2.10.1 will be to comment out
the following line
#colnames(cont) <- NULL
in contr.sum i guess? by the way, with contrasts=FALSE colnames are set,
so i don't know what the aim is to avoid
2008 Oct 18
1
R CMD SHLIB: file not recognized: File format not recognized
Dear R useRs,
on ubuntu 8.04 i try to create a shared object out of a c-file
this is
// add.c
#include <Rinternals.h>
SEXP addiere(SEXP a, SEXP b)
{
int i, n;
n = length(a);
for (i = 0; i < n; i++)
REAL(a)[i] += REAL(b)[i];
return(a);
}
in terminal i type
R CMD SHLIB add.c
and get
gcc -std=gnu99 -shared -o add.so add.o -L/usr/lib/R/lib -lR
add.o: file not recognized:
2009 Nov 18
2
recode according to old levels
Dear R-users,
i try to recode a factor according to old levels
F <- factor(sample(c(rep("A", 4), rep("B",2), rep("C",5))))
recode(F, "levels(F)[c(1,3)]='X'; else='Y'")
i tried to work with eval or expression around levels(F)[c(1,3)], but
nothing seems to work.
Many thanks if anyone could tell me what i've missed and what's
2009 Jan 05
1
transform R to C
Dear R users,
i would like to transform the following function from R-code to C-code and call it from R in order to speed up the computation because in my other functions this function is called many times.
`dgcpois` <- function(z, lambda1, lambda2)
{
`f1` <- function(alpha, lambda1, lambda2)
return(exp(log(lambda1) * (alpha - 1) - lambda2 * lgamma(alpha)))
`f2` <-