Bayesian age-period-cohort analysis with INLA

204 views
Skip to first unread message

jian iron

unread,
Feb 2, 2022, 6:05:00 AM2/2/22
to R-inla discussion group
Hello,I'm doing a projection using bayesian age-period-cohort analysis with INLA.
Here's the code:
counts <- read.csv("/Users/ironjian/Downloads/ironjian\ 4/death_counts.csv", header = T)
 pop <- read.csv("/Users/ironjian/Downloads/ironjian\ 4/total_popu.csv", header = T)
 agegroup = c("35-39", "40-44", "45-49", "50-54", "55-59", "60-64", "65-69", "70-74","75-79", "80-84")
us.APC = APCList(counts, pop, gf=5, agelab=agegroup)
 col <- c("grey20", "grey35", "grey50", "grey65", "grey75", "grey85")
 ratesByAge(us.APC, scale=100000, age=seq(37,82,5), per=1990:2019, col=col)
us.res = BAPC(us.APC, predict=list(npredict=10, retro=TRUE))
sh: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/INLA/bin/mac/64bit/inla: Permission denied
Error in inla.inlaprogram.has.crashed() :
  The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
  If this does help; please contact the developers at <he...@r-inla.org>.

What's the problem?
Thanks , sincerely looking forward to your reply.

Helpdesk

unread,
Feb 2, 2022, 6:06:15 AM2/2/22
to jian iron, R-inla discussion group

you may try to do, in shell

chmod +x /Library/Frameworks/R.framework/Versions/4.1/Resources/library/INLA/bin/mac/64bit/inla

or 'sudo chmod....'
--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion...@googlegroups.com.

-- 
Håvard Rue
he...@r-inla.org

jian iron

unread,
Feb 2, 2022, 8:16:56 AM2/2/22
to R-inla discussion group
I've tried but more errors arise:
counts <- read.csv("/Users/ironjian/Downloads/ironjian\ 4/death_counts.csv", header = T)
 pop <- read.csv("/Users/ironjian/Downloads/ironjian\ 4/total_popu.csv", header = T)
 agegroup = c("35-39", "40-44", "45-49", "50-54", "55-59", "60-64", "65-69", "70-74","75-79", "80-84")
us.APC = APCList(counts, pop, gf=5, agelab=agegroup)
 col <- c("grey20", "grey35", "grey50", "grey65", "grey75", "grey85")
 ratesByAge(us.APC, scale=100000, age=seq(37,82,5), per=1990:2019, col=col)
us.res = BAPC(us.APC, predict=list(npredict=10, retro=TRUE))
/Library/Frameworks/R.framework/Versions/4.1/Resources/library/INLA/bin/mac/64bit/inla: line 11: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/INLA/bin/mac/64bit/inla.binary: Permission denied
/Library/Frameworks/R.framework/Versions/4.1/Resources/library/INLA/bin/mac/64bit/inla: line 11: exec: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/INLA/bin/mac/64bit/inla.binary: cannot execute: Undefined error: 0

Error in inla.inlaprogram.has.crashed() :
  The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
  If this does help; please contact the developers at <he...@r-inla.org>.

INLA help

unread,
Feb 2, 2022, 8:20:22 AM2/2/22
to R-inla discussion group, jian iron
It’s an error in the installation.    Try to remove the inla package or even R-4.1 itself. And reinstall.  

Haavard Rue
HelpDesk 
help@r-inla. org

jian iron

unread,
Feb 2, 2022, 8:44:59 AM2/2/22
to R-inla discussion group
New errors arise after the reinstallation
install.packages("INLA",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/stable"), dep=TRUE)
library(INLA)
counts <- read.csv("/Users/ironjian/Downloads/ironjian\ 4/death_counts.csv", header = T)
 pop <- read.csv("/Users/ironjian/Downloads/ironjian\ 4/total_popu.csv", header = T)
 agegroup = c("35-39", "40-44", "45-49", "50-54", "55-59", "60-64", "65-69", "70-74","75-79", "80-84")
us.APC = APCList(counts, pop, gf=5, agelab=agegroup)
 col <- c("grey20", "grey35", "grey50", "grey65", "grey75", "grey85")
 ratesByAge(us.APC, scale=100000, age=seq(37,82,5), per=1990:2019, col=col)
us.res = BAPC(us.APC, predict=list(npredict=10, retro=TRUE))
Error in inla.check.control(control.inla, data) :
  Name `lincomb.derived.only' in control-argument `control.inla', is void.

  Valid ones are:
        adapt.hessian.max.trials
        adapt.hessian.mode
        adapt.hessian.scale
        adaptive.max
        adjust.weights
        b.strategy
        cmin
        constr.marginal.diagonal
        control.vb
        cpo.diff
        cutoff
        diagonal
        diff.logdens
        dz
        fast
        force.diagonal
        global.node.degree
        global.node.factor
        h
        huge
        improved.simplified.laplace
        int.design
        int.strategy
        interpolator
        lincomb.derived.correlation.matrix
        linear.correction
        mode.known
        npoints
        num.gradient
        num.hessian
        numint.abserr
        numint.maxfeval
        numint.relerr
        optimise.strategy
        optimiser
        parallel.linesearch
        print.joint.hyper
        reordering
        restart
        skip.configurations
        stencil
        step.factor
        step.len
        strategy
        stupid.search
        stupid.search.factor
        stupid.search.max.iter
        tolerance
        tolerance.f
        tolerance.g
        tolerance.step
        tolerance.x
        use.directions
        verbose

INLA help

unread,
Feb 2, 2022, 8:54:35 AM2/2/22
to R-inla discussion group, jian iron
Make sure you use R-4.1 and the testing version


The code you’re running is old and that argument that gives the error is not used anymore 

Haavard Rue
HelpDesk 
help@r-inla. org

Andrea Riebler

unread,
Feb 22, 2022, 7:38:30 AM2/22/22
to R-inla discussion group
The BAPC package has been updated so that it should work fine now.
Reply all
Reply to author
Forward
0 new messages