Page 2 of 2

Re: Latent variable estimation

Posted: 26 Oct 2021, 02:18
by bokapatsila
Hi Stephane,

Thank you for your continuous enlightenment. Assuming that I still want to obtain allocation probabilities based on the estimates for latent variables without the choice component (for exploratory purposes). How can I code that in apollo? I tried adding to apollo_probabilities this:

Code: Select all

  V=list()
  V[["class_a"]] = delta_a
  V[["class_b"]] = delta_b + piLV1*LV1
  
  mnl_settings = list(
    alternatives = c(class_a=1, class_b=2), 
    avail        = 1, 
    choiceVar    = NA, 
    V            = V
  )
 P[["pi_values"]] = apollo_mnl(mnl_settings, functionality="raw")
And also this as another alternative:

Code: Select all

  classAlloc_settings = list(
    V = list(A = 0,
             B = delta_b + piLV1*LV1)
  )
 P[["pi_values"]] = apollo_classAlloc(classAlloc_settings)
But in both cases I got: "Error in f(init, x[]) : non-numeric argument to binary operator". Thank you in advance.

Re: Latent variable estimation

Posted: 26 Oct 2021, 08:08
by stephanehess
Hi

again, there is no such thing as an estimate of a latent variable, as it is latent. You can of course obtain the posteriors for the latent variable using the function apollo_conditionals.

You cannot use what you are doing below. There is nothing that the latent class part is calibrated on, so you would not obtain estimates of delta_a, delta_b and piLV1

Stephane