Skip to content

Commit

Permalink
Merge pull request #273 from berkeley-stat159/final
Browse files Browse the repository at this point in the history
updated format for final report
  • Loading branch information
timothy1191xa committed Dec 15, 2015
2 parents 928221c + ffb65c7 commit 79bf0e0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
8 changes: 7 additions & 1 deletion paper/final_sections/3_behavioral.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
\section{Behavioral Data Analysis}

\subsection{Introduction}
\noindent
First of all, we generated some summary statistics including correlation among variables, and tried both linear and logistic regression analysis for behavioral data. The scientific questions that we have are - if we can predict response time and response (to gamble or not to gamble) based on the gain and loss.
Expand Down Expand Up @@ -35,10 +36,15 @@ \subsection{Methods}
decisions: 1 (gamble) and 0 (not gamble). Right side of the line illustrates
the decision to not gamble and it takes up more area relative to the opposite
decision.
\paragraph
Logistic Regression is a statistical technique capable of predicting a binary outcome. Since, in this data, the researchers classify the decision to gamble as '1' or '0' otherwise, we can use logistic regression technique to explain the subject's tendency to gamble or not based on the condition of the gain and loss amount given in the process of experiment. Our goal is to identify the how gain and loss amount influence each subject's response. To do this, we use the statsmodels Logit function. We specify the response column in the behavior txt file as the one containing the variable we're trying to explain and the gain and loss columns as the predictor variables. After plotting the results on the plot, we were able to see some interesting behaviors of some subjects. As you see from the plot , Subject 1 is in general more risk seeking: as long as the gain amount is large enough as 20 dollars, he decides to gamble. However, Subject 3 shows the opposite behavior: she does not participate in the gamble when her loss amount is higher than 10 dollars no matter what the gain amount is. (To see the overall behaviors from all subjects, see the appendix) Overall, we could see that the logistic regression line fits well on the border between the decision to gamble and not gamble.



\subsection {Results}
I will update this
For linear regression, ratio is a significant predictor and people would actually care more about loss than gain.
\paragraph
The paper illustrates as ?people typically reject gambles that offer a 50/50 chance of gaining or losing money, unless the amount that could be gained is at least twice the amount that could be lost (Sabrina)?. In the experiment, the given gain and loss amount ratio to each subject is around 2 to 1. This refers subjects would not merely show risk averse behavior every trial. We could confirm this trend by observing the plots. We are hard to tell whether subjects are risk averse or not.



Expand Down
13 changes: 11 additions & 2 deletions paper/final_sections/4_image.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ \subsection{Methods}
Here are some of the methods (this needs to be updated soon as well.)

\subsubsection {Convolution}
Min, you will have to update this
Our experiment is event-oriented. The subject is shown with the different conditions such as gain and loss amounts over random time. After being provided with the conditions, the blood flow responses starts to fluctuate. To predict the fMRI signal to an event, we need to predict the hemodynamic responses to neural activity. A predictor neural time course is typically obtained by convolution of a condition of the experiment with a standard hemodynamic response function. With this predictor, we build our design matrix for our general linear model on each voxel of a subject's brain. To produce such predictor, we practiced two different approaches.
\begin{itemize}
\item Convolving with canonical HRF \\
A typical BOLD response to a single, impulsive stimulation resembles a linear combination of two Gamma function. This would model a signal is instantly at its peak level at the onset of a given condition and instantly undershoot back to around baseline with the offset of a condition. We can use this hemodynamic response function as a canonical one. Generally, the canonical HRF should be a good fit if we believe the subjects to be normal in many cortical regions. Using this canonical HRF will help us to find how much the canonical HRF has to be scaled enough to account for the signal. However, we want to be more in detail as long as the onsets of the HRF can happen in the middle of volumes due to the conditions given at different times. The amplitudes vary according to the parametric gain and loss conditions. Thus, the true shape of HRF for each subject should vary.


\item Convolving at finer time resolution \\
Therefore, we would make a neural and hemodynamic regressor at a finer time resolution than the TRs, and later sample this regressor at the TR onset times. This refers that stimulus onsets do not have to be synchronized with scan TRs.
\end {itemize}


\subsubsection {GLM}
The first matrix we get from convolution has five columns, which correspond to a column of ones and 4 cond.txt files in our dataset, respectively. After we get the convolution matrix, we use it as our design matrix to run the generalized linear regression on the image data. The dimension of our data is (64, 64, 34, 240), so, first we reshape our data into 2 dimensional array, which has the shape of (64*64*34, 240); the first dimension corresponds to 3-dimensional voxel indices and the second dimension corresponds to the time slice. Then we pass our design matrix into the glm function to calculate the related beta hats. Thus, there are in total 139624 beta hats that we get from the regression correspond to the first three dimensions of our image data. For example, the first beta hat contains the information about the voxel (0,0,0). Then we turn the beta hats back into 4-dimensional shape and run the diagnostic functions on the 4-d beta hats. Based on the predictors, we can calculate the fitted values and then the residuals. We use the MRSS of the first three dimensions as a measurement of our regression; in general, a smaller MRSS indicates a better performance of the regression model.
Expand Down Expand Up @@ -44,7 +53,7 @@ \subsection{Methods}
\subsubsection {PCA}

\subsection {Results}
this needs to be updated
In terms of convolution, to analyze the difference between two approaches, we compare the MRSS from two linear regressions on image data of three subjects (1,2,3) using convolution predictors from two different approaches. In the below table, we see the MRSS from linear regression using the latter approach has slightly lower residuals compared to the former method. This makes sense because, using the latter method, we are able to more elaborately preprocess the data.



Expand Down

0 comments on commit 79bf0e0

Please sign in to comment.