Skip to content

traj_objfun question #225

Discussion options

You must be logged in to vote

Hi Professor, I have been wondering if there is an error in my dmeasure function, so I used the Rprintf statement to output the process value.

    Rprintf(\"rho1 = %lg, Ratio_2_1 = %lg, Ratio_3_1 = %lg, Ratio_4_1 = %lg | \\n\", rho1,Ratio_2_1,Ratio_3_1,Ratio_4_1);

Then I realized that in ofun, transform was done by default. So I adjusted the program and it finally worked.

ofun <- traj_objfun(SEIRV, est = estpars)

lik <- numeric(simu_time)
for(i in 1:simu_time){
  coef(SEIRV, estpars) <- as.numeric(start.values[i,estpars])
  lik[i] <- ofun(coef(SEIRV, estpars, transform = TRUE))
}
start.values$lik <- lik

I hadn't noticed before that traj_objfun would perform a transform by default.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@Steven-Lau-lib
Comment options

Comment options

You must be logged in to vote
3 replies
@kingaa
Comment options

@Steven-Lau-lib
Comment options

@kingaa
Comment options

Answer selected by Steven-Lau-lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants