hawkes icon indicating copy to clipboard operation
hawkes copied to clipboard

fit.R source doesn't work

Open jeongmincha opened this issue 8 years ago • 6 comments

I installed ptproc(1.5.1) library and I tried to run your code 'fit.R', but I got several problems. At first time, I encountered the problem related to condition in penalty() function. I wrote as.character(quote(any(params < 0)))) instead of quote(any(params < 0))) and I fixed it. After that, I got another problem. The error was

> f <- fit(0.5, as.character(trade_times))
Nelder-Mead direct search function minimizer
 
 Error in if (any) returnflag <- alpha : 
  argument is not interpretable as logical 

In addition: Warning message:
In if (is.na(pts)) { :
  the condition has length > 1 and only the first element will be used

The traceback was

7. eval(expr, envir, enclos) 
6. eval(condition) 
5. fn(par, ...) 
4. (function (par) 
fn(par, ...))(structure(c(0.5, 1, 0.1), .Names = c("mu", "C", 
"a"))) 
3. optim(pstart, optim.logLik, method = method, control = optim.control, 
    ...) 
2. ptproc.fit(ppm, optim.control = list(trace = 2), alpha = 1e+05, 
    hessian = TRUE) 
1. fit(0.5, as.character(trade_times)) 

What should I do to solve this problem?

jeongmincha avatar Feb 22 '17 10:02 jeongmincha

My R Studio version is 1.0.136 and ptproc (1.5.1). macOS Sierra 10.12.3

jeongmincha avatar Feb 22 '17 10:02 jeongmincha

I suspect the ptproc API changed. I can have a look at a later point. Maybe check if there's anything obvious in the fit function like arguments clearly different.

jheusser avatar Feb 22 '17 10:02 jheusser

@jheusser Thank you. I hope you may check your code is working well in your certain setting. If then, please let me know detailed information. Thank you in advance :)

jeongmincha avatar Feb 22 '17 10:02 jeongmincha

@jeongmincha to be fair, the repo is 4 years old 😄 but I can see if I can update it to the latest versions.

jheusser avatar Feb 22 '17 10:02 jheusser

@jheusser Thank you for your attention :)
I hope I can use Hawkes process soon.

jeongmincha avatar Feb 22 '17 10:02 jeongmincha

I am using R (3.2.3). It says that: "package ‘ptproc’ is not available" :( @jeongmincha Even I hope to use Hawkes process soon!

ashishdandekar avatar Sep 10 '17 16:09 ashishdandekar