Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

logDensity 'y' #5

Open
kellijohnson-NOAA opened this issue Jan 24, 2016 · 3 comments
Open

logDensity 'y' #5

kellijohnson-NOAA opened this issue Jan 24, 2016 · 3 comments

Comments

@kellijohnson-NOAA
Copy link
Contributor

I do not know where 'y' comes from in the logDensity function:
avg.pos[j] = log(mean(dgamma(y[nonZeros[j]], shape = gamma.a, rate=gamma.b))) and when I try and run the function on the results from a model I get the following error:
Error in dgamma(y[nonZeros[j]], shape = gamma.a, rate = gamma.b) : object 'y' not found

@ericward-noaa
Copy link
Contributor

That function wasn't updated during the last major code revision, but we need to do so. 'y' should be part of the data frame (basically the same as the estimation code).

@kellijohnson-NOAA
Copy link
Contributor Author

I am pretty sure I was able to fix the issues being caused because of non-attached data, but I am wondering if the calcs should support ECE distributions? @ericward-noaa would it be okay if I change this

obj$likelihood == "gamma"

to

grepl("gamma", obj$likelihood)

and the same for the lognormal?

@ericward-noaa
Copy link
Contributor

Yep -- totally fine with me, thanks for updating this!

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

No branches or pull requests

2 participants