Displaying 20 results from an estimated 300 matches similar to: "optim with constraints"
2009 Dec 06
2
MLE in R
Hi, dear R users
I am a newbie in R and I need to use the method of meximum likelihood to fit a Weibull distribution to my survival data. I use "optim" as follows:
optim(c(1.14,0.25),weibull.like,mydata=mydata,method="L-BFGS-B",hessian = TRUE)
My question is: how do I setup the constraints that the two parametrs of Weibull to be pisotive?
Many thanks! Any comments are
2006 Oct 24
2
Installing stats4 package
Hi,
I wantto use 'mle' function in R on linux. As I see its been integrated
into the stats4 package. Am I correct ? If yes, Can anyone suggest how to
install the stats4 package to be able to run 'mle' function in R on linux ?
Otherwise how to sort out this problem ?
Thanks
Himanshu
[[alternative HTML version deleted]]
2010 Apr 14
2
Gaussian Quadrature Numerical Integration In R
Hi All,
I am trying to use A Gaussian quadrature over the interval (-infty,infty) with weighting function W(x)=exp(-(x-mu)^2/sigma) to estimate an integral.
Is there a way to do it in R? Is there a function already implemented which uses such weighting function.
I have been searching in the statmode package and I found the function "gauss.quad(100, kind="hermite")" which uses
2011 Nov 06
2
how to use quadrature to integrate some complicated functions
Hello to all,
I am having trouble with intregrating a complicated uni-dimensional function
of the following form
Phi(x-a_1)*Phi(x-a_2)*...*Phi(x-a_{n-1})*phi(x-a_n).
Here n is about 5000, Phi is the cumulative distribution function of
standard normal,
phi is the density function of standard normal, and x ranges over
(-infty,infty).
My idea is to to use quadrature to handle this integral. But
2012 Feb 29
2
Converting a function from Splus to R
I have a function written for Splus, when I run it in R I obtain get an error
because the function has the elements "0.d0" and "2.d0". How can I change it
to run in R?
The function can be found in page 230 from
http://www.stat.wisc.edu/~mchung/teaching/stat471/stat_computing.pdf
Function is as follows:
gauher <- function(n) {# Gauss-Hermite: returns x,w so that
2006 Oct 02
1
Trig.Rd typo (PR#9269)
Full_Name: Robin Hankin
Version: 2.4.0 RC
OS: MacOSX 10.4.7
Submission from: (NULL) (139.166.242.29)
The first cut line described in Trig.Rd for asin() is incorrect in the ascii
version of the manpage.
The Rd file reads:
For \code{asin()} and \code{acos()}, there are two cuts, both along
the real axis: \eqn{\left(-\infty, -1\right]}{\(-Inf, 1\]} and
Note the inconsistency between the
2010 Sep 21
3
bivariate vector numerical integration with infinite range
Dear list,
I'm seeking some advice regarding a particular numerical integration I
wish to perform.
The integrand f takes two real arguments x and y and returns a vector
of constant length N. The range of integration is [0, infty) for x and
[a,b] (finite) for y. Since the integrand has values in R^N I did not
find a built-in function to perform numerical quadrature, so I wrote
my own after
2012 May 23
1
numerical integration
Greetings,
Sorry, the last message was sent by mistake! Here it is again:
I encounter a strange problem computing some numerical integrals on [0,oo).
Define
$$
M_j(x)=exp(-jax)
$$
where $a=0.08$. We want to compute the $L^2([0,\infty))$-inner products
$$
A_{ij}:=(M_i,M_j)=\int_0^\infty M_i(x)M_j(x)dx
$$
Analytically we have
$$
A_{ij}=1/(a(i+j)).
$$
In the code below we compute the matrix
2008 Mar 12
3
Types of quadrature
Dear R-users
I would like to integrate something like \int_k^\infty (1 - F(x)) dx, where F(.) is a cumulative distribution function. As mentioned in the "integrate" help-page: integrate(dnorm,0,20000) ## fails on many systems. This does not happen for an adaptive Simpson or Lobatto quadrature (cf. Matlab). Even though I am hardly familiar with numerical integration the implementation
2005 Jul 20
1
how to define a port range?
hi,
i´am new in tcc (tcng). i try to define my qos for VoIP-Services.
For this i wantto define a class for a port range 10000 till 15000.
how is the right way?
this down works:
class (<$voip>) if tcp_sport => 10000 || tcp_sport <= 10000 ;
are there any examples of real installations - maybe including VoIP,
HTTP and P2P services?
regards
thorsten gehrig
2011 Dec 07
1
postlogin script
Hi,
I have Postfix + OpenLdap + DoveCot configuration, and it's running
succesfuly,
i wantto convert users pop3 password NTPassword and LMPassword, so i ne
plain passwor dof users,
how can i do that. (Normaly using perl's ntlmgen function i convert
password , but in plain)
thanks in advance
2014 May 08
1
İnstall dovecot-piegonhone
Hi,
We have Postfix-Dovecot MTA at Redhat EL 5 system. Also we are using this
system activelly. Now i wantto install pigeonhole managesive server on this
sys. Do i have any risk or anything ?
thanks in advance
--
Sel?uk YAZAR
2005 Apr 18
1
Poblem while build a package (PR#7798)
Full_Name: Justin Bem
Version: 1.9.1
OS: Windows XP Home
Submission from: (NULL) (196.202.235.48)
I am a R new user !
I have writed procedure that i wantto transform as a package but with
RCMD build packageName [...]
I have 'sh' is not a recognized command in the dos promp I have Active Perl 5.8
!
Does I need to have another software or it is a Perl problem ?
I hope you will find a
2006 Nov 18
1
Questions regarding "integrate" function
Hi there. Thanks for your time in advance.
I am using R 2.2.0 and OS: Windows XP.
My final goal is to calculate 1/2*integral of
(f1(x)^1/2-f2(x)^(1/2))^2dx (Latex codes:
$\frac{1}{2}\int^{{\infty}}_{\infty}
(\sqrt{f_1(x)}-\sqrt{f_2(x)})^2dx $.) where f1(x) and f2(x) are two
marginal densities.
My problem:
I have the following R codes using "adapt" package. Although "adapt"
2007 Aug 14
1
Slack variable in OR
Hi dear R users,
Is it basically correct that a problem is ( linearly on nonlinearly ) modeled so that the slack variable is bounded by an upper bound ?
If so, how it can be handled and coded practically ?
for example:
x1+ x2 =< b so ----> x1 + x2 + s=b
s=b- x1 - x2
b- x1 - x2 =< upper value
But algorithms can not calculate b- x1 - x2 , because
2011 Mar 16
2
Re; Fitting a Beta distribution
I want to fit some p-values to a beta distribution. But the problem is some
of the values have 0s and 1's. I am getting an error if I use the MASS
function to do this. Is there anyway to get around this?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2008 Jan 07
2
chi-squared with zero df (PR#10551)
Full_Name: Jerry W. Lewis
Version: 2.6.1
OS: Windows XP Professional
Submission from: (NULL) (24.147.191.250)
pchisq(0,0,ncp=lambda) returns 0 instead of exp(-lambda/2)
pchisq(x,0,ncp=lambda) returns NaN instead of exp(-lambda/2)*(1 +
SUM_{r=0}^infty ((lambda/2)^r / r!) pchisq(x, df + 2r))
qchisq(.7,0,ncp=1) returns 1.712252 instead of 0.701297103
qchisq(exp(-1/2),0,ncp=1) returns 1.238938
2008 Mar 26
2
choose fails a fundamental property of binomial coefficients (PR#11035)
Full_Name: Jerry W. Lewis
Version: 2.7.0 (2008-03-23 r44847)
OS: Windows XP Professional
Submission from: (NULL) (71.184.230.48)
choose(n,k) = choose(n,n-k) is not satisfied if either
1. n is a negative integer with k a positive integer (due to automatically
returning 0 for n-k<0)
2. n is not an integer with k a positive integer (due to rounding n-k to an
integer, compounded by
2009 Sep 09
1
R code for creating and appending to frequency table
Apologies for what might seem like an simple question.
I have written a model which gives me a frequency distribution for a
particular score within a set. What I now want to do is loop this so that I
get many different frequency distributions and append them to a table with a
collum which specifies which loop the frequency distribution is from. What I
wantto end up with would look something like
2005 Jan 21
2
[LLVMdev] making cygwin nightly builds available?
Hello, Reid.
You wrote Friday, January 21, 2005, 11:14:41 PM:
RS> FYI, work progresses on the Win32 native port which you might also find
RS> interesting. It might even get done before the cygwin stuff. Jeff Cohen
RS> is working on that. Perhaps he can indicate the status of that effort.
There is too much work to do native Win32 builds.
I've tried to get llvm compiled on mingw32