0% found this document useful (0 votes)
7 views15 pages

FastExpression Method

The document outlines various operators used in the WorldQuant BRAIN platform for data manipulation and analysis. It includes descriptions of arithmetic, logical, time series, and transformational operators that facilitate operations such as calculating averages, handling missing values, and normalizing data. These operators are essential for optimizing computational efficiency and improving data analysis in quantitative finance.

Uploaded by

ndbgm2k6
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
7 views15 pages

FastExpression Method

The document outlines various operators used in the WorldQuant BRAIN platform for data manipulation and analysis. It includes descriptions of arithmetic, logical, time series, and transformational operators that facilitate operations such as calculating averages, handling missing values, and normalizing data. These operators are essential for optimizing computational efficiency and improving data analysis in quantitative finance.

Uploaded by

ndbgm2k6
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
8128/26, 12.28 AM ‘WerldQuant BRAIN Simulate arn Data Competitir (2) Operators Q Search operators Unlock more complex operators at Expert, Master and Grandmaster Genius levels. Arithmetic | operator Description abst) Returns the absolute value of a number, removing any negative sig. “ htps:[Link]é[Link] 45 8128/26, 12.28 AM ‘WerldQuant BRAIN Simulate Alphas Learn Data Competitir (2) densify(x) Converts 3 grouping field of many buckets into lesser number of only available buckets so as - ‘to make working with grouping fields computationally efficient dividets yb xy xy inversetx) te logis) Calculates the natural logarithm ofthe input value. Commonly used to transform data that os has positive values maxi y. Maximum value of al inputs. Atleast 2 inputs are required htps:[Link]é[Link] 26 8128/26, 12.28 AM ‘WerldQuant BRAIN Simulate Alphas Learn Data Competitir (2) mukiplyix yo Mutiplies two oF more inputs element wise, Set fiker=true to treat NaNs as 0 before fiter=false), x* y ‘multiplication powerts ) my reverse(x) ~* signts) Returns the sign of a number: +1 for positive, 1 for negative, and 0 for zero. Ifthe input is z NaN, returns NaN. Input: Value of 7 instruments at day t (2,-3, 5, 6,3, NaN, ~10) Output: (1,-1, 4,1. 1, NaN -1) signed powers xrralsed to the power of y such that final result preserves sign of x htps:[Link]é[Link] 35 8128/26, 12.28 AM ‘WerldQuant BRAIN fiterfalse), x-y NaNs as 0 before subtraction, ” Logical [operator andiinputy,Input2) Returns 1 (true) ifboth inputs are 1 (true). Otherwise, returns 0 (false. ifelseinputs, input2, _The else operator returns one of two values based on a conciton. Ifthe condition is tue, t input 3) returns the fist value; Ifalse, it returns the second value. htps:[Link]é[Link] ans 8128/26, 12.28 AM ‘WerldQuant BRAIN Simulate Alphas Learn Data Competitir (2) it inpur2 Returns 1 (true) ifinputt isa larger than input2. Otherwise, returns 0 (false) inputt >= inp Returns 1 (true) if input! is 2 larger or the same as input2. Otherwise, returns 0 (false), Inputt!= inpur2 Returns 1 (true) input? and input? are different numbers. Otherwise, returns 0 (false), Is man(input) Input == NaN) return 1 else return 0 htps:[Link]é[Link] 515 8128/26, 12.28 AM ‘WerldQuant BRAIN simulate Alphas Learn Data Competiti, (2) Time Series | operate Descrstion days. ftom las changet Calas the rumber of dys since the last change the valu ofa gen variable x humps hump 0.01) Limits amount and magnitude of changes in input thus reducing tumnover kth_elementts dk, Returns the K-th value from atime series by looking back over a specified number of () days, Ignore="NaN") with the option to ignore certain values. Commonly used for backfilling missing data htps:[Link]é[Link] ens 8128/26, 12.28 AM ts. arg_maxtx, a) 'sarg_min(x, a) ts. [Link] @) ts_backflliglookback a, ‘WerldQuant BRAIN Simulate Alphas Learn Data Competitir (2) Returns the number of days since the maximum value occurred in the last d days of atime series. If today's value Is the maximum, returns 0; ifit was yesterday, returns 1, and so on. Returns the number of days since the minimum value occurred in atime series over the past, d days. IFtoday's value is the minimum, returns 0; if twas yesterday, returns 1, and so on. Show mare Calculates the lference between a value and its mean over a specified period, ignoring NaN values in the mean calculation. In shor, it returns x- ts, mean(x, d) with NaNs ignored, ‘Show mare Replaces missing (NaN) values in a time series with the most recent valid value from a specified lookback window, Improving data coverage and reducing risk from missing data htps:[Link]é[Link] m5 8128/26, 12.28 AM ‘WerldQuant BRAIN Simulate Alphas Learn Data Competitir (2) Counts the number of missing (NaN) values in a data series over a specified number of days ts covariancely, xd) Calculates the covariance between two time-series varlables, y and x, over the past d days, “ Useful for measuring how two variables move together within a specified historical window. Show mare ts_decay linear ‘Applies a near decay to time-series data over a set number of days, smaothing the data by dense = false) averaging recent values and reducing the impact of older or missing data, Show mare [Link], Returns the value of a variable x rom d days ago, Use this operator to access historical data ve points by specifying the desired time lag in days. htps:[Link]é[Link] ans 8128/26, 12.28 AM ts_meantx, ‘sproductix,d) ts_quantle(xd, driver="gaussian" ) ts_rank(x, d, constant ° ‘WerldQuant BRAIN Simulate Alphas Learn Data Competitir (2) Calculates the simple average (mean) value of a variable x over the past d days Returns the product ofthe values of x over the past d days, Useful for calculating geometric means and compounding returns or growth rates. Show mare Calculates the ts_rank of the input and transforms it using the inverse cumulative aistribution| function (quantile function) ofa specified probability istribution (default: Gaussian/normal), This helps to normalize or reshape the distribution of your data over a rolling window, ‘Show mare Ranks the value of a variable for each instrument over a specified number of past days, returning the rank ofthe current value (optionally adjusted by a constant). Useful for normalizing time-series data and highlighting relative performance over ime, htps:[Link]é[Link] ons 8128/26, 12.28 AM ‘WerldQuant BRAIN Simulate Alphas Learn Data Competitir (2) = Scales a time series to 8 0-1 range based on its minimum and maximum values over a °) specified period, with an optional constant shit. ts std_devix cd) Calculates the standard deviation of a data series x over the past d days, measuring how ve much the values deviate from their mean during that period. ‘Show mare ts step(t) Returns a counter of days, incrementing by one each day. Show mare [Link]) ‘Sum values of x for the past d days. ts ascore(e, d) Calculates the Z-score of atime series, showing how far today's value is from the recent e average, measured in standard deviations, Useful fr standardizing and comparing values overtime, htps:[Link]é[Link] sons 8128/26, 12.28 AM ‘WerldQuant BRAIN Simulate Alphas Learn Data Competitir (2) Operator normalizex, useStd = false, limit = 0.0) quantiles, driver ‘gaussian, sigma = 1.0) rank(s rate=2) scale(s, sal Descrintion Centers a daly cross section by subtracting the market mean; optionally divide by the cross sectional standard deviation and clamp the result to (2lmit, limit), NaNs are ignored in mean/std Ranks and shits a vector of Alpha values, then applies a chosen statistical distribution (gaussian, cauchy, or uniform) o reduce outliers, The sigma parameter controls the scale of the output. Ranks the values of the input x among all instruments, returning numbers evenly spaced between 0.0 and 1.0. Useful for normalizing data and reducing the impact of outliers. Scales the inout so that the sum of absolute values across all instruments equals a specified htps:[Link]é[Link] sts 8128/26, 12.28 AM winsorizet,s zscore(x) Vector ‘WerldQuant BRAIN Simulate Alphas Learn Data Competitir (2) \Winsorize limits values in @ data to within a specified number of standard deviations from the mean, reducing the impact of extreme outliers. Zscore isa numerical measurement that describes a value's relationship to the mean of a ‘group of values. Z-score is measured in terms of standard deviations from the mean [operator vec avety) Descriation Calculates the mean (average) of all elements in a vector feld for each instrument and date, converting vector data to a single matrix value. htps:[Link]é[Link] sans 8128/26, 12.28 AM ‘WerldQuant BRAIN simulate Alphas Learn Data Competiti, (2) Transformational | Operator Descriot uckeanoa, ‘The bucket operator creates custom groups by dviing data int buckets (anges based on rangew0, 1,0. ranked values of any data el. These buckets can then be ued wth group operators ke ‘kiotheFate, [Link] group rank group score ee NaNGroup=Fate or bucket‘ankoo, Buckets P2560, SkinBoth-Fase, NanGroupeFae) trade neta y.2) The trade-when operator changes Alpha values only when a speci condition Ismet keeps . previous Values otherwise, and can close positions by assigning NaN under an exit condition, Itis useful for reducing turnover and controlling when trades are executed htps:[Link]é[Link] 1385 8128/26, 12.28 AM group_backfill, group, d,std= 40) group_meantx, weight, group) group_neutralizetx, group) group_ranklx, group) ‘WerldQuant BRAIN Simulate Alphas Learn Data Competitir (2) Fills missing (NaN) values for instruments within the same group by calculating a winsorized mean of all non-NaN values over the past d days, The winsorized mean is computed by ‘rimming extreme values based on a specified standard deviation multiplier (st, default 4.0), Show mare Calculates the harmonic mean of a data feld within each specified group. Show mare Neutralizes Alpha values within each specified group by subtracting the group mean from ‘each value, Groups can be industry, sector, country, or any custom grouping. Show mare i Ranks each element within its group based on the input lel, assigning a value between 0.0 land 1,0, This helps compare items within the same group, such as stacks in the same industry Show mare i htps:[Link]é[Link] sans 8128/26, 12.28 AM ‘WerldQuant BRAIN Simulate Alphas Learn Data Competitir (2) group_zscore(x, group) Calculates the Z-score of each value within its group, showing how far each value is from the 228 -roup mean in terms of standard deviations. Useful for comparing values relative to their group, hitps:[Link] 155

You might also like