R/adjust_y.R
cat_lines3.Rd
This function uses many slopes, ver_offsets, sds to fit every lines, and use -sum(data_den_max) as target measure for optimizationuses
cat_lines3(
params,
fit_it = TRUE,
data,
start_pts,
k_bounds,
o_bounds,
s_bounds,
den_sd_cutoff,
den_ratio_cutoff,
num_checkFirst = 5,
num_checkLast = 10
)
A vector of parameters for optimization, the three values in it refer to slope, offset, and sd
A bollean variable; if it is TRUE, the function will return fit measure; if it is FALSE, the function will return fit information
A data.frame storing the fixation data including at least the x_pos and y_pos of each fixation
A data.frame containing the starting position of each text line. It has three columns:
x_pos: x position of the first word in each text line.
y_pos: y position of the first word in each text line.
trial_num: the trial number of the current start_pts
A list containing the lower and upper boundaries of slope; default value is [-0.1, 0.1]
A list containing the lower and upper boundaries of offset; defaul value is [-0.5*dist of adjacent text lines, 0.5*dist of adjacent text line])
A list containing the lower and upper boundaries of sd; default value is [1, 20]
A float variable for cutoff threshold for density; If it is Inf, use mean(inv_dnorm(exp(data_den_max))) + 3*sd(inv_dnorm(exp(data_den_max))) as cutoff (99.7% are accepted)
A float variable for cutoff threshold for density ratio (ratio between the maximum density and second maximum density)
An integer denoting the number of starting fixations used for checking start-reading bound; default value is 5
An integer denoting the number of ending fixations used for checking end-reading bound; default value is 10
A data.frame including fixation data, and fitting data including fit measures and fitted lines information. It adds the following columns:
line: Text line that each fixation belongs to
y_line: y position of the text line that each fixation is assigned to
y_res: Residualized y position of each fixation y_line + y_res will give the original y position of each fixation
slope: Optimized slope value for the fitted line that current fixation belongs to
offset: Optimizaed offset value for the fitted line that current fixation belongs to
sd: Optimized sd value for the fitted line that current fixation belongs to
fit_den: fitted density value of the fitted line that current fixation belongs to
fit_y_diff: fitted y difference of the fitted line that current fixation belongs to (accumulated y differences between each fixation and fitted lines)
This function uses many slopes, ver_offsets, sds to fit every lines, and use -sum(data_den_max) as target measure for optimizationuses