forked from observablehq/plot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinearRegression.d.ts
25 lines (20 loc) · 974 Bytes
/
linearRegression.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import type {ChannelValue, ChannelValueSpec} from "../channel.js";
import type {Data, MarkOptions, RenderableMark} from "../mark.js";
import type {Reducer} from "../reducer.js";
import type {BinOptions} from "../transforms/bin.js";
interface LinearRegressionOptions extends MarkOptions, BinOptions {
x?: ChannelValueSpec;
y?: ChannelValueSpec;
z?: ChannelValue;
ci?: number;
precision?: number;
reduce?: Reducer;
}
export interface LinearRegressionXOptions extends LinearRegressionOptions {
y?: ChannelValueSpec & Omit<BinOptions, "interval">; // interval must be mark-level option
}
export interface LinearRegressionYOptions extends LinearRegressionOptions {
x?: ChannelValueSpec & Omit<BinOptions, "interval">; // interval must be mark-level option
}
export function linearRegressionX(data?: Data, options?: LinearRegressionXOptions): RenderableMark;
export function linearRegressionY(data?: Data, options?: LinearRegressionYOptions): RenderableMark;