Description Usage Arguments Details Value Author(s) Examples
Fit sin function
1 2 3 4 5 6 | fitSinCurve(
tt,
yy,
period = 24,
parStart = list(amp = 3, phase = 0, offset = 0)
)
|
tt |
Time vector. |
yy |
Expression vector. |
period |
Period of the sine curve. Default is 24. |
parStart |
Initial value for optimization purpose. |
Fit a sine curve where tt is time, and yy is expression value.
A list of amp, phase, offset, peak, A, B, SST, SSE, R2. Formula 1: yy = amp * sin(2π/period * (phase + tt)) + offset Formula 2: yy = A * sin(2π/period \times tt) + B * cos(2*π/period * tt) + offset
amp |
Amplitude based on formula 1. |
phase |
Phase based on formula 1, phase is restricted within (0, period). |
offset |
Basal level (vertical shift) based on formula 1 or on formula 2. |
A |
A based on formula 2. |
B |
B based on formula 2. |
tss |
Total sum of square. |
rss |
Residual sum of square, SSE/n is the MLE of the variance sigma square. |
R2 |
Pseudo R2 defined as (tss - rss)/tss. |
Caleb
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.