Displaying 10 results from an estimated 10 matches for "tvec".
Did you mean:
bvec
2004 Sep 16
1
Newbie q. need some help understanding this code.
...to see the
breakdown of the line by line code into plain english.
thanks for any insights or other comments.
sean
library(stepfun)
lv <- function(N=1000,cvec=c(1,0.005,0.6),x=c(50,100))
{
m<-length(cvec)
n<-length(x)
xmat<-matrix(nrow=N+1,ncol=n)
tvec<-vector("numeric",N)
h<-vector("numeric",m)
t<-0
xmat[1,]<-x
for (i in 1:N) {
h[1]<-cvec[1]*x[1]
h[2]<-cvec[2]*x[1]*x[2]
h[3]<-cvec[3]*x[2]
h0=sum(h)...
2011 Apr 29
1
Handling of irregular time series in lineChart
...em 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 <- as.POSIXct("2010-04-20 09:30:00.000");
tvec1 <- runif(1000,0,1000);
tvec1 <- sort(tvec1);
tvec1 <- t0+tvec1;
t0 <- as.POSIXct("2010-04-20 12:30:00.000");
tvec2 <- runif(1000,0,1000);
tvec2 <- sort(tvec2);
tvec2 <- t0+tvec2;
tvec <- c(tvec1,tvec2);
data <- cumsum(rnorm(length(tvec)));
tseries <- xts(...
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 do to get decimal days?
Tschüß
Tony Mei...
2007 Apr 05
2
Likelihood returning inf values to optim(L-BFGS-B) other options?
...'fn'
Zus?tzlich: Es gab 50 oder mehr Warnungen (Anzeige der ersten 50 mit
warnings())
--
And this is the likelihood function:
--
fn<-function(p) {
A1=(gamma(p[1]+x)*p[2]^p[1])/(gamma(p[1]))
A2=(gamma(p[3]+p[4])*gamma(p[4]+x))/(gamma(p[4])*gamma(p[3]+p[4]+x))
A3=(1/(p[2]+Tvec))^(p[1]+x)
A4=(p[3]/(p[4]+x-1))*((1/(p[2]+t_x))^(p[1]+x))
ll=sum(log(A1*A2*(A3+flag*A4)))
return(ll)
}
Thank you very much for your help in advance!
Best regards,
Michael
2011 Aug 26
3
How to vectorize a function to handle two vectors
...0.5, 1)
HestonCallVec <- function(phi, kVec, t)
{
sapply(kVec, function(k){Price_call(phi, k, t)})
}
HestonCallVec(phiHeston(subHeston), kV, 1)
subHeston <- c(0.6067,-0.7571,0.2928,0.0707,0.0654);
kV <- c(0.9,1,1.2,1.3)
tV <- c(0.1,0.4,0.5, 1)
HestonCallVec2 <- function(phi, kVec, tVec)
{
sapply(tVec, function(t){HestonCallVec(phi, kVec, t)})
}
HestonCallVec2(phiHeston(subHeston), kV, tV)
# This should give 4 values
This is what I tried for the mapply function, which returns a list, instead
of values.
HestonCallVec <- function(phi, kVec, t)
{
mapply(function(k, t){Price_call...
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
2000 Apr 10
1
Kernel Bug in file.c 69 (experimental kernel)
...018
Process smbd (pid: 18877, stackpage=c28b7000)
Stack: c020213b c020227f 00000045 00000000 00000200 0000050c c28b7e8c
00000000
c013251e c2099900 00000000 c2e7d7c0 00000001 c2099900 00000000
0000050c
00000000 c28b7f54 00000513 00000000 c28d5000 c2e7d7c0 00000200
00000000
Call Trace: [tvecs+35755/73400] [tvecs+36079/73400]
[__block_prepare_write+238/544] [cont_prepare_write+473/736]
[fat_get_block+0/288] [fat_prepare_write+38/48] [fat_get_block+0/288]
[generic_file_write+929/1344] [default_fat_file_write+34/96]
[fat_file_write+45/64] [sys_write+214/256] [system_call+52/64]
[st...
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",
2006 Feb 24
2
[LLVMdev] gcc like attributes and annotations
...the same type -> { int }
%struct.A = type { int }
%struct.B = type { int }
BTW: How would one generate a type alias like the above through the LLVM
API?
Is there a Type like TypeAlias - I couldn't find one. Here I
have no ability to set a name with a Type:
vector< const Type * > tvec = { Type::IntTy };
Type * ty = StructType::get( tvec );
But what I wanted to say is that they are the same type.
This structural type system (compared to nominal typesystems) is very
intersting and has good support for optimizations.
But sometimes it would be interesting to actually get symbo...