Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error in ...names() : could not find function "...names" #20

@mgzjys

Description

@mgzjys

Hello developers,

Thank you for the wonderful work! I am trying to use your package but was faced with some issues. I installed the package and then run the demo code below:

library(fmcmc)
set.seed(78845)
n <- 1000
X <- rnorm(n)
y <- 3.0 + 2.0*X + rnorm(n, sd = 4)

ll <- function(p, X., y.) {
  
  joint_ll <- dnorm(y. - (p[1] + X.*p[2]), sd = p[3], log = TRUE)
  joint_ll <- sum(joint_ll)
  
  if (!is.finite(joint_ll))
    return(-Inf)
  
  joint_ll
}

set.seed(1215)
ans <- MCMC(
  ll,
  initial = c(0, 0, sd(y)),
  nsteps  = 5000,
  X.      = X,
  y.      = y
)

However, it gave me an error said "Error in ...names() : could not find function "...names"". I am using R 4.0.2 with RStudio to run the code. Can you help me with this? Thank you very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions