mandymejia / BayesfMRI

BayesfMRI R package
GNU General Public License v3.0
24 stars 7 forks source link

INLA error #28

Closed smeisler closed 2 years ago

smeisler commented 2 years ago

Hi,

It appears that the there are symbols that are not being parsed correctly when doing the INLA implementation (EM=FALSE). This runs fine with EM.

SETTING UP DATA 
 .. reading in data for session 1
 .. reading in data for session 2
 MAKING DESIGN MATRICES 
 RUNNING MODELS 

 .. LEFT CORTEX ANALYSIS 
     848 locations removed due to NA or NaN values in at least one scan.
.... prewhitening... done!

 .... estimating model with INLAError in str2lang(x) : <text>:1:13: unexpected symbol
1: y ~ -1 + f(0Back_Body_HRF
                ^
Calls: BayesGLM_cifti ... as.formula -> formula -> formula.character -> str2lang
Execution halted

Best, Steven

mandymejia commented 2 years ago

Hi Steven,

Yikes! I have alerted Dan to this issue. Can this wait until he's back from vacation in a week or so?

Best, Mandy

Mandy Mejia, PhD Assistant Professor Department of Statistics Indiana University https://www.statmindlab.com/

On Wed, Jul 20, 2022 at 1:26 PM Steven Meisler @.***> wrote:

Hi,

It appears that the there are symbols that are not being parsed correctly when doing the INLA implementation (EM=FALSE). This runs fine with EM.

SETTING UP DATA .. reading in data for session 1 .. reading in data for session 2 MAKING DESIGN MATRICES RUNNING MODELS

.. LEFT CORTEX ANALYSIS 848 locations removed due to NA or NaN values in at least one scan. .... prewhitening... done!

.... estimating model with INLAError in str2lang(x) : :1:13: unexpected symbol 1: y ~ -1 + f(0Back_Body_HRF ^ Calls: BayesGLM_cifti ... as.formula -> formula -> formula.character -> str2lang Execution halted

Best, Steven

— Reply to this email directly, view it on GitHub https://github.com/mandymejia/BayesfMRI/issues/28, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHVKUXTMDLXFTLMWFBXSADVVBAHDANCNFSM54EVX7RA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

smeisler commented 2 years ago

Yes, no rush to fix this, thanks!

danieladamspencer commented 2 years ago

Hi all,

I'm back in the office and taking a look at this now. @smeisler , can you confirm that you are using the 2.0 branch of the package? It would also be helpful to have access to your data and the function call that you are using.

Thanks, Dan

danieladamspencer commented 2 years ago

Hey @smeisler, I think I understand what happened here. Your variable name cannot be parsed by the str2lang function. As a quick example, I tried running: str2lang("y ~ -1 + f(Back_Body_HRF)") which worked fine. However, when I tried: str2lang("y ~ -1 + f(0Back_Body_HRF)") I got the same error you're exhibiting. Can you try renaming the elements in the onsets list that you input into the model and let me know if you see improvements? I think the main problem here is you are using a numeric followed by characters, which does not translate well when trying to parse a formula. Try something like "Zero_Back_Body_HRF" instead of "0Back_Body_HRF".

I hope this fixes it! Dan

smeisler commented 2 years ago

Ah that makes sense, thanks! I presume that will fix it, so I will close it here and reopen if the problem persists.