Displaying 20 results from an estimated 200 matches similar to: "How to vectorize a function to handle two vectors"
2011 Aug 18
3
Error message: object of type 'closure' is not subsettable
Dear R-users
I need to calibrate kappa, rho, eta, theta, v0 in the following code, see
below. However when I run it, I get:
y <- function(kappahat, rhohat, etahat, thetahat, v0hat) {sum(difference(k,
t, S0, X, r, implvol, q, kappahat, rhohat, etahat, thetahat, v0hat)^2)}
> nlminb(start=list(kappa, rho, eta, theta, v0), objective = y, lower =lb,
> upper =ub)
Error in dots[[1L]][[1L]] :
2004 Sep 16
1
Newbie q. need some help understanding this code.
dear all.
Would someone be kind and willing to explain the code
below for a person who has never used R? ( that is if
one has enough time and inclination)
It implements gillepsie's stochastic algorithm for
Lotka Volterra model.
What would help me tremendously is to see the
breakdown of the line by line code into plain english.
thanks for any insights or other comments.
sean
2011 Apr 29
1
Handling of irregular time series in lineChart
Hi,
I realized that when I have irregular series to feed into lineChart,
the interval of each point in the chart does not seem to take care of
irregular time interval I specified in my input xts time series. But
rather, lineChart seems to take each point as equal spaced time
series. For example, I have the following code:
library(quantmod)
options(digits.sec=3)
t0 <-
2011 Jul 26
1
nls - can't get published AICc and parameters
Hi
I'm trying to replicate Smith et al.'s
(http://www.sciencemag.org/content/330/6008/1216.abstract) findings by
fitting their Gompertz and logistic models to their data (given in
their supplement). I'm doing this as I want to then apply the
equations to my own data.
Try as a might, I can't quite replicate them. Any thoughts why are
much appreciated. I've tried contacting the
2010 Jul 14
1
Converting POSIXct vales to real values
I have a dataframe that contains time values in the form of yyyy-mm-dd hh:mm i.e. 2010-07-14 13:00. When I convert this to numeric via tvec <- as.numeric(Time) I get a number that is in seconds. So far so good. When I then divide the numeric value by the number of seconds in a day eg tvec/(60*60*24) I only get integer values and not fraction of a day which is what I want.
What do I need to
2007 Apr 05
2
Likelihood returning inf values to optim(L-BFGS-B) other options?
Dear R-help list,
I am working on an optimization with R by evaluating a likelihood
function that contains lots of Gamma calculations (BGNBD: Hardie Fader
Lee 2005 Management Science). Since I am forced to implement lower
bounds for the four parameters included in the model, I chose the
optim() function mith L-BFGS-B as method. But the likelihood often
returns inf-values which L-BFGS-B
2004 Jan 07
1
keystroke logging
>
>
>What do you recommend for keeping track of user
>activities? For preserving bash histories I followed
>these recommendations:
>
>http://www.defcon1.org/secure-command.html
>
Interesting reading but, as others have noted, of limited use.
Keystroke logging can be disabled by - as others have noted - either
spawning another (perhaps different) shell, using a remote
2010 Jan 24
3
Display of results
Dear R-helpers,
I have been trying to carry out some variance ratio tests such as
Lo-MacKinlay test and Chow-Denning test. However, When I write the
function LM <- Lo.Mac(y,kvec)
or any other functions I don’t get the results displayed. The only
sign I get is <
I don’t understand what’s wrong (is it the package, misspecification
of the function, Vista). I am really stuck in and I would be
2011 Aug 17
2
An example of very slow computation
This message is about a curious difference in timing between two ways of computing the
same function. One uses expm, so is expected to be a bit slower, but "a bit" turned out to
be a factor of >1000. The code is below. We would be grateful if anyone can point out any
egregious bad practice in our code, or enlighten us on why one approach is so much slower
than the other. The problem
2011 Oct 04
2
adding a dummy variable...
Hi all,
I have a dataset of individuals where the variable ID corresponds to the
identification of the household where the individual lives. rel.head stands
for the relationship with the household head. so rel.head=1 is the household
head, rel.head=2 is the spouse, rel.head=3 is the children.
Here is an example to see how it looks like:
df<-data.frame(ID=c("17100",
2008 Feb 26
2
Patch to add debugfs interface to o2net
This is a forward port for net_proc.c from 1.2.
2019 May 14
2
[PATCH v2 7/8] vsock/virtio: increase RX buffer size to 64 KiB
On 2019/5/14 ??1:51, Stefano Garzarella wrote:
> On Mon, May 13, 2019 at 06:01:52PM +0800, Jason Wang wrote:
>> On 2019/5/10 ??8:58, Stefano Garzarella wrote:
>>> In order to increase host -> guest throughput with large packets,
>>> we can use 64 KiB RX buffers.
>>>
>>> Signed-off-by: Stefano Garzarella <sgarzare at redhat.com>
>>> ---
2019 May 14
2
[PATCH v2 7/8] vsock/virtio: increase RX buffer size to 64 KiB
On 2019/5/14 ??1:51, Stefano Garzarella wrote:
> On Mon, May 13, 2019 at 06:01:52PM +0800, Jason Wang wrote:
>> On 2019/5/10 ??8:58, Stefano Garzarella wrote:
>>> In order to increase host -> guest throughput with large packets,
>>> we can use 64 KiB RX buffers.
>>>
>>> Signed-off-by: Stefano Garzarella <sgarzare at redhat.com>
>>> ---
2009 Jun 11
1
[PATCH 1/1] ocfs2/net: Use wait_event() in o2net_send_message_vec()
Replace wait_event_interruptible() with wait_event() in o2net_send_message_vec().
This is because this function is called by the dlm that expects signals to be
blocked.
Fixes oss bugzilla#1126
http://oss.oracle.com/bugzilla/show_bug.cgi?id=1126
Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
fs/ocfs2/cluster/tcp.c | 7 ++-----
1 files changed, 2 insertions(+), 5
2019 May 15
1
[PATCH v2 7/8] vsock/virtio: increase RX buffer size to 64 KiB
On 2019/5/15 ??12:20, Stefano Garzarella wrote:
> On Tue, May 14, 2019 at 11:38:05AM +0800, Jason Wang wrote:
>> On 2019/5/14 ??1:51, Stefano Garzarella wrote:
>>> On Mon, May 13, 2019 at 06:01:52PM +0800, Jason Wang wrote:
>>>> On 2019/5/10 ??8:58, Stefano Garzarella wrote:
>>>>> In order to increase host -> guest throughput with large packets,
2018 Dec 13
2
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
Hi Michael,
On 2018/12/12 23:31, Michael S. Tsirkin wrote:
> On Wed, Dec 12, 2018 at 05:31:39PM +0800, jiangyiwen wrote:
>> Guest receive mergeable rx buffer, it can merge
>> scatter rx buffer into a big buffer and then copy
>> to user space.
>>
>> In addition, it also use iovec to replace buf in struct
>> virtio_vsock_pkt, keep tx and rx consistency. The
2018 Dec 13
2
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
Hi Michael,
On 2018/12/12 23:31, Michael S. Tsirkin wrote:
> On Wed, Dec 12, 2018 at 05:31:39PM +0800, jiangyiwen wrote:
>> Guest receive mergeable rx buffer, it can merge
>> scatter rx buffer into a big buffer and then copy
>> to user space.
>>
>> In addition, it also use iovec to replace buf in struct
>> virtio_vsock_pkt, keep tx and rx consistency. The
2009 Jun 19
2
[PATCH/RFC] virtio_test: A module for testing virtio via userspace
Hello Rusty,
this is a result of a two month internship about virtio testing.
From: Adrian Schneider <adrian.schneider at de.ibm.com>
From: Tim Hofmann <tim.hofmann at de.ibm.com>
From: Christian Ehrhardt <ehrhardt at de.ibm.com>
From: Christian Borntraeger <borntraeger at de.ibm.com>
This patch introduces a prototype for a virtio_test module. This module can
be bound to
2009 Jun 19
2
[PATCH/RFC] virtio_test: A module for testing virtio via userspace
Hello Rusty,
this is a result of a two month internship about virtio testing.
From: Adrian Schneider <adrian.schneider at de.ibm.com>
From: Tim Hofmann <tim.hofmann at de.ibm.com>
From: Christian Ehrhardt <ehrhardt at de.ibm.com>
From: Christian Borntraeger <borntraeger at de.ibm.com>
This patch introduces a prototype for a virtio_test module. This module can
be bound to
2008 Oct 01
1
maximum likelihood with constraints in R
Hi R-experts,
There is lots of information about maximum likelihood estimation in R.
However, I didn't came across anything about maximum likelihood with constraints.
For example, estimation of parameters k(1) to k(20) with maximum likelihood, where sum(k(i)) = 0.
Is there any standard function in R that can do this, or is this something that I should set up myself?
Greetings,
Church