Displaying 20 results from an estimated 1000 matches similar to: "Automatic implementation of "trivial" constraints in optimization"
2007 Jan 25
0
distribution overlap - how to quantify?
Dear R-Users,
my objective is to measure the overlap/divergence of two probability
density functions, p1(x) and p2(x). One could apply the chi-square test
or determine the potential mixture components and then compare the
respective means and sigmas. But I was rather looking for a simple
measure of similarity.
Therefore, I used the concept of 'intrinsic discrepancy' which is
defined as:
2006 Sep 14
1
Rv generation
Hi,
Can Someone inform me how to generate RV's using the below CDF, by inverse
technique.
Thanks for your help and time.
My CDF is as follows
\[
F(x)=0 \ \text{if} \ x < 0\]\[
F(x)=\{\frac{x-x_i}{x_{i+1}-x_{i}}*(p_{i+1}-p_{i})\}+p_{i}\
\forall \ x_{i}\leq x < x_{i+1} \]
\[ F(x)=1 \ \text{if} \ x > x_{i+1}
\]
Regards
Murthy
2009 Apr 07
1
typo in R-ints.texi's description of P_ macro
I think there are some missing words in "R Internals"'s description of
the P_ macro.
It currently has "A macro as a wrapper for ngettext", which I think
ought to be
something like "The macro P_ may be used as a wrapper for ngettext".
The following patch also makes the 2 alternate definitions of P_ have
the same argument names,
StringS and StringP. Expanding the
2010 Jul 21
1
function of an integral
Hi All,
I have a problem to create a variable that is a function of an integral of
another function.
The problem is the following:
I have a variable called cip. I have to create another variable called bip
that is a function of the former variable cip and also the cumulative
distribution function of the variable cip.
Consider the equation below:
2003 Jan 31
2
Testing ``<=" in R
Hello,
I've encountered the following:
> n_500
> tau_.95
> (n*(1-tau))
[1] 25
> (n*(1-tau))<=25
[1] FALSE
> (n*(1-tau))==25
[1] FALSE
I'm using UNIX R Version 1.4.0, and also tested in out in Windows 1.6.0. Is
this a bug?
Masha
2009 Oct 17
2
Recommendation on a probability textbook (conditional probability)
I need to refresh my memory on Probability Theory, especially on
conditional probability. In particular, I want to solve the following
two problems. Can somebody point me some good books on Probability
Theory? Thank you!
1. Z=X+Y, where X and Y are independent random variables and their
distributions are known.
Now, I want to compute E(X | Z = z).
2.Suppose that I have $I \times J$ random number
2010 Aug 02
1
lm length
Hi all,
I wanto to run a plot about the levels of a variable parting on an ols
regression. The regression in done on the rate of return of the variable.
Imagine R_{t}=a+b*R_{t-1}
So If P, the "estimated" price would be P_{t}=P_{t-1}*R_{t}
Imagine that I obtain lm fitted values and the original
R_{t}, R_{t-1} are [1000,1] dimmension...
How it is posible to obtain also 1000,1 fitted
2002 Jul 01
1
Substitutions in strings.
Hi all,
Sorry to bother you with the potentially not too bright question, but
since I cannot get it to work, I'll have to ask someone..
I've got this vector:
> token
[1] sal skal skal bak b_r d_ gal kal l_r n_r pak
p_r
[13] sal sl_r sn_r spak sp_r st_r s_ bak d_ gal l_r
pak
[25] p_r sak sl_r sp_r t_ kal n_r s_ st_r sak kal
2005 Oct 13
3
Optim with two constraints
Hi R-list,
I am new to optimization in R and would appreciate help on the following
question. I would like to minimize the following function using two
constraints:
######
fn <- function(par,H,F){
fval <- 0.5 * t(par) %*% H %*% par + F%*% par
fval
}
# matrix H is (n by k)
# matrix F is (n by 1)
# par is a (n by 1) set of weights
# I need two constraints:
# 1.
2015 Jul 27
0
R package with Fortran module on Windows? undefined reference to `__stack_chk_fail'
You should be able to set PKG_FCFLAGS="-fno-stack-protector" when
compiling to ensure that the stack protector is not used.
(Trying that out on a Windows VM, with a simple `R CMD build` + `R CMD
INSTALL`, compilation of your package succeeded but linking failed
saying the DLL 'Fpi' was not found; I imagine that's a separate
issue.)
As an aside, be sure to check out what
2004 Aug 09
4
linear constraint optim with bounds/reparametrization
Hello All,
I would like to optimize a (log-)likelihood function subject to a number of
linear constraints between parameters. These constraints are equality
constraints of the form A%*%theta=c, ie (1,1) %*% 0.8,0.2)^t = 1 meaning
that these parameters should sum to one. Moreover, there are bounds on the
individual parameters, in most cases that I am considering parameters are
bound between zero
1999 Jan 07
2
math symbols in plot text: 2nd try
Ok, I think my first mail didn't get through so I'll try this again.
Please disregard.
I'm trying to use subscripts on plot text.
The help files say this can be done and give several example.
I'm trying to do: P_{2} (for example) and so I tried:
text(5,2,expression(P_{2}))
which doesn't work. There are no subscript examples. I recall
someone telling me that latex-like
2004 Jun 06
0
strata() in clogit()
How can I get the log odds associated with the levels in strata()
within a clogit() model? I'm running R-1.9.0 on a Linux platform.
I am using clogit() to run a Rasch model in Item Response Theory in
psychometrics. Symbolically, the model is:
logit(p_{j,k}) = \log({\Pr(p_{j,k}) \over \Pr(1-p_{j,k})}) =
\theta_j - \alpha_k,
That is, the log odds of answering an test item correctly is
2015 Jul 27
2
R package with Fortran module on Windows? undefined reference to `__stack_chk_fail'
Hi,
I created a R library that uses a Fortran module. Everything works like a
charm on linux.
Now I'm trying to make it work on Windows. I cloned my git repository
<https://github.com/ignacio82/MyPi> on a windows computer, and when I press
the build and reload button on Rstudio I get these errors:
==> Rcmd.exe INSTALL --no-multiarch --with-keep.source MyPi
* installing to library
2017 Nov 04
0
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hi Arie,
I understand what you're saying. The following excerpt out of the book
shows that F_j does not refer exclusively to categorical factors: "...the
rule does not do anything special for them, and it remains valid, in a
trivial sense, whenever any of the F_j is numeric rather than categorical."
Since F_j refers to both categorical and numeric variables, the behavior of
2017 Nov 06
0
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hi Arie,
Given the heuristic, in all of my examples with a missing two-factor
interaction the three-factor interaction should be coded with dummy
variables. In reality, it is encoded by dummy variables only when the
numeric:numeric interaction is missing, and by contrasts for the other two.
The heuristic does not specify separate behavior for numeric vs categorical
factors (When the author of
2017 Nov 02
0
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hi Arie,
The book out of which this behavior is based does not use factor (in this
section) to refer to categorical factor. I will again point to this
sentence, from page 40, in the same section and referring to the behavior
under question, that shows F_j is not limited to categorical factors:
"Numeric variables appear in the computations as themselves, uncoded.
Therefore, the rule does not
2013 Mar 11
0
[LLVMdev] How to unroll reduction loop with caching accumulator on register?
I tried to manually assign each of 3 arrays a unique TBAA node. But it does
not seem to help: alias analysis still considers arrays as may-alias, which
most likely prevents the desired optimization. Below is the sample code
with TBAA metadata inserted. Could you please suggest what might be wrong
with it?
Many thanks,
- D.
marcusmae at M17xR4:~/forge/llvm$ opt -time-passes -enable-tbaa -tbaa
2006 Jan 25
1
xx-0.1.0 : xhtml and xml make it twice as dirty
NAME
xx - twice as dirty
SYNOPSIS
~ > gem install "double x"
require "xx"
include XX::XHTML
doc = xhtml_{
html_{
head_{ title_{ " go xx! " } }
body_{ " one more and it would be illegal " }
}
}
URI
http://rubyforge.org/frs/?group_id=1024
DESCRIPTION
xx is a library designed to extend ruby objects
2012 Mar 27
2
Supperscript, subscript and double lines in the main/sub title and using greek letters
Dear R-help,
I am trying to express myself as best as I can here. If you also use Latex
to edit math reports or other languages with similar editing method,
you'll see what I'm talking about. My sincere appologies if my question is
not clear enough to some extend, as also I'm not able to provide my code
here because I don`t know which one I can use...
When editing the title in R