Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fit.R source doesn't work #2

Open
jeongmincha opened this issue Feb 22, 2017 · 6 comments
Open

fit.R source doesn't work #2

jeongmincha opened this issue Feb 22, 2017 · 6 comments

Comments

@jeongmincha
Copy link

jeongmincha commented Feb 22, 2017

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
Copy link
Author

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

@jheusser
Copy link
Owner

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.

@jeongmincha
Copy link
Author

@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 :)

@jheusser
Copy link
Owner

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

@jeongmincha
Copy link
Author

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

@ashishdandekar
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants