Skip to content

Commit 5872f49

Browse files
committed
docs update
1 parent e32394d commit 5872f49

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

docs/docs_cosinor.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Plots the raw data pairs (two groups of measurement on the same plot).
2525
* `folder`: folder to which the files are stored; if empty plots will be displayed instead of stored
2626
* `prefix`: prefix to the file names in which plots will be stored
2727

28-
### `plot_tuples_best_models(df, df_best_models, tuples, colors = ['black', 'red'], folder = '')`
28+
### `cosinor.plot_tuples_best_models(df, df_best_models, tuples, colors = ['black', 'red'], folder = '', **kwargs)`
2929
Plots the tests (raw data and fits) from `tuples` into the same graph using the data from `df` and models from `df_best_models`. If more than two tests are given in `tuples` colors should be specified.
3030

3131

@@ -47,15 +47,15 @@ Plots the phases in a polar coordinate system.
4747
* `labels`: labels assigned to each plot
4848

4949

50-
### `cosinor.fit_me(X, Y, n_components = 2, period = 24, model_type = 'lin', lin_comp = False, alpha = 0, name = '', save_to = '', plot=True, plot_residuals=False, plot_measurements=True, plot_margins=True, return_model = False, color = False, plot_phase = True)`
50+
### `cosinor.fit_me(X, Y, n_components = 2, period = 24, model_type = 'lin', lin_comp = False, alpha = 0, name = '', save_to = '', plot=True, plot_residuals=False, plot_measurements=True, plot_margins=True, return_model = False, color = False, plot_phase = True, hold=False, x_label = "", y_label = ""))`
5151
Perform the basic Cosinor regression
5252
#### Parameters
5353
* `X`: iterable of timepoints
5454
* `Y`: iterable of measurements
5555
* `n_components`: number of cosinor components to use
5656
* `period`: period to fit
57-
* `model_type`: by default linear model is used; if working with count data `poisson`, `gen_poisson` (generalized Poisson) or `nb`(negative binomial) can be specified.
5857
* `lin_comp`: if `True` linear componet (y ~ x) will also be included in the model
58+
* `model_type`: by default linear model is used; if working with count data `poisson`, `gen_poisson` (generalized Poisson) or `nb`(negative binomial) can be specified.
5959
* `alpha`: dispersion parameter - only with `nb` models - if the parameter is omitted it is assessed using the basic Poisson model ([more](https://dius.com.au/2017/08/03/using-statsmodels-glms-to-model-beverage-consumption/#cameron))
6060
* `name`: name to diplay
6161
* `folder`: folder to which the files are stored; if empty plots will be displayed instead of stored
@@ -67,6 +67,8 @@ Perform the basic Cosinor regression
6767
* `return_model`: if True model will be returned
6868
* `color`: the color to use when plotting; if False, black color will be used
6969
* `plot_phase`: if True phase plot will be made
70+
* `hold`: allows to plot multiple graphs in the same figure
71+
* `x_label`, `y_label`: if specified, these labels are used in the figure
7072
#### Returns
7173
* tuple which includes
7274
* `model`: if `return_model` was set to True
@@ -83,26 +85,26 @@ Perform the basic Cosinor regression
8385
* `Y_test`: measurement for additional plotting
8486

8587

86-
### `cosinor.population_fit(df, n_components = 2, period = 24, model_type = 'lin', lin_comp = False, alpha = 0,names = [], folder = '', prefix='', plot_measurements = True)`
88+
### `cosinor.population_fit(df_pop, n_components = 2, period = 24, lin_comp= False, model_type = 'lin', plot_on = True, plot_measurements=True, plot_individuals=True, plot_margins=True, save_to = '', x_label='', y_label='', **kwargs)
8789
Population fit (according to Cornelissen). For parameters and returns see `cosinor_fit.fit_me`
8890

8991

90-
### `cosinor.fit_group(df, n_components = 2, period = 24, lin_comp = False, names = [], folder = '', prefix='', plot_measurements = True, plot = True)`
92+
### `cosinor.fit_group(df, n_components = 2, period = 24, names = "", folder = '', prefix='', **kwargs)`
9193
Perform the multi-component cosinor fit to the measurement in the dataframe. Calls `cosinor.fit_me`.
9294
#### Parameters
9395
* `df`: pandas dataframe of measurements
9496
* `n_components`: number of cosinor components or list with numbers of cosinor components; if list of components is given, cosinor fits will be performed on cosinor models with different numbers of cosinor components
9597
* `period`: period or list of periods to fit
96-
* `lin_comp`: if `True` linear componet (y ~ x) will also be included in the model
9798
* `names`: list of groups names to fit; if empty all groups will be used
9899
* `folder`: folder to which the files are stored; if empty plots will be displayed instead of stored
99100
* `prefix`: prefix to the file names in which plots will be stored
100-
* `plot_measurements`: if True raw measurement are plotted
101-
* `plot`: if False plotting is not performed
101+
##### Keyword arguments:
102+
See arguments of `cosinor.fit_me`.
103+
102104
#### Returns
103105
* dataframe with statistics and parameters of each fit
104106

105-
### `cosinor.population_fit_group(df, n_components = 2, period = 24, model_type = 'lin', lin_comp = False, alpha = 0, names = [], folder = '', prefix='', plot_measurements = True)`
107+
### `cosinor.population_fit_group(df, n_components = 2, period = 24, folder = '', prefix='', names = [], **kwargs)`
106108
Perform the multi-component population-mean cosinor fit to the measurements in the dataframe. Parameters and returns are the same as in `cosinor.fit_group`. Calls `cosinor.population_fit`.
107109

108110
### `cosinor.get_best_fits(df_results, criterium = 'R2_adj', reverse = False, n_components = [])`
@@ -136,25 +138,25 @@ Plots the given models with the given data.
136138
### `cosinor.plot_df_models_population(df, df_models, plot_residuals=True, folder ="")`
137139
Plots the given population-mean models with the given data.
138140

139-
### `cosinor.compare_pairs(df, pairs, n_components = 3, period = 24, model_type = 'lin', lin_comp = False, alpha = 0, folder = '', prefix = '', plot_measurements=True)`
141+
### `cosinor.compare_pairs(df, pairs, n_components = 3, period = 24, folder = "", prefix = "", **kwargs)`
140142
Perform the LimoRhyde analysis of differential expression between the given pairs of measurements.
141143
#### Parameters
142144
* `df`: pandas dataframe of measurements
143145
* `pairs`: list of pairs to compare
144146
* `n_components`: number of cosinor components to be used in the model for comparison
145-
* `model_type`: by default linear model is used; if working with count data `poisson`, `gen_poisson` (generalized Poisson) or `nb`(negative binomial) can be specified.
146-
* `lin_comp`: if `True` linear componet (y ~ x) will also be included in the model
147-
* `alpha`: dispersion parameter - only with `nb` models - if the parameter is omitted it is assessed using the basic Poisson model ([more](https://dius.com.au/2017/08/03/using-statsmodels-glms-to-model-beverage-consumption/#cameron))
147+
* `period`: period to fit
148148
* `folder`: folder to which the plots are stored; if empty plots will be displayed instead of stored
149149
* `prefix`: prefix to the file names in which plots will be stored
150-
* `plot_measurements`: if True raw measurement are plotted
150+
##### Keyword arguments:
151+
See arguments of `cosinor.fit_me`.
152+
151153
#### Returns
152154
* dataframe with the results of comparison. These include p values for each added parameter and p value for the F statistic - should the more complex model be accepted? In the plot, the latter value is reported.
153155

154-
### `compare_pairs_best_models(df, df_best_models, pairs, model_type = 'lin', lin_comp = False, alpha = 0, folder = '', prefix = '', plot_measurements=True)`
156+
### `cosinor.compare_pairs_best_models(df, df_best_models, pairs, folder = "", prefix = "", **kwargs)`
155157
Compares pairs from `pairs` using the data from `df` and an optimal number of components from `df_best_models`.
156158

157-
### `compare_pair_df_extended(df, test1, test2, n_components = 3, period = 24, n_components2 = None, period2 = None, model_type = 'lin', lin_comp = False, alpha = 0, save_to = '', non_rhythmic = False, plot_measurements=True, plot_residuals=False, plot_margins=True)`
159+
### `cosinor.compare_pair_df_extended(df, test1, test2, n_components = 3, period = 24, n_components2 = None, period2 = None, lin_comp = False, model_type = 'lin', alpha = 0, save_to = '', non_rhythmic = False, plot_measurements=True, plot_residuals=False, plot_margins=True, x_label = '', y_label = '')`
158160
Compare two tests from `pair` using `n_components` cosinor with period equal to `period`. If `n_components2` or `period2` are specified, using a different number of components and/or period for the second model.
159161

160162
### `cosinor.compare_nonlinear(X1, Y1, X2, Y2, test1 = '', test2 = '', min_per = 18, max_per=36, compare_phase = False, compare_period = False, compare_amplitude = False, save_to = '', plot_residuals=False)`

0 commit comments

Comments
 (0)